Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove username and password from interface #42

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove username and password from interface
- these fields are not used
BruceMacD committed Feb 6, 2024
commit 356999dd7f13abeab6987aa88d6514b959d01a50
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -98,8 +98,6 @@ ollama.pull(request)
- `request` `<Object>`: The request object containing pull parameters.
- `model` `<string>` The name of the model to pull.
- `insecure` `<boolean>`: (Optional) Pull from servers whose identity cannot be verified.
- `username` `<string>`: (Optional) Username of the user pulling the model.
- `password` `<string>`: (Optional) Password of the user pulling the model.
- `stream` `<boolean>`: (Optional) When true an `AsyncGenerator` is returned.
- Returns: `<ProgressResponse>`

@@ -112,8 +110,6 @@ ollama.push(request)
- `request` `<Object>`: The request object containing push parameters.
- `model` `<string>` The name of the model to push.
- `insecure` `<boolean>`: (Optional) Push to servers whose identity cannot be verified.
- `username` `<string>`: (Optional) Username of the user pushing the model.
- `password` `<string>`: (Optional) Password of the user pushing the model.
- `stream` `<boolean>`: (Optional) When true an `AsyncGenerator` is returned.
- Returns: `<ProgressResponse>`

4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@

private async processStreamableRequest<T extends object>(
endpoint: string,
request: { stream?: boolean } & Record<string, any>,

Check warning on line 59 in src/index.ts

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 59 in src/index.ts

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 59 in src/index.ts

GitHub Actions / test (20)

Unexpected any. Specify a different type
): Promise<T | AsyncGenerator<T>> {
request.stream = request.stream ?? false
const response = await utils.post(
@@ -83,7 +83,7 @@
yield message
// message will be done in the case of chat and generate
// message will be success in the case of a progress response (pull, push, create)
if ((message as any).done || (message as any).status === 'success') {

Check warning on line 86 in src/index.ts

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

GitHub Actions / test (20)

Unexpected any. Specify a different type
return
}
}
@@ -91,7 +91,7 @@
})()
} else {
const message = await itr.next()
if (!message.value.done && (message.value as any).status !== 'success') {

Check warning on line 94 in src/index.ts

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 94 in src/index.ts

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 94 in src/index.ts

GitHub Actions / test (20)

Unexpected any. Specify a different type
throw new Error('Expected a completed response.')
}
return message.value
@@ -249,8 +249,6 @@
name: request.model,
stream: request.stream,
insecure: request.insecure,
username: request.username,
password: request.password,
})
}

@@ -264,8 +262,6 @@
name: request.model,
stream: request.stream,
insecure: request.insecure,
username: request.username,
password: request.password,
})
}

4 changes: 0 additions & 4 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -76,16 +76,12 @@ export interface ChatRequest {
export interface PullRequest {
model: string
insecure?: boolean
username?: string
password?: string
stream?: boolean
}

export interface PushRequest {
model: string
insecure?: boolean
username?: string
password?: string
stream?: boolean
}


Unchanged files with check annotations Beta

data?: Record<string, unknown> | BodyInit,
options?: { signal: AbortSignal },
): Promise<Response> => {
const isRecord = (input: any): input is Record<string, unknown> => {

Check warning on line 67 in src/utils.ts

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 67 in src/utils.ts

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 67 in src/utils.ts

GitHub Actions / test (20)

Unexpected any. Specify a different type
return input !== null && typeof input === 'object' && !Array.isArray(input)
}