From cd4d27e99878082bc09685b17978800fb0938eec Mon Sep 17 00:00:00 2001 From: Yaqub Mahmoud Date: Fri, 2 May 2025 12:49:29 +0900 Subject: [PATCH] Update stream-text.ts --- app/lib/.server/llm/stream-text.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/app/lib/.server/llm/stream-text.ts b/app/lib/.server/llm/stream-text.ts index 1f9ebd3..e58238c 100644 --- a/app/lib/.server/llm/stream-text.ts +++ b/app/lib/.server/llm/stream-text.ts @@ -43,12 +43,28 @@ export function streamText(messages: Messages, env: Env, options?: StreamingOpti // Use stock photos from unsplash where appropriate, only valid URLs you know exist. Do not download the images, only link to them in image tags. // `; + // return _streamText({ + // // model: azure('gpt-4o'), + // model: azure('gpt-4o-2'), + // system: getSystemPrompt(), + // messages: convertToCoreMessages(messages), + // maxTokens: 8192, + // ...options, + // }); + + const anthropic = createAnthropic({ + baseURL: process.env.RAKUTEN_AI_ANTHROPIC_URL, + apiKey: 'test', + }); + return _streamText({ - // model: azure('gpt-4o'), - model: azure('gpt-4o-2'), + model: anthropic('claude-3-7-sonnet-20250219'), system: getSystemPrompt(), + maxTokens: 16384, + headers: { + Authorization: `Bearer ${process.env.RAKUTEN_AI_GATEWAY_KEY}`, + }, messages: convertToCoreMessages(messages), - maxTokens: 8192, ...options, });