From f46792cf38aaeccdefe67409310e4546c19a7324 Mon Sep 17 00:00:00 2001 From: Stef Lewandowski Date: Thu, 19 Dec 2024 09:36:48 +0000 Subject: [PATCH 1/2] chore: upgrade to ai 4 --- apps/nextjs/package.json | 2 +- .../app/aila/[id]/download/useDownloadView.ts | 3 +- apps/nextjs/src/app/api/chat/chatHandler.ts | 50 +- apps/nextjs/src/app/api/chat/protocol.ts | 3 +- .../ContextProviders/ChatProvider.tsx | 11 +- packages/aila/package.json | 2 +- packages/aila/src/core/chat/types.ts | 2 +- pnpm-lock.yaml | 463 +++++------------- 8 files changed, 174 insertions(+), 362 deletions(-) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index a6a7f072f..4fa41afdd 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -68,7 +68,7 @@ "@trpc/server": "10.45.2", "@types/ramda": "^0.30.2", "@uidotdev/usehooks": "^2.4.1", - "ai": "^3.3.26", + "ai": "^4.0.20", "american-british-english-translator": "^0.2.1", "archiver": "^7.0.1", "axios": "^1.6.8", diff --git a/apps/nextjs/src/app/aila/[id]/download/useDownloadView.ts b/apps/nextjs/src/app/aila/[id]/download/useDownloadView.ts index ab80452e2..16dfc2b01 100644 --- a/apps/nextjs/src/app/aila/[id]/download/useDownloadView.ts +++ b/apps/nextjs/src/app/aila/[id]/download/useDownloadView.ts @@ -1,3 +1,4 @@ +import type { Message } from "@oakai/aila/src/core/chat"; import { getLastAssistantMessage } from "@oakai/aila/src/helpers/chat/getLastAssistantMessage"; import type { AilaPersistedChat } from "@oakai/aila/src/protocol/schema"; @@ -19,7 +20,7 @@ export function useDownloadView({ onStart: () => null, lesson: lessonPlan, chatId: id, - messageId: getLastAssistantMessage(messages)?.id, + messageId: messages.filter((m) => m.role === "assistant").pop()?.id, active: true, }; diff --git a/apps/nextjs/src/app/api/chat/chatHandler.ts b/apps/nextjs/src/app/api/chat/chatHandler.ts index 20f28706a..dc314fbac 100644 --- a/apps/nextjs/src/app/api/chat/chatHandler.ts +++ b/apps/nextjs/src/app/api/chat/chatHandler.ts @@ -18,10 +18,6 @@ import { withTelemetry } from "@oakai/core/src/tracing/serverTracing"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { prisma as globalPrisma } from "@oakai/db/client"; import { aiLogger } from "@oakai/logger"; -// #TODO StreamingTextResponse is deprecated. If we choose to adopt the "ai" package -// more fully, we should refactor to support its approach to streaming -// but this could be a significant change given we have our record-separator approach -import { StreamingTextResponse } from "ai"; import type { NextRequest } from "next/server"; import invariant from "tiny-invariant"; @@ -124,23 +120,41 @@ function handleConnectionAborted(req: NextRequest) { async function generateChatStream( aila: Aila, abortController: AbortController, -) { +): Promise { return await withTelemetry( "chat-aila-generate", { chat_id: aila.chatId, user_id: aila.userId }, async () => { - invariant(aila, "Aila instance is required"); - const result = await aila.generate({ abortController }); - const transformStream = new TransformStream({ - transform(chunk, controller) { - const formattedChunk = new TextEncoder().encode( - `0:${JSON.stringify(chunk)}\n`, - ); - controller.enqueue(formattedChunk); - }, - }); - - return result.pipeThrough(transformStream); + try { + invariant(aila, "Aila instance is required"); + const result = await aila.generate({ abortController }); + const transformStream = new TransformStream({ + transform(chunk, controller) { + const formattedChunk = new TextEncoder().encode( + `0:${JSON.stringify(chunk)}\n`, + ); + controller.enqueue(formattedChunk); + }, + }); + + const stream = result.pipeThrough(transformStream); + return new Response(stream, { + headers: { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive", + }, + }); + } catch (error) { + log.error("Error generating chat stream", { error }); + return new Response( + JSON.stringify({ error: "Stream generation failed" }), + { + status: 500, + headers: { "Content-Type": "application/json" }, + }, + ); + } }, ); } @@ -199,7 +213,7 @@ export async function handleChatPostRequest( const abortController = handleConnectionAborted(req); const stream = await generateChatStream(aila, abortController); - return new StreamingTextResponse(stream); + return stream; } catch (e) { return handleChatException(span, e, chatId, prisma); } finally { diff --git a/apps/nextjs/src/app/api/chat/protocol.ts b/apps/nextjs/src/app/api/chat/protocol.ts index 1f04d6bfb..838c880a7 100644 --- a/apps/nextjs/src/app/api/chat/protocol.ts +++ b/apps/nextjs/src/app/api/chat/protocol.ts @@ -2,7 +2,6 @@ import type { ActionDocument, ErrorDocument, } from "@oakai/aila/src/protocol/jsonPatchProtocol"; -import { StreamingTextResponse } from "ai"; export function streamingJSON(message: ErrorDocument | ActionDocument) { const jsonContent = JSON.stringify(message); @@ -10,7 +9,7 @@ export function streamingJSON(message: ErrorDocument | ActionDocument) { const errorEncoder = new TextEncoder(); - return new StreamingTextResponse( + return new Response( new ReadableStream({ start(controller) { controller.enqueue(errorEncoder.encode(errorMessage)); diff --git a/apps/nextjs/src/components/ContextProviders/ChatProvider.tsx b/apps/nextjs/src/components/ContextProviders/ChatProvider.tsx index 1fda7ec0d..80f04ad18 100644 --- a/apps/nextjs/src/components/ContextProviders/ChatProvider.tsx +++ b/apps/nextjs/src/components/ContextProviders/ChatProvider.tsx @@ -109,6 +109,13 @@ function getModerationFromMessage(message?: { content: string }) { return moderation; } +function isValidMessageRole(role: unknown): role is Message["role"] { + return ( + typeof role === "string" && + ["system", "assistant", "user", "data"].includes(role) + ); +} + export function ChatProvider({ id, children }: Readonly) { const { data: chat, @@ -179,7 +186,9 @@ export function ChatProvider({ id, children }: Readonly) { setMessages, } = useChat({ sendExtraMessageFields: true, - initialMessages: chat?.messages ?? [], + initialMessages: (chat?.messages ?? []).filter( + (m) => !["function", "tool"].includes(m.role), + ) as Message[], generateId: () => generateMessageId({ role: "user" }), id, body: { diff --git a/packages/aila/package.json b/packages/aila/package.json index 020372e30..4ad2d2756 100644 --- a/packages/aila/package.json +++ b/packages/aila/package.json @@ -32,7 +32,7 @@ "@oakai/logger": "*", "@sentry/nextjs": "^8.35.0", "@vercel/kv": "^0.2.2", - "ai": "^3.3.26", + "ai": "^4.0.20", "american-british-english-translator": "^0.2.1", "cloudinary": "^1.41.1", "dotenv-cli": "^6.0.0", diff --git a/packages/aila/src/core/chat/types.ts b/packages/aila/src/core/chat/types.ts index 084d29713..763b01c34 100644 --- a/packages/aila/src/core/chat/types.ts +++ b/packages/aila/src/core/chat/types.ts @@ -2,7 +2,7 @@ import { z } from "zod"; export const MessageSchema = z.object({ content: z.string(), - role: z.enum(["system", "assistant", "user"]), + role: z.enum(["system", "assistant", "user", "data"]), id: z.string(), }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77b25dee2..1071c72e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -192,8 +192,8 @@ importers: specifier: ^2.4.1 version: 2.4.1(react-dom@18.2.0)(react@18.2.0) ai: - specifier: ^3.3.26 - version: 3.3.26(openai@4.58.2)(react@18.2.0)(svelte@5.4.0)(vue@3.5.13)(zod@3.23.8) + specifier: ^4.0.20 + version: 4.0.20(react@18.2.0)(zod@3.23.8) american-british-english-translator: specifier: ^0.2.1 version: 0.2.1 @@ -493,8 +493,8 @@ importers: specifier: ^0.2.2 version: 0.2.2 ai: - specifier: ^3.3.26 - version: 3.3.26(openai@4.58.2)(react@18.2.0)(svelte@5.4.0)(vue@3.5.13)(zod@3.23.8) + specifier: ^4.0.20 + version: 4.0.20(react@18.2.0)(zod@3.23.8) american-british-english-translator: specifier: ^0.2.1 version: 0.2.1 @@ -980,96 +980,69 @@ packages: zod: 3.23.8 dev: false - /@ai-sdk/provider@0.0.22: - resolution: {integrity: sha512-smZ1/2jL/JSKnbhC6ama/PxI2D/psj+YAe0c0qpd5ComQCNFltg72VFf0rpUSFMmFuj1pCCNoBOCrvyl8HTZHQ==} - engines: {node: '>=18'} - dependencies: - json-schema: 0.4.0 - dev: false - - /@ai-sdk/react@0.0.54(react@18.2.0)(zod@3.23.8): - resolution: {integrity: sha512-qpDTPbgP2B/RPS9E1IchSUuiOT2X8eY6q9/dT+YITa/9T4zxR1oTGyzR/bb29Eic301YbmfHVG/4x3Dv2nPELA==} + /@ai-sdk/provider-utils@2.0.4(zod@3.23.8): + resolution: {integrity: sha512-GMhcQCZbwM6RoZCri0MWeEWXRt/T+uCxsmHEsTwNvEH3GDjNzchfX25C8ftry2MeEOOn6KfqCLSKomcgK6RoOg==} engines: {node: '>=18'} peerDependencies: - react: ^18 || ^19 zod: ^3.0.0 peerDependenciesMeta: - react: - optional: true zod: optional: true dependencies: - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - '@ai-sdk/ui-utils': 0.0.40(zod@3.23.8) - react: 18.2.0 - swr: 2.2.5(react@18.2.0) + '@ai-sdk/provider': 1.0.2 + eventsource-parser: 3.0.0 + nanoid: 3.3.8 + secure-json-parse: 2.7.0 zod: 3.23.8 dev: false - /@ai-sdk/solid@0.0.43(zod@3.23.8): - resolution: {integrity: sha512-7PlPLaeMAu97oOY2gjywvKZMYHF+GDfUxYNcuJ4AZ3/MRBatzs/U2r4ClT1iH8uMOcMg02RX6UKzP5SgnUBjVw==} + /@ai-sdk/provider@0.0.22: + resolution: {integrity: sha512-smZ1/2jL/JSKnbhC6ama/PxI2D/psj+YAe0c0qpd5ComQCNFltg72VFf0rpUSFMmFuj1pCCNoBOCrvyl8HTZHQ==} engines: {node: '>=18'} - peerDependencies: - solid-js: ^1.7.7 - peerDependenciesMeta: - solid-js: - optional: true dependencies: - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - '@ai-sdk/ui-utils': 0.0.40(zod@3.23.8) - transitivePeerDependencies: - - zod + json-schema: 0.4.0 dev: false - /@ai-sdk/svelte@0.0.45(svelte@5.4.0)(zod@3.23.8): - resolution: {integrity: sha512-w5Sdl0ArFIM3Fp8BbH4TUvlrS84WP/jN/wC1+fghMOXd7ceVO3Yhs9r71wTqndhgkLC7LAEX9Ll7ZEPfW9WBDA==} + /@ai-sdk/provider@1.0.2: + resolution: {integrity: sha512-YYtP6xWQyaAf5LiWLJ+ycGTOeBLWrED7LUrvc+SQIWhGaneylqbaGsyQL7VouQUeQ4JZ1qKYZuhmi3W56HADPA==} engines: {node: '>=18'} - peerDependencies: - svelte: ^3.0.0 || ^4.0.0 - peerDependenciesMeta: - svelte: - optional: true dependencies: - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - '@ai-sdk/ui-utils': 0.0.40(zod@3.23.8) - sswr: 2.1.0(svelte@5.4.0) - svelte: 5.4.0 - transitivePeerDependencies: - - zod + json-schema: 0.4.0 dev: false - /@ai-sdk/ui-utils@0.0.40(zod@3.23.8): - resolution: {integrity: sha512-f0eonPUBO13pIO8jA9IGux7IKMeqpvWK22GBr3tOoSRnO5Wg5GEpXZU1V0Po+unpeZHyEPahrWbj5JfXcyWCqw==} + /@ai-sdk/react@1.0.6(react@18.2.0)(zod@3.23.8): + resolution: {integrity: sha512-8Hkserq0Ge6AEi7N4hlv2FkfglAGbkoAXEZ8YSp255c3PbnZz6+/5fppw+aROmZMOfNwallSRuy1i/iPa2rBpQ==} engines: {node: '>=18'} peerDependencies: + react: ^18 || ^19 || ^19.0.0-rc zod: ^3.0.0 peerDependenciesMeta: + react: + optional: true zod: optional: true dependencies: - '@ai-sdk/provider': 0.0.22 - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - json-schema: 0.4.0 - secure-json-parse: 2.7.0 + '@ai-sdk/provider-utils': 2.0.4(zod@3.23.8) + '@ai-sdk/ui-utils': 1.0.5(zod@3.23.8) + react: 18.2.0 + swr: 2.2.5(react@18.2.0) + throttleit: 2.1.0 zod: 3.23.8 - zod-to-json-schema: 3.23.2(zod@3.23.8) dev: false - /@ai-sdk/vue@0.0.45(vue@3.5.13)(zod@3.23.8): - resolution: {integrity: sha512-bqeoWZqk88TQmfoPgnFUKkrvhOIcOcSH5LMPgzZ8XwDqz5tHHrMHzpPfHCj7XyYn4ROTFK/2kKdC/ta6Ko0fMw==} + /@ai-sdk/ui-utils@1.0.5(zod@3.23.8): + resolution: {integrity: sha512-DGJSbDf+vJyWmFNexSPUsS1AAy7gtsmFmoSyNbNbJjwl9hRIf2dknfA1V0ahx6pg3NNklNYFm53L8Nphjovfvg==} engines: {node: '>=18'} peerDependencies: - vue: ^3.3.4 + zod: ^3.0.0 peerDependenciesMeta: - vue: + zod: optional: true dependencies: - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - '@ai-sdk/ui-utils': 0.0.40(zod@3.23.8) - swrv: 1.0.4(vue@3.5.13) - vue: 3.5.13(typescript@5.7.2) - transitivePeerDependencies: - - zod + '@ai-sdk/provider': 1.0.2 + '@ai-sdk/provider-utils': 2.0.4(zod@3.23.8) + zod: 3.23.8 + zod-to-json-schema: 3.24.1(zod@3.23.8) dev: false /@alloc/quick-lru@5.2.0: @@ -5012,7 +4985,7 @@ packages: p-retry: 4.6.2 uuid: 9.0.1 zod: 3.23.8 - zod-to-json-schema: 3.23.2(zod@3.23.8) + zod-to-json-schema: 3.24.1(zod@3.23.8) dev: false /@langchain/openai@0.0.14: @@ -5023,7 +4996,7 @@ packages: js-tiktoken: 1.0.7 openai: 4.58.2(zod@3.23.8) zod: 3.23.8 - zod-to-json-schema: 3.23.2(zod@3.23.8) + zod-to-json-schema: 3.24.1(zod@3.23.8) transitivePeerDependencies: - encoding dev: false @@ -6309,8 +6282,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-alert-dialog@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-5xzWppXTNZe6zFrTTwAJIoMJeZmdFe0l8ZqQrPGKAVvhdyOWR4r53/G7SZqx6/uf1J441oxK7GzmTkrrWDroHA==} + /@radix-ui/react-alert-dialog@1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-A6Kh23qZDLy3PSU4bh2UJZznOrUdHImIXqF8YtUa6CN73f8EOO9XlXSCd9IHyPvIquTaa/kwaSWzZTtUvgXVGw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6325,7 +6298,7 @@ packages: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dialog': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -6547,8 +6520,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-context-menu@2.2.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-i4ZjZNoiAKwxcaKBR5XdiOyEJQdBT4P6TeMtzP4fjlcDJpxwIcmmWkdd13YEzCHHcWYZOyl7fVHKT8dFMHdo3w==} + /@radix-ui/react-context-menu@2.2.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-ap4wdGwK52rJxGkwukU1NrnEodsUFQIooANKu+ey7d6raQ2biTcEf8za1zr0mgFHieevRTB2nK4dJeN8pTAZGQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6562,7 +6535,7 @@ packages: dependencies: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-menu': 2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -6599,8 +6572,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-dialog@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-ujGvqQNkZ0J7caQyl8XuZRj2/TIrYcOGwqz5TeD1OMcCdfBuEMP0D12ve+8J5F9XuNUth3FAKFWo/wt0E/GJrQ==} + /@radix-ui/react-dialog@1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Ur7EV1IwQGCyaAuyDRiOLA5JIUZxELJljF+MbM/2NC0BYwfuRrbpS30BiQBJrVruscgUkieKkqXYDOoByaxIoA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6615,7 +6588,7 @@ packages: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -6629,7 +6602,7 @@ packages: aria-hidden: 1.2.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) + react-remove-scroll: 2.6.2(@types/react@18.2.57)(react@18.2.0) dev: false /@radix-ui/react-direction@1.0.1(@types/react@18.2.57)(react@18.2.0): @@ -6684,8 +6657,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-dismissable-layer@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-kEHnlhv7wUggvhuJPkyw4qspXLJOdYoAP4dO2c8ngGuXTq1w/HZp1YeVB+NQ2KbH1iEG+pvOCGYSqh9HZOz6hg==} + /@radix-ui/react-dismissable-layer@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6708,8 +6681,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-dropdown-menu@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eKyAfA9e4HOavzyGJC6kiDIlHMPzAU0zqSqTg+VwS0Okvb9nkTo7L4TugkCUqM3I06ciSpdtYQ73cgB7tyUgVw==} + /@radix-ui/react-dropdown-menu@2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-iXU1Ab5ecM+yEepGAWK8ZhMyKX4ubFdCNtol4sT9D0OVErG9PNElfx3TQhjw7n7BC5nFVz68/5//clWy+8TXzA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6725,7 +6698,7 @@ packages: '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-menu': 2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -6794,8 +6767,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-hover-card@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-D+o67Fd7fjkW10ycdsse1sYuGV9dNQKOhoVii7ksSfUYqQiTPxz9bP/Vu1g6huJ1651/2j8q7JGGWSIBIuGO1Q==} + /@radix-ui/react-hover-card@1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-QSUUnRA3PQ2UhvoCv3eYvMnCAgGQW+sTu86QPuNb+ZMi+ZENd6UWpiXbcWDQ4AEaKF9KKpCHBeaJz9Rw6lRlaQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6810,7 +6783,7 @@ packages: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) @@ -6879,8 +6852,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-menu@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-wY5SY6yCiJYP+DMIy7RrjF4shoFpB9LJltliVwejBm8T2yepWDJgKBhIFYOGWYR/lFHOCtbstN9duZFu6gmveQ==} + /@radix-ui/react-menu@2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-BnOgVoL6YYdHAG6DtXONaR29Eq4nvbi8rutrV/xlr3RQCMMb3yqP85Qiw/3NReozrSW+4dfLkK+rc1hb4wPU/A==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6897,7 +6870,7 @@ packages: '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -6913,11 +6886,11 @@ packages: aria-hidden: 1.2.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) + react-remove-scroll: 2.6.2(@types/react@18.2.57)(react@18.2.0) dev: false - /@radix-ui/react-popover@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-MBDKFwRe6fi0LT8m/Jl4V8J3WbS/UfXJtsgg8Ym5w5AyPG3XfHH4zhBp1P8HmZK83T8J7UzVm6/JpDE3WMl1Dw==} + /@radix-ui/react-popover@1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-aUACAkXx8LaFymDma+HQVji7WhvEhpFJ7+qPz17Nf4lLZqtreGOFRiNQWQmhzp7kEWg9cOyyQJpdIMUMPc/CPw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6932,7 +6905,7 @@ packages: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -6947,7 +6920,7 @@ packages: aria-hidden: 1.2.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) + react-remove-scroll: 2.6.2(@types/react@18.2.57)(react@18.2.0) dev: false /@radix-ui/react-popper@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): @@ -7220,8 +7193,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-select@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-tlLwaewTfrKetiex8iW9wwME/qrYlzlH0qcgYmos7xS54MO00SiPHasLoAykg/yVrjf41GQptPPi4oXzrP+sgg==} + /@radix-ui/react-select@2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-pOkb2u8KgO47j/h7AylCj7dJsm69BXcjkrvTqMptFqsE2i0p8lHkfgneXKjAgPzBMivnoMyt8o4KiV4wYzDdyQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7239,7 +7212,7 @@ packages: '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -7257,7 +7230,7 @@ packages: aria-hidden: 1.2.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) + react-remove-scroll: 2.6.2(@types/react@18.2.57)(react@18.2.0) dev: false /@radix-ui/react-separator@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): @@ -7424,8 +7397,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-tooltip@1.1.5(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-IucoQPcK5nwUuztaxBQvudvYwH58wtRcJlv1qvaMSyIbL9dEBfFN0vRf/D8xDbu6HmAJLlNGty4z8Na+vIqe9Q==} + /@radix-ui/react-tooltip@1.1.6(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-TLB5D8QLExS1uDn7+wH/bjEmRurNMTzNrtq7IjaS4kjion9NtzsTGkvR5+i7yc9q01Pi2KMM2cN3f8UG4IvvXA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7440,7 +7413,7 @@ packages: '@radix-ui/primitive': 1.1.1 '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) @@ -7705,27 +7678,27 @@ packages: '@radix-ui/colors': 2.0.1 '@radix-ui/primitive': 1.1.1 '@radix-ui/react-accessible-icon': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-alert-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-alert-dialog': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-aspect-ratio': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-avatar': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-checkbox': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-context-menu': 2.2.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-context-menu': 2.2.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dialog': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dropdown-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dropdown-menu': 2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-form': 0.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-hover-card': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-popover': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-hover-card': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popover': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-radio-group': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-scroll-area': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-select': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-select': 2.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-separator': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-slider': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-switch': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-tabs': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-tooltip': 1.1.5(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-tooltip': 1.1.6(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -9851,80 +9824,6 @@ packages: tinyrainbow: 1.2.0 dev: true - /@vue/compiler-core@3.5.13: - resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} - dependencies: - '@babel/parser': 7.26.2 - '@vue/shared': 3.5.13 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.2.1 - dev: false - - /@vue/compiler-dom@3.5.13: - resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} - dependencies: - '@vue/compiler-core': 3.5.13 - '@vue/shared': 3.5.13 - dev: false - - /@vue/compiler-sfc@3.5.13: - resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} - dependencies: - '@babel/parser': 7.26.2 - '@vue/compiler-core': 3.5.13 - '@vue/compiler-dom': 3.5.13 - '@vue/compiler-ssr': 3.5.13 - '@vue/shared': 3.5.13 - estree-walker: 2.0.2 - magic-string: 0.30.14 - postcss: 8.4.49 - source-map-js: 1.2.1 - dev: false - - /@vue/compiler-ssr@3.5.13: - resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} - dependencies: - '@vue/compiler-dom': 3.5.13 - '@vue/shared': 3.5.13 - dev: false - - /@vue/reactivity@3.5.13: - resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==} - dependencies: - '@vue/shared': 3.5.13 - dev: false - - /@vue/runtime-core@3.5.13: - resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==} - dependencies: - '@vue/reactivity': 3.5.13 - '@vue/shared': 3.5.13 - dev: false - - /@vue/runtime-dom@3.5.13: - resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==} - dependencies: - '@vue/reactivity': 3.5.13 - '@vue/runtime-core': 3.5.13 - '@vue/shared': 3.5.13 - csstype: 3.1.3 - dev: false - - /@vue/server-renderer@3.5.13(vue@3.5.13): - resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==} - peerDependencies: - vue: 3.5.13 - dependencies: - '@vue/compiler-ssr': 3.5.13 - '@vue/shared': 3.5.13 - vue: 3.5.13(typescript@5.7.2) - dev: false - - /@vue/shared@3.5.13: - resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} - dev: false - /@webassemblyjs/ast@1.12.1: resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} dependencies: @@ -10228,14 +10127,6 @@ packages: acorn: 8.14.0 dev: false - /acorn-typescript@1.4.13(acorn@8.14.0): - resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} - peerDependencies: - acorn: '>=8.9.0' - dependencies: - acorn: 8.14.0 - dev: false - /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -10321,48 +10212,27 @@ packages: indent-string: 5.0.0 dev: false - /ai@3.3.26(openai@4.58.2)(react@18.2.0)(svelte@5.4.0)(vue@3.5.13)(zod@3.23.8): - resolution: {integrity: sha512-UOklRlYM7E/mr2WVtz3iluU4Ja68XYlMLEHL2mxggMcrnhN45E1seu2NXpjZsq1anyIkgBbHN14Lo0R4A9jt/A==} + /ai@4.0.20(react@18.2.0)(zod@3.23.8): + resolution: {integrity: sha512-dYevYKtREcjSVopBDFWVNca7WJEI1p9Vr9eo7V7fZHzi2vXGDyEa2WYatjFbpR6z6gpVAxKHsof8EoN+B1IAsA==} engines: {node: '>=18'} peerDependencies: - openai: ^4.42.0 - react: ^18 || ^19 - sswr: ^2.1.0 - svelte: ^3.0.0 || ^4.0.0 + react: ^18 || ^19 || ^19.0.0-rc zod: ^3.0.0 peerDependenciesMeta: - openai: - optional: true react: optional: true - sswr: - optional: true - svelte: - optional: true zod: optional: true dependencies: - '@ai-sdk/provider': 0.0.22 - '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - '@ai-sdk/react': 0.0.54(react@18.2.0)(zod@3.23.8) - '@ai-sdk/solid': 0.0.43(zod@3.23.8) - '@ai-sdk/svelte': 0.0.45(svelte@5.4.0)(zod@3.23.8) - '@ai-sdk/ui-utils': 0.0.40(zod@3.23.8) - '@ai-sdk/vue': 0.0.45(vue@3.5.13)(zod@3.23.8) + '@ai-sdk/provider': 1.0.2 + '@ai-sdk/provider-utils': 2.0.4(zod@3.23.8) + '@ai-sdk/react': 1.0.6(react@18.2.0)(zod@3.23.8) + '@ai-sdk/ui-utils': 1.0.5(zod@3.23.8) '@opentelemetry/api': 1.9.0 - eventsource-parser: 1.1.2 - json-schema: 0.4.0 jsondiffpatch: 0.6.0 - nanoid: 3.3.6 - openai: 4.58.2(zod@3.23.8) react: 18.2.0 - secure-json-parse: 2.7.0 - svelte: 5.4.0 zod: 3.23.8 - zod-to-json-schema: 3.23.2(zod@3.23.8) - transitivePeerDependencies: - - solid-js - - vue + zod-to-json-schema: 3.24.1(zod@3.23.8) dev: false /ajv-formats@2.1.1(ajv@8.17.1): @@ -10576,6 +10446,7 @@ packages: /aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} + dev: true /array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} @@ -10852,6 +10723,7 @@ packages: /axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} + dev: true /b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} @@ -13901,10 +13773,6 @@ packages: - supports-color dev: true - /esm-env@1.2.1: - resolution: {integrity: sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==} - dev: false - /espree@10.3.0: resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -13926,13 +13794,6 @@ packages: estraverse: 5.3.0 dev: true - /esrap@1.2.3: - resolution: {integrity: sha512-ZlQmCCK+n7SGoqo7DnfKaP1sJZa49P01/dXzmjCASSo04p72w8EksT2NMK8CEX8DhKsfJXANioIw8VyHNsBfvQ==} - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 - dev: false - /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -13995,6 +13856,11 @@ packages: engines: {node: '>=14.18'} dev: false + /eventsource-parser@3.0.0: + resolution: {integrity: sha512-T1C0XCUimhxVQzW4zFipdx0SficT651NnkR0ZSH3yQwh+mFMdLfgjABVi4YtMTtaL4s168593DaoaRLMqryavA==} + engines: {node: '>=18.0.0'} + dev: false + /eventsource@2.0.2: resolution: {integrity: sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==} engines: {node: '>=12.0.0'} @@ -15758,6 +15624,7 @@ packages: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} dependencies: loose-envify: 1.4.0 + dev: true /invert-kv@1.0.0: resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} @@ -16090,12 +15957,6 @@ packages: '@types/estree': 1.0.6 dev: false - /is-reference@3.0.3: - resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} - dependencies: - '@types/estree': 1.0.6 - dev: false - /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -17658,10 +17519,6 @@ packages: engines: {node: '>= 12.13.0'} dev: true - /locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - dev: false - /locate-path@2.0.0: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} engines: {node: '>=4'} @@ -17893,12 +17750,6 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - /magic-string@0.30.14: - resolution: {integrity: sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==} - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - dev: false - /magic-string@0.30.8: resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} engines: {node: '>=12'} @@ -20229,15 +20080,6 @@ packages: source-map-js: 1.2.0 dev: true - /postcss@8.4.49: - resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.8 - picocolors: 1.1.1 - source-map-js: 1.2.1 - dev: false - /postgres-array@2.0.0: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} @@ -20787,54 +20629,53 @@ packages: engines: {node: '>=0.10.0'} dev: true - /react-remove-scroll-bar@2.3.6(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==} + /react-remove-scroll-bar@2.3.8(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==} engines: {node: '>=10'} peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 peerDependenciesMeta: '@types/react': optional: true dependencies: '@types/react': 18.2.57 react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.2.57)(react@18.2.0) + react-style-singleton: 2.2.3(@types/react@18.2.57)(react@18.2.0) tslib: 2.8.1 dev: false - /react-remove-scroll@2.6.0(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ==} + /react-remove-scroll@2.6.2(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-KmONPx5fnlXYJQqC62Q+lwIeAk64ws/cUw6omIumRzMRPqgnYqhSSti99nbj0Ry13bv7dF+BKn7NB+OqkdZGTw==} engines: {node: '>=10'} peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true dependencies: '@types/react': 18.2.57 react: 18.2.0 - react-remove-scroll-bar: 2.3.6(@types/react@18.2.57)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.2.57)(react@18.2.0) + react-remove-scroll-bar: 2.3.8(@types/react@18.2.57)(react@18.2.0) + react-style-singleton: 2.2.3(@types/react@18.2.57)(react@18.2.0) tslib: 2.8.1 - use-callback-ref: 1.3.2(@types/react@18.2.57)(react@18.2.0) + use-callback-ref: 1.3.3(@types/react@18.2.57)(react@18.2.0) use-sidecar: 1.1.2(@types/react@18.2.57)(react@18.2.0) dev: false - /react-style-singleton@2.2.1(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} + /react-style-singleton@2.2.3(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==} engines: {node: '>=10'} peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true dependencies: '@types/react': 18.2.57 get-nonce: 1.0.1 - invariant: 2.2.4 react: 18.2.0 tslib: 2.8.1 dev: false @@ -21961,11 +21802,6 @@ packages: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} - /source-map-js@1.2.1: - resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} - engines: {node: '>=0.10.0'} - dev: false - /source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} dependencies: @@ -22066,15 +21902,6 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - /sswr@2.1.0(svelte@5.4.0): - resolution: {integrity: sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ==} - peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 - dependencies: - svelte: 5.4.0 - swrev: 4.0.0 - dev: false - /stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} @@ -22571,25 +22398,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte@5.4.0: - resolution: {integrity: sha512-2I/mjD8cXDpKfdfUK+T6yo/OzugMXIm8lhyJUFM5F/gICMYnkl3C/+4cOSpia8TqpDsi6Qfm5+fdmBNMNmaf2g==} - engines: {node: '>=18'} - dependencies: - '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 - acorn: 8.14.0 - acorn-typescript: 1.4.13(acorn@8.14.0) - aria-query: 5.3.2 - axobject-query: 4.1.0 - esm-env: 1.2.1 - esrap: 1.2.3 - is-reference: 3.0.3 - locate-character: 3.0.0 - magic-string: 0.30.14 - zimmerframe: 1.1.2 - dev: false - /svix-fetch@3.0.0: resolution: {integrity: sha512-rcADxEFhSqHbraZIsjyZNh4TF6V+koloX1OzZ+AQuObX9mZ2LIMhm1buZeuc5BIZPftZpJCMBsSiBaeszo9tRw==} dependencies: @@ -22634,18 +22442,6 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /swrev@4.0.0: - resolution: {integrity: sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==} - dev: false - - /swrv@1.0.4(vue@3.5.13): - resolution: {integrity: sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==} - peerDependencies: - vue: '>=3.2.26 < 4' - dependencies: - vue: 3.5.13(typescript@5.7.2) - dev: false - /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: false @@ -22863,6 +22659,11 @@ packages: real-require: 0.2.0 dev: false + /throttleit@2.1.0: + resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==} + engines: {node: '>=18'} + dev: false + /through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} dependencies: @@ -23795,12 +23596,12 @@ packages: resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==} dev: true - /use-callback-ref@1.3.2(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==} + /use-callback-ref@1.3.3(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==} engines: {node: '>=10'} peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -23966,22 +23767,6 @@ packages: resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} dev: true - /vue@3.5.13(typescript@5.7.2): - resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@vue/compiler-dom': 3.5.13 - '@vue/compiler-sfc': 3.5.13 - '@vue/runtime-dom': 3.5.13 - '@vue/server-renderer': 3.5.13(vue@3.5.13) - '@vue/shared': 3.5.13 - typescript: 5.7.2 - dev: false - /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -24549,10 +24334,6 @@ packages: engines: {node: '>=18'} dev: true - /zimmerframe@1.1.2: - resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} - dev: false - /zip-stream@6.0.1: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} @@ -24597,6 +24378,14 @@ packages: zod: 3.23.8 dev: false + /zod-to-json-schema@3.24.1(zod@3.23.8): + resolution: {integrity: sha512-3h08nf3Vw3Wl3PK+q3ow/lIil81IT2Oa7YpQyUUDsEWbXveMesdfK1xBd2RhCkynwZndAxixji/7SYJJowr62w==} + peerDependencies: + zod: ^3.24.1 + dependencies: + zod: 3.23.8 + dev: false + /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false From c65447fa5336e70af308d62afedb0c938796b077 Mon Sep 17 00:00:00 2001 From: Stef Lewandowski Date: Thu, 19 Dec 2024 10:59:06 +0000 Subject: [PATCH 2/2] Remove unused await --- packages/aila/src/core/llm/OpenAIService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aila/src/core/llm/OpenAIService.ts b/packages/aila/src/core/llm/OpenAIService.ts index 7ea16718e..ba47325fa 100644 --- a/packages/aila/src/core/llm/OpenAIService.ts +++ b/packages/aila/src/core/llm/OpenAIService.ts @@ -29,7 +29,7 @@ export class OpenAIService implements LLMService { messages: Message[]; temperature: number; }): Promise> { - const { textStream: stream } = await streamText({ + const { textStream: stream } = streamText({ model: this._openAIProvider(params.model), messages: params.messages.map((m) => ({ role: m.role, @@ -53,7 +53,7 @@ export class OpenAIService implements LLMService { return this.createChatCompletionStream({ model, messages, temperature }); } const startTime = Date.now(); - const { textStream: stream } = await streamObject({ + const { textStream: stream } = streamObject({ model: this._openAIProvider(model, { structuredOutputs: true }), output: "object", schema,