diff --git a/examples/external_clients/aisdk.ts b/examples/external_clients/aisdk.ts index 1a71fa47..83e35cc1 100644 --- a/examples/external_clients/aisdk.ts +++ b/examples/external_clients/aisdk.ts @@ -11,30 +11,24 @@ import { TextPart, } from "ai"; import { ChatCompletion } from "openai/resources/chat/completions"; -import { ChatCompletionOptions, LLMClient } from "../../lib/llm/LLMClient"; -import type { LogLine } from "../../types/log"; +import { + CreateChatCompletionOptions, + LLMClient, +} from "../../lib/llm/LLMClient"; import { AvailableModel } from "../../types/model"; export class AISdkClient extends LLMClient { public type = "aisdk" as const; - public logger: (message: LogLine) => void; private model: LanguageModel; - constructor({ - logger, - model, - }: { - logger?: (message: LogLine) => void; - model: LanguageModel; - }) { + constructor({ model }: { model: LanguageModel }) { super(model.modelId as AvailableModel); - this.logger = logger; this.model = model; } - async createChatCompletion( - options: ChatCompletionOptions, - ): Promise { + async createChatCompletion({ + options, + }: CreateChatCompletionOptions): Promise { const formattedMessages: CoreMessage[] = options.messages.map((message) => { if (Array.isArray(message.content)) { if (message.role === "system") {