refactor: replace isLoading with status (#861)

This commit is contained in:
Jeremy 2025-03-11 15:33:18 -07:00 committed by GitHub
parent 8e561dced4
commit 553a3d825a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 72 additions and 109 deletions

View file

@ -11,6 +11,8 @@ export const chatModel = new MockLanguageModelV1({
}),
doStream: async ({ prompt }) => ({
stream: simulateReadableStream({
chunkDelayInMs: 50,
initialDelayInMs: 100,
chunks: getResponseChunksByPrompt(prompt),
}),
rawCall: { rawPrompt: null, rawSettings: {} },
@ -26,6 +28,8 @@ export const reasoningModel = new MockLanguageModelV1({
}),
doStream: async ({ prompt }) => ({
stream: simulateReadableStream({
chunkDelayInMs: 50,
initialDelayInMs: 500,
chunks: getResponseChunksByPrompt(prompt, true),
}),
rawCall: { rawPrompt: null, rawSettings: {} },
@ -41,6 +45,8 @@ export const titleModel = new MockLanguageModelV1({
}),
doStream: async () => ({
stream: simulateReadableStream({
chunkDelayInMs: 50,
initialDelayInMs: 100,
chunks: [
{ type: 'text-delta', textDelta: 'This is a test title' },
{
@ -64,6 +70,8 @@ export const artifactModel = new MockLanguageModelV1({
}),
doStream: async ({ prompt }) => ({
stream: simulateReadableStream({
chunkDelayInMs: 50,
initialDelayInMs: 100,
chunks: getResponseChunksByPrompt(prompt),
}),
rawCall: { rawPrompt: null, rawSettings: {} },