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
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>`

Expand All @@ -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>`

Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 59 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 59 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type
): Promise<T | AsyncGenerator<T>> {
request.stream = request.stream ?? false
const response = await utils.post(
Expand All @@ -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

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 86 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type
return
}
}
Expand All @@ -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

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 94 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 94 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (20)

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

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

Expand Down
4 changes: 0 additions & 4 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading