mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
chore fixed typecheck
This commit is contained in:
@@ -5,6 +5,7 @@ import { getAPIKey } from '~/lib/.server/llm/api-key';
|
||||
import { getAnthropicModel } from '~/lib/.server/llm/model';
|
||||
|
||||
interface ToolResult<Name extends string, Args, Result> {
|
||||
state: 'result';
|
||||
toolCallId: string;
|
||||
toolName: Name;
|
||||
args: Args;
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/cloudflare';
|
||||
import { parseDataStreamPart } from 'ai';
|
||||
import { streamText } from '~/lib/.server/llm/stream-text';
|
||||
import { stripIndents } from '~/utils/stripIndent';
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
export async function action(args: ActionFunctionArgs) {
|
||||
return enhancerAction(args);
|
||||
}
|
||||
@@ -32,23 +28,9 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
|
||||
context.cloudflare.env,
|
||||
);
|
||||
|
||||
const transformStream = new TransformStream({
|
||||
transform(chunk, controller) {
|
||||
const processedChunk = decoder
|
||||
.decode(chunk)
|
||||
.split('\n')
|
||||
.filter((line) => line !== '')
|
||||
.map(parseDataStreamPart)
|
||||
.map((part) => part.value)
|
||||
.join('');
|
||||
|
||||
controller.enqueue(encoder.encode(processedChunk));
|
||||
},
|
||||
});
|
||||
|
||||
/*
|
||||
/**
|
||||
* WARNING: toAIStream has been removed from streamText
|
||||
* See migration guide at https://sdk.vercel.ai/docs/migrations
|
||||
* See migration guide at https://sdk.vercel.ai/docs/migrations.
|
||||
*/
|
||||
// result.toDataStream().pipeThrough(transformStream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user