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

docs: specify the format for keep_alive duration #185

Merged
merged 2 commits into from
Jan 2, 2025
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ollama.chat(request)
- `images` `<Uint8Array[] | string[]>`: (Optional) Images to be included in the message, either as Uint8Array or base64 encoded strings.
- `format` `<string>`: (Optional) Set the expected format of the response (`json`).
- `stream` `<boolean>`: (Optional) When true an `AsyncGenerator` is returned.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded. A number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc.)
- `tools` `<Tool[]>`: (Optional) A list of tool calls the model may make.
- `options` `<Options>`: (Optional) Options to configure the runtime.

Expand All @@ -93,7 +93,7 @@ ollama.generate(request)
- `images` `<Uint8Array[] | string[]>`: (Optional) Images to be included, either as Uint8Array or base64 encoded strings.
- `format` `<string>`: (Optional) Set the expected format of the response (`json`).
- `stream` `<boolean>`: (Optional) When true an `AsyncGenerator` is returned.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded. A number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc.)
- `options` `<Options>`: (Optional) Options to configure the runtime.
- Returns: `<GenerateResponse>`

Expand Down Expand Up @@ -186,7 +186,7 @@ ollama.embed(request)
- `model` `<string>` The name of the model used to generate the embeddings.
- `input` `<string> | <string[]>`: The input used to generate the embeddings.
- `truncate` `<boolean>`: (Optional) Truncate the input to fit the maximum context length supported by the model.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded.
- `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded. A number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc.)
- `options` `<Options>`: (Optional) Options to configure the runtime.
- Returns: `<EmbedResponse>`

Expand Down
8 changes: 4 additions & 4 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
raw?: boolean
format?: string | object
images?: Uint8Array[] | string[]
keep_alive?: string | number
keep_alive?: string | number // a number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc)

options?: Partial<Options>
}
Expand All @@ -71,7 +71,7 @@
function: {
name: string;
arguments: {
[key: string]: any;

Check warning on line 74 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 74 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 74 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type
};
};
}
Expand Down Expand Up @@ -100,7 +100,7 @@
messages?: Message[]
stream?: boolean
format?: string | object
keep_alive?: string | number
keep_alive?: string | number // a number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc)
tools?: Tool[]

options?: Partial<Options>
Expand Down Expand Up @@ -146,15 +146,15 @@
model: string
input: string | string[]
truncate?: boolean
keep_alive?: string | number
keep_alive?: string | number // a number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc)

options?: Partial<Options>
}

export interface EmbeddingsRequest {
model: string
prompt: string
keep_alive?: string | number
keep_alive?: string | number // a number (seconds) or a string with a duration unit suffix ("300ms", "1.5h", "2h45m", etc)

options?: Partial<Options>
}
Expand Down Expand Up @@ -234,8 +234,8 @@
details: ModelDetails
messages: Message[]
modified_at: Date
model_info: Map<string, any>

Check warning on line 237 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 237 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 237 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type
projector_info?: Map<string, any>

Check warning on line 238 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected any. Specify a different type

Check warning on line 238 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected any. Specify a different type

Check warning on line 238 in src/interfaces.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type
}

export interface ListResponse {
Expand Down
Loading