Skip to content
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
11 changes: 11 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
*/
protected async processStreamableRequest<T extends object>(
endpoint: string,
request: { stream?: boolean } & Record<string, any>,

Check warning on line 75 in src/browser.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
): Promise<T | AbortableAsyncIterator<T>> {
request.stream = request.stream ?? false
const host = `${this.config.host}/api/${endpoint}`
Expand Down Expand Up @@ -327,6 +327,17 @@
return (await response.json()) as ListResponse
}

/**
* Returns the Ollama server version.
* @returns {Promise<{version: string}>} - The server version object.
*/
async version(): Promise<{ version: string }> {
const response = await utils.get(this.fetch, `${this.config.host}/api/version`, {
headers: this.config.headers,
})
return (await response.json()) as { version: string }
}

/**
* Performs web search using the Ollama web search API
* @param request {WebSearchRequest} - The search request containing query and options
Expand Down
Loading