Skip to content

Commit 503224e

Browse files
committed
fix function signature in node create
1 parent e32a64f commit 503224e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as utils from './utils.js'
2+
import { AbortableAsyncIterator } from './utils.js'
3+
24
import fs, { createReadStream, promises } from 'fs'
35
import { dirname, join, resolve } from 'path'
46
import { createHash } from 'crypto'
@@ -138,12 +140,12 @@ export class Ollama extends OllamaBrowser {
138140

139141
create(
140142
request: CreateRequest & { stream: true },
141-
): Promise<AsyncGenerator<ProgressResponse>>
143+
): Promise<AbortableAsyncIterator<ProgressResponse>>
142144
create(request: CreateRequest & { stream?: false }): Promise<ProgressResponse>
143145

144146
async create(
145147
request: CreateRequest,
146-
): Promise<ProgressResponse | AsyncGenerator<ProgressResponse>> {
148+
): Promise<ProgressResponse | AbortableAsyncIterator<ProgressResponse>> {
147149
let modelfileContent = ''
148150
if (request.path) {
149151
modelfileContent = await promises.readFile(request.path, { encoding: 'utf8' })

0 commit comments

Comments
 (0)