Skip to content

Commit

Permalink
Update deps (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
flakey5 authored Dec 14, 2024
1 parent 6cd28ee commit 219aaa8
Show file tree
Hide file tree
Showing 5 changed files with 1,544 additions and 2,417 deletions.
4 changes: 3 additions & 1 deletion ai-providers/ollama.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ReadableStream, UnderlyingByteSource, ReadableByteStreamController } from 'stream/web'
import { Ollama, ChatResponse, Message } from 'ollama'
import type { AbortableAsyncIterator } from 'ollama/src/utils.js'
import { AiProvider, ChatHistory, StreamChunkCallback } from './provider.js'
import { AiStreamEvent, encodeEvent } from './event.js'

type OllamaStreamResponse = AsyncGenerator<ChatResponse>
type OllamaStreamResponse = AbortableAsyncIterator<ChatResponse>

class OllamaByteSource implements UnderlyingByteSource {
type: 'bytes' = 'bytes'
Expand Down Expand Up @@ -74,6 +75,7 @@ export class OllamaProvider implements AiProvider {
stream: true
})

// @ts-expect-error polyfill type mismatch
return new ReadableStream(new OllamaByteSource(response, chunkCallback))
}

Expand Down
2 changes: 1 addition & 1 deletion cli/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function execute (): Promise<void> {
const generator = new Generator()

const config = {
port: parseInt(args.values.port as string),
port: parseInt(args.values.port),
hostname: args.values.hostname,
plugin: args.values.plugin,
tests: args.values.tests,
Expand Down
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const stackable: Stackable<AiWarpConfig, AiGenerator> = {
async app (app, opts) {
const fastify = app as unknown as FastifyInstance & AiWarpMixin
const { config } = fastify.platformatic
// @ts-expect-error
await fastify.register(fastifyUser as any, config.auth)
await fastify.register(authPlugin, opts)

Expand Down
Loading

0 comments on commit 219aaa8

Please sign in to comment.