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

Check warning on line 76 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 @@ -374,3 +374,5 @@

// export all types from the main entry point so that packages importing types dont need to specify paths
export * from './interfaces.js'

export type { AbortableAsyncIterator }
9 changes: 9 additions & 0 deletions test/browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { describe, it, expect, vi } from 'vitest'
import { Ollama } from '../src/browser'
import type { ChatResponse, GenerateResponse } from '../src/interfaces'
import type { AbortableAsyncIterator } from '../src/browser'

describe('AbortableAsyncIterator type export', () => {
it('should be importable from browser module', () => {
const typeCheck = (_: AbortableAsyncIterator<ChatResponse> | null) => {}
typeCheck(null)
expect(true).toBe(true)
})
})

describe('Ollama logprob request fields', () => {
it('forwards logprob settings in generate requests', async () => {
Expand Down
Loading