fix: update dependencies to fix type validation error (#33)

This commit is contained in:
Dominic Elm
2024-08-08 17:48:36 +02:00
committed by GitHub
parent 4b59a79baa
commit 7465cab8f8
4 changed files with 74 additions and 84 deletions

View File

@@ -49,6 +49,7 @@ export default class SwitchableStream extends TransformStream {
this._controller.enqueue(value);
}
} catch (error) {
console.log(error);
this._controller.error(error);
}
}

View File

@@ -1,5 +1,4 @@
import { type ActionFunctionArgs } from '@remix-run/cloudflare';
import { StreamingTextResponse } from 'ai';
import { MAX_RESPONSE_SEGMENTS, MAX_TOKENS } from '~/lib/.server/llm/constants';
import { CONTINUE_PROMPT } from '~/lib/.server/llm/prompts';
import { streamText, type Messages, type StreamingOptions } from '~/lib/.server/llm/stream-text';
@@ -44,7 +43,12 @@ async function chatAction({ context, request }: ActionFunctionArgs) {
stream.switchSource(result.toAIStream());
return new StreamingTextResponse(stream.readable);
return new Response(stream.readable, {
status: 200,
headers: {
contentType: 'text/plain; charset=utf-8',
},
});
} catch (error) {
console.log(error);

View File

@@ -16,7 +16,7 @@
"preview": "pnpm run build && pnpm run start"
},
"dependencies": {
"@ai-sdk/anthropic": "^0.0.30",
"@ai-sdk/anthropic": "^0.0.39",
"@codemirror/autocomplete": "^6.17.0",
"@codemirror/commands": "^6.6.0",
"@codemirror/lang-cpp": "^6.0.2",
@@ -46,7 +46,7 @@
"@xterm/addon-fit": "^0.10.0",
"@xterm/addon-web-links": "^0.11.0",
"@xterm/xterm": "^5.5.0",
"ai": "^3.2.27",
"ai": "^3.3.4",
"date-fns": "^3.6.0",
"diff": "^5.2.0",
"framer-motion": "^11.2.12",