Skip to content

Commit

Permalink
fix function signature in node create
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceMacD committed Jun 13, 2024
1 parent e32a64f commit 503224e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as utils from './utils.js'
import { AbortableAsyncIterator } from './utils.js'

import fs, { createReadStream, promises } from 'fs'
import { dirname, join, resolve } from 'path'
import { createHash } from 'crypto'
Expand Down Expand Up @@ -138,12 +140,12 @@ export class Ollama extends OllamaBrowser {

create(
request: CreateRequest & { stream: true },
): Promise<AsyncGenerator<ProgressResponse>>
): Promise<AbortableAsyncIterator<ProgressResponse>>
create(request: CreateRequest & { stream?: false }): Promise<ProgressResponse>

async create(
request: CreateRequest,
): Promise<ProgressResponse | AsyncGenerator<ProgressResponse>> {
): Promise<ProgressResponse | AbortableAsyncIterator<ProgressResponse>> {
let modelfileContent = ''
if (request.path) {
modelfileContent = await promises.readFile(request.path, { encoding: 'utf8' })
Expand Down

0 comments on commit 503224e

Please sign in to comment.