diff --git a/ai/graph.tsx b/ai/graph.tsx index 8406770..4508233 100644 --- a/ai/graph.tsx +++ b/ai/graph.tsx @@ -104,7 +104,7 @@ const invokeTools = async ( throw new Error("No tool found in tool map."); } const toolResult = await selectedTool.invoke( - state.toolCall.parameters, + state.toolCall.parameters as any, config, ); return { diff --git a/ai/tools/firecrawl.tsx b/ai/tools/firecrawl.tsx index 8423f98..9054d5d 100644 --- a/ai/tools/firecrawl.tsx +++ b/ai/tools/firecrawl.tsx @@ -1,6 +1,6 @@ import { WebLoading, Web } from "@/components/prebuilt/web"; import { createRunnableUI } from "@/utils/server"; -import { DynamicStructuredTool } from "@langchain/core/tools"; +import { tool } from "@langchain/core/tools"; import { FireCrawlLoader } from "@langchain/community/document_loaders/web/firecrawl"; import { z } from "zod"; @@ -31,14 +31,13 @@ export async function webData(input: z.infer) { }; } -export const websiteDataTool = new DynamicStructuredTool({ - name: "get_web_data", - description: "A tool to fetch the current website data, given a url.", - schema: webSchema, - func: async (input, config) => { - const stream = await createRunnableUI(config, ); +export const websiteDataTool = tool(async (input, config) => { + const stream = await createRunnableUI(config, ); const data = await webData(input); stream.done(); return JSON.stringify(data, null); - }, +}, { + name: "get_web_data", + description: "A tool to fetch the current website data, given a url.", + schema: webSchema, }); diff --git a/ai/tools/github_repo.tsx b/ai/tools/github_repo.tsx index c2aecde..76313c9 100644 --- a/ai/tools/github_repo.tsx +++ b/ai/tools/github_repo.tsx @@ -1,8 +1,9 @@ import { z } from "zod"; import { Octokit } from "octokit"; -import { DynamicStructuredTool } from "@langchain/core/tools"; -import { createRunnableUI } from "@/utils/server"; +import { tool } from "@langchain/core/tools"; +import { createRunnableUI, CUSTOM_UI_YIELD_NAME } from "@/utils/server"; import { Github, GithubLoading } from "@/components/prebuilt/github"; +import { dispatchCustomEvent } from "@langchain/core/callbacks/dispatch/web"; const githubRepoToolSchema = z.object({ owner: z.string().describe("The name of the repository owner."), @@ -36,20 +37,35 @@ async function githubRepoTool(input: z.infer) { } } -export const githubTool = new DynamicStructuredTool({ - name: "github_repo", - description: - "A tool to fetch details of a Github repository. Given owner and repo names, this tool will return the repo description, stars, and primary language.", - schema: githubRepoToolSchema, - func: async (input, config) => { - const stream = await createRunnableUI(config, ); +export const githubTool = tool(async (input, config) => { + // const stream = await createRunnableUI(config, ); + await dispatchCustomEvent(CUSTOM_UI_YIELD_NAME, { + output: { + value: , + type: "append", + } + }, config); const result = await githubRepoTool(input); if (typeof result === "string") { // Failed to parse, return error message - stream.done(

{result}

); + await dispatchCustomEvent(CUSTOM_UI_YIELD_NAME, { + output: { + value:

{result}

, + type: "update", + } + }, config); return result; } - stream.done(); + await dispatchCustomEvent(CUSTOM_UI_YIELD_NAME, { + output: { + value: , + type: "update", + } + }, config); return JSON.stringify(result, null); - }, -}); +}, { + name: "github_repo", + description: + "A tool to fetch details of a Github repository. Given owner and repo names, this tool will return the repo description, stars, and primary language.", + schema: githubRepoToolSchema, +}) diff --git a/ai/tools/invoice.tsx b/ai/tools/invoice.tsx index b2e9bbb..4176a1b 100644 --- a/ai/tools/invoice.tsx +++ b/ai/tools/invoice.tsx @@ -2,7 +2,7 @@ import { z } from "zod"; import { v4 as uuidv4 } from "uuid"; import { InvoiceLoading, Invoice } from "@/components/prebuilt/invoice"; import { createRunnableUI } from "@/utils/server"; -import { DynamicStructuredTool } from "@langchain/core/tools"; +import { DynamicStructuredTool, tool } from "@langchain/core/tools"; const LineItemSchema = z.object({ id: z @@ -51,14 +51,13 @@ export const InvoiceSchema = z.object({ ), }); -export const invoiceTool = new DynamicStructuredTool({ +export const invoiceTool = tool(async (input, config) => { + const stream = await createRunnableUI(config, ); + stream.done(); + return JSON.stringify(input, null); +}, { name: "get_order_invoice", description: "A tool to fetch the invoice from an order. This should only be called if a user uploads an image/receipt of an order.", schema: InvoiceSchema, - func: async (input, config) => { - const stream = await createRunnableUI(config, ); - stream.done(); - return JSON.stringify(input, null); - }, -}); +}) diff --git a/ai/tools/weather.tsx b/ai/tools/weather.tsx index a740eb0..990de76 100644 --- a/ai/tools/weather.tsx +++ b/ai/tools/weather.tsx @@ -3,7 +3,7 @@ import { CurrentWeather, } from "@/components/prebuilt/weather"; import { createRunnableUI } from "@/utils/server"; -import { DynamicStructuredTool } from "@langchain/core/tools"; +import { DynamicStructuredTool, tool } from "@langchain/core/tools"; import { z } from "zod"; export const weatherSchema = z.object({ @@ -18,7 +18,9 @@ export const weatherSchema = z.object({ .describe("The two letter country abbreviation to get weather for"), }); -export async function weatherData(input: z.infer) { +export type WeatherToolSchema = z.infer; + +export async function weatherData(input: WeatherToolSchema) { const geoCodeApiKey = process.env.GEOCODE_API_KEY; if (!geoCodeApiKey) { throw new Error("Missing GEOCODE_API_KEY secret."); @@ -59,15 +61,14 @@ export async function weatherData(input: z.infer) { }; } -export const weatherTool = new DynamicStructuredTool({ +export const weatherTool = tool(async (input, config) => { + const stream = await createRunnableUI(config, ); + const data = await weatherData(input); + stream.done(); + return JSON.stringify(data, null); +}, { name: "get_weather", description: "A tool to fetch the current weather, given a city and state. If the city/state is not provided, ask the user for both the city and state.", schema: weatherSchema, - func: async (input, config) => { - const stream = await createRunnableUI(config, ); - const data = await weatherData(input); - stream.done(); - return JSON.stringify(data, null); - }, }); diff --git a/package.json b/package.json index 3b148ac..3a1c60f 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "format": "yarn prettier --write ./app ./ai ./components ./utils ./lib" }, "dependencies": { - "@langchain/community": "^0.2.10", - "@langchain/core": "^0.2.6", - "@langchain/langgraph": "^0.0.25", - "@langchain/openai": "^0.0.34", + "@langchain/community": "^0.2.22", + "@langchain/core": "^0.2.18", + "@langchain/langgraph": "^0.0.31", + "@langchain/openai": "^0.2.5", "@mendable/firecrawl-js": "^0.0.26", "@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.6", @@ -27,12 +27,12 @@ "@radix-ui/react-switch": "^1.0.3", "@radix-ui/react-tabs": "^1.0.4", "@radix-ui/react-tooltip": "^1.0.7", - "ai": "^3.1.16", + "ai": "^3.2.43", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "date-fns": "^3.6.0", "jotai": "^2.8.2", - "langchain": "^0.2.3", + "langchain": "^0.2.12", "lucide-react": "^0.379.0", "next": "14.2.3", "octokit": "^4.0.2", @@ -58,6 +58,6 @@ "typescript": "^5" }, "resolutions": { - "@langchain/core": "0.2.6" + "@langchain/core": "0.2.18" } } diff --git a/utils/server.tsx b/utils/server.tsx index 7c14dc3..235ec6c 100644 --- a/utils/server.tsx +++ b/utils/server.tsx @@ -2,18 +2,16 @@ import "server-only"; import { ReactNode, isValidElement } from "react"; import { AIProvider } from "./client"; -import { - CallbackManagerForToolRun, - CallbackManagerForRetrieverRun, - CallbackManagerForChainRun, -} from "@langchain/core/callbacks/manager"; import { createStreamableUI, createStreamableValue } from "ai/rsc"; -import { Runnable, RunnableLambda } from "@langchain/core/runnables"; +import { Runnable, RunnableConfig, RunnableLambda } from "@langchain/core/runnables"; import { CompiledStateGraph } from "@langchain/langgraph"; import { StreamEvent } from "@langchain/core/tracers/log_stream"; import { AIMessage } from "@/ai/message"; +export const dynamic = 'force-dynamic'; + const STREAM_UI_RUN_NAME = "stream_runnable_ui"; +export const CUSTOM_UI_YIELD_NAME = "__yield_ui__"; /** * Executes `streamEvents` method on a runnable @@ -42,9 +40,17 @@ export function streamRunnableUI( for await (const streamEvent of ( runnable as Runnable ).streamEvents(inputs, { - version: "v1", + version: "v2", })) { - if ( + if (streamEvent.name === CUSTOM_UI_YIELD_NAME) { + if (isValidElement(streamEvent.data.output.value)) { + if (streamEvent.data.output.type === "append") { + ui.append(streamEvent.data.output.value); + } else if (streamEvent.data.output.type === "update") { + ui.update(streamEvent.data.output.value); + } + } + } else if ( streamEvent.name === STREAM_UI_RUN_NAME && streamEvent.event === "on_chain_end" ) { @@ -88,19 +94,15 @@ export function streamRunnableUI( * Yields an UI element within a runnable, * which can be streamed to the client via `streamRunnableUI` * - * @param callbackManager callback + * @param config RunnableConfig * @param initialValue Initial React node to be sent to the client * @returns Vercel AI RSC compatible streamable UI */ export const createRunnableUI = async ( - callbackManager: - | CallbackManagerForToolRun - | CallbackManagerForRetrieverRun - | CallbackManagerForChainRun - | undefined, + config: RunnableConfig | undefined, initialValue?: React.ReactNode, ): Promise> => { - if (!callbackManager) { + if (!config) { throw new Error("Callback manager is not defined"); } @@ -109,7 +111,7 @@ export const createRunnableUI = async ( return ui; }).withConfig({ runName: STREAM_UI_RUN_NAME }); - return lambda.invoke(initialValue, { callbacks: callbackManager.getChild() }); + return lambda.invoke(initialValue, config); }; /** diff --git a/yarn.lock b/yarn.lock index 44f98aa..b6152b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,23 +2,67 @@ # yarn lockfile v1 -"@ai-sdk/provider-utils@0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@ai-sdk/provider-utils/-/provider-utils-0.0.11.tgz#f89cced1b016ce4e4700f9776a63cdd0db4c8f47" - integrity sha512-JRDrqL2FGDmLh+a4R5qbS8UrWN9Lt7DpDIY1x6owgXjXkz3Umm1czs1X32VlL0M1dpoSxu4hGBFtXd56+kDzXA== +"@ai-sdk/provider-utils@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@ai-sdk/provider-utils/-/provider-utils-1.0.5.tgz#765c60871019ded104d79b4cea0805ba563bb5aa" + integrity sha512-XfOawxk95X3S43arn2iQIFyWGMi0DTxsf9ETc6t7bh91RPWOOPYN1tsmS5MTKD33OGJeaDQ/gnVRzXUCRBrckQ== dependencies: - "@ai-sdk/provider" "0.0.8" + "@ai-sdk/provider" "0.0.14" eventsource-parser "1.1.2" nanoid "3.3.6" secure-json-parse "2.7.0" -"@ai-sdk/provider@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@ai-sdk/provider/-/provider-0.0.8.tgz#dbdb63dff3f5c3fe2c999924c7cfe4b9043d3354" - integrity sha512-+gcMvyPUDfDXV9caN3CG5Le0M5K4CjqTdMV1ODg/AosApQiJW9ByN5imJPdI043zVdt+HS9WG+s0j4am7ca4bg== +"@ai-sdk/provider@0.0.14": + version "0.0.14" + resolved "https://registry.yarnpkg.com/@ai-sdk/provider/-/provider-0.0.14.tgz#a07569c39a8828aa8312cf1ac6f35ce6ee1b2fce" + integrity sha512-gaQ5Y033nro9iX1YUjEDFDRhmMcEiCk56LJdIUbX5ozEiCNCfpiBpEqrjSp/Gp5RzBS2W0BVxfG7UGW6Ezcrzg== dependencies: json-schema "0.4.0" +"@ai-sdk/react@0.0.34": + version "0.0.34" + resolved "https://registry.yarnpkg.com/@ai-sdk/react/-/react-0.0.34.tgz#092dee1af6eea9595f9b24949a6c33d0f4d225bb" + integrity sha512-GBLci7/xA1e7tZI+01IwUWvEugwjPGg1dQZ/3OdHFWhhgTARJogABhUi9EOznCPrkx9Ek8h2Zpm/G10jbZvK0Q== + dependencies: + "@ai-sdk/provider-utils" "1.0.5" + "@ai-sdk/ui-utils" "0.0.23" + swr "2.2.5" + +"@ai-sdk/solid@0.0.26": + version "0.0.26" + resolved "https://registry.yarnpkg.com/@ai-sdk/solid/-/solid-0.0.26.tgz#0df17249e95776d0573b2b8223f4b71a8525f02a" + integrity sha512-kY9CJXYaZS57qi5Yc1hjkBtGwgEubkfn7P1CXYbY/wMpTkvlUaHw5JY2twMgG9qdq+uNWp1omZUVlVEkqZMqbA== + dependencies: + "@ai-sdk/provider-utils" "1.0.5" + "@ai-sdk/ui-utils" "0.0.23" + +"@ai-sdk/svelte@0.0.28": + version "0.0.28" + resolved "https://registry.yarnpkg.com/@ai-sdk/svelte/-/svelte-0.0.28.tgz#e912eaf4cff737ce6d4a8a305055f1084bb17600" + integrity sha512-n5MOV7UF/3wQvtGMUccMnoV+Xk524fVWzmPF9C0h1ZcS1oskutNqVbfZzFFoB2otD0/DBj2IS+rmHH4Dqc6D0g== + dependencies: + "@ai-sdk/provider-utils" "1.0.5" + "@ai-sdk/ui-utils" "0.0.23" + sswr "2.1.0" + +"@ai-sdk/ui-utils@0.0.23": + version "0.0.23" + resolved "https://registry.yarnpkg.com/@ai-sdk/ui-utils/-/ui-utils-0.0.23.tgz#7c46da248e10236af23b469d9e4a414c7617ad08" + integrity sha512-9KONrxwnoV9VyW9I3m9+cEi5IANvADeLuCe+oB3JzOobNKASwYwcQZ4X7no28DckfiJUmHk4gmPnsC3yfRoU5Q== + dependencies: + "@ai-sdk/provider" "0.0.14" + "@ai-sdk/provider-utils" "1.0.5" + secure-json-parse "2.7.0" + +"@ai-sdk/vue@0.0.27": + version "0.0.27" + resolved "https://registry.yarnpkg.com/@ai-sdk/vue/-/vue-0.0.27.tgz#bc663ae85f1142d5f038b9fdec54ed932eb20e25" + integrity sha512-pYksYRUtMdAceZRKg9M6Rh1M4uSKJpa+cm0CC3Q2CMufE9Tgs3eEMB5ZqdSlP00uOifL3h36O14Y9vQwW4x7uw== + dependencies: + "@ai-sdk/provider-utils" "1.0.5" + "@ai-sdk/ui-utils" "0.0.23" + swrv "1.0.4" + "@alloc/quick-lru@^5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" @@ -153,66 +197,56 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@langchain/community@^0.2.10": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.2.10.tgz#736bc2f7b0ec3c7e728cf938bebf4b6adca44be5" - integrity sha512-0aT932D1lGya/oSLF1xlCv4ywWKwxp2vNwEHdE96K9s862BKfXbvZhIll6vhjDBB/5VmgKt7XkvSq4tVitFqGg== +"@langchain/community@^0.2.22": + version "0.2.22" + resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.2.22.tgz#e94dd8c1e516c3cefc64e2ceafb755994b89c2e9" + integrity sha512-KxT6Pj0ovJkSgiVHKorIeH0Bi7QDwMiuCD8apLNKkgHz9NC8ZxzKt5LqpVApNbnPWkCwm9EZ3oBfYGaz+D3jMg== dependencies: - "@langchain/core" "~0.2.6" - "@langchain/openai" "~0.1.0" + "@langchain/core" ">=0.2.16 <0.3.0" + "@langchain/openai" ">=0.1.0 <0.3.0" binary-extensions "^2.2.0" expr-eval "^2.0.2" flat "^5.0.2" js-yaml "^4.1.0" - langchain "0.2.3" + langchain "~0.2.3" langsmith "~0.1.30" - uuid "^9.0.0" + uuid "^10.0.0" zod "^3.22.3" zod-to-json-schema "^3.22.5" -"@langchain/core@0.2.6", "@langchain/core@>0.1.0 <0.3.0", "@langchain/core@>0.1.56 <0.3.0", "@langchain/core@>0.1.61 <0.3.0", "@langchain/core@>=0.2.5 <0.3.0", "@langchain/core@^0.2.6", "@langchain/core@~0.2.0", "@langchain/core@~0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.2.6.tgz#7b57ff88d4b5ae75bafbe689cd8878e9fbad7de6" - integrity sha512-YB9F0vdi/PcgBLSKtDwQ3gV6w4xVfk4ph0U43Okz2dAapKfBkVVB0rzr/afYUt/WHs864MuaO8uLN64egSDtIA== +"@langchain/core@0.2.18", "@langchain/core@>0.1.0 <0.3.0", "@langchain/core@>=0.2.11 <0.3.0", "@langchain/core@>=0.2.16 <0.3.0", "@langchain/core@>=0.2.18 <0.3.0", "@langchain/core@^0.2.18": + version "0.2.18" + resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.2.18.tgz#1ac4f307fa217ab3555c9634147a6c4ad9826092" + integrity sha512-ru542BwNcsnDfjTeDbIkFIchwa54ctHZR+kVrC8U9NPS9/36iM8p8ruprOV7Zccj/oxtLE5UpEhV+9MZhVcFlA== dependencies: ansi-styles "^5.0.0" camelcase "6" decamelize "1.2.0" js-tiktoken "^1.0.12" - langsmith "~0.1.30" + langsmith "~0.1.39" ml-distance "^4.0.0" mustache "^4.2.0" p-queue "^6.6.2" p-retry "4" - uuid "^9.0.0" + uuid "^10.0.0" zod "^3.22.4" zod-to-json-schema "^3.22.3" -"@langchain/langgraph@^0.0.25": - version "0.0.25" - resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.0.25.tgz#2582d8652e2dda722f0c5043c1d0254a778e2486" - integrity sha512-DiTnB5Psm0y7TSgHdK4r/r+xzLohbN4zMQL+5Wk3EmOGX45ioBp98AqL8hYdyxKgHM6cjoIFHavHF7EhMg+ugQ== +"@langchain/langgraph@^0.0.31": + version "0.0.31" + resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.0.31.tgz#4585fc9b4e9ad9677e97fd8debcfec2ae43a5fb4" + integrity sha512-f5QMSLy/RnLktsqnNm2mq8gp1xplHwQf87XIPVO0IYuumOJiafx5lE7ahPO+fVmCzAz6LxcsVocvD0JqxXR/2w== dependencies: - "@langchain/core" ">0.1.61 <0.3.0" - uuid "^9.0.1" - -"@langchain/openai@^0.0.34", "@langchain/openai@~0.0.28": - version "0.0.34" - resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.0.34.tgz#36c9bca0721ab9f7e5d40927e7c0429cacbd5b56" - integrity sha512-M+CW4oXle5fdoz2T2SwdOef8pl3/1XmUx1vjn2mXUVM/128aO0l23FMF0SNBsAbRV6P+p/TuzjodchJbi0Ht/A== - dependencies: - "@langchain/core" ">0.1.56 <0.3.0" - js-tiktoken "^1.0.12" - openai "^4.41.1" - zod "^3.22.4" - zod-to-json-schema "^3.22.3" + "@langchain/core" ">=0.2.18 <0.3.0" + uuid "^10.0.0" + zod "^3.23.8" -"@langchain/openai@~0.1.0": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.1.3.tgz#6eb0994e970d85ffa9aaeafb94449024ccf6ca63" - integrity sha512-riv/JC9x2A8b7GcHu8sx+mlZJ8KAwSSi231IPTlcciYnKozmrQ5H0vrtiD31fxiDbaRsk7tyCpkSBIOQEo7CyQ== +"@langchain/openai@>=0.1.0 <0.3.0", "@langchain/openai@^0.2.5": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.2.5.tgz#e85b983986a7415ea743d4c854bb0674134334d4" + integrity sha512-gQXS5VBFyAco0jgSnUVan6fYVSIxlffmDaeDGpXrAmz2nQPgiN/h24KYOt2NOZ1zRheRzRuO/CfRagMhyVUaFA== dependencies: - "@langchain/core" ">=0.2.5 <0.3.0" + "@langchain/core" ">=0.2.16 <0.3.0" js-tiktoken "^1.0.12" openai "^4.49.1" zod "^3.22.4" @@ -531,6 +565,11 @@ "@octokit/webhooks-methods" "^5.0.0" aggregate-error "^5.0.0" +"@opentelemetry/api@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" + integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -1143,23 +1182,24 @@ aggregate-error@^5.0.0: clean-stack "^5.2.0" indent-string "^5.0.0" -ai@^3.1.16: - version "3.1.16" - resolved "https://registry.yarnpkg.com/ai/-/ai-3.1.16.tgz#08d748807403847c1580b786dd05eebca03defbf" - integrity sha512-qiw8qvktMD27/NhzR4ePm+TL6G2XfADfYY5YgualO2KJIXJMTlJYS543MQFGSyXzVY5AxAPE9lMSDB3XRI891Q== - dependencies: - "@ai-sdk/provider" "0.0.8" - "@ai-sdk/provider-utils" "0.0.11" +ai@^3.2.43: + version "3.2.43" + resolved "https://registry.yarnpkg.com/ai/-/ai-3.2.43.tgz#6fe53bf2495ec8d25b47f9315023920b69365c14" + integrity sha512-+LUTI4cwQKUHxRJ4J1HAWWfCtFnCAbDh+BFE9AtJGpq3oniC/inNcLksuTU1N5YkK1pDc/rllyiNzE2UtadndA== + dependencies: + "@ai-sdk/provider" "0.0.14" + "@ai-sdk/provider-utils" "1.0.5" + "@ai-sdk/react" "0.0.34" + "@ai-sdk/solid" "0.0.26" + "@ai-sdk/svelte" "0.0.28" + "@ai-sdk/ui-utils" "0.0.23" + "@ai-sdk/vue" "0.0.27" + "@opentelemetry/api" "1.9.0" eventsource-parser "1.1.2" json-schema "0.4.0" jsondiffpatch "0.6.0" nanoid "3.3.6" secure-json-parse "2.7.0" - solid-swr-store "0.10.7" - sswr "2.0.0" - swr "2.2.0" - swr-store "0.10.6" - swrv "1.0.4" zod-to-json-schema "3.22.5" ajv@^6.12.4: @@ -1540,7 +1580,7 @@ clean-stack@^5.2.0: dependencies: escape-string-regexp "5.0.0" -client-only@0.0.1: +client-only@0.0.1, client-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== @@ -2898,24 +2938,24 @@ keyv@^4.5.3: dependencies: json-buffer "3.0.1" -langchain@0.2.3, langchain@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.2.3.tgz#c14bb05cf871b21bd63b84b3ab89580b1d62539f" - integrity sha512-T9xR7zd+Nj0oXy6WoYKmZLy0DlQiDLFPGYWdOXDxy+AvqlujoPdVQgDSpdqiOHvAjezrByAoKxoHCz5XMwTP/Q== +langchain@^0.2.12, langchain@~0.2.3: + version "0.2.12" + resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.2.12.tgz#3fac0b9519a070689b6dd679d5854abc57824dcf" + integrity sha512-ZHtJrHUpridZ7IQu7N/wAQ6iMAAO7VLzkupHqKP79S6p+alrPbn1BjRnh+PeGm92YiY5DafTCuvchmujxx7bCQ== dependencies: - "@langchain/core" "~0.2.0" - "@langchain/openai" "~0.0.28" + "@langchain/core" ">=0.2.11 <0.3.0" + "@langchain/openai" ">=0.1.0 <0.3.0" "@langchain/textsplitters" "~0.0.0" binary-extensions "^2.2.0" js-tiktoken "^1.0.12" js-yaml "^4.1.0" jsonpointer "^5.0.1" langchainhub "~0.0.8" - langsmith "~0.1.7" + langsmith "~0.1.30" ml-distance "^4.0.0" openapi-types "^12.1.3" p-retry "4" - uuid "^9.0.0" + uuid "^10.0.0" yaml "^2.2.1" zod "^3.22.4" zod-to-json-schema "^3.22.3" @@ -2936,15 +2976,16 @@ langsmith@~0.1.30: p-retry "4" uuid "^9.0.0" -langsmith@~0.1.7: - version "0.1.28" - resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.28.tgz#fbe01352d0b993fd11d4085dd337b1cec17ef28d" - integrity sha512-IQUbo7I7rEE6QYBhrcgwqvlkcUsHlia0yTQpDwWdITw/VJx1f7gLPjNdbwWE+jvOZ4HcD7gCf2HR6zFXputu5A== +langsmith@~0.1.39: + version "0.1.40" + resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.40.tgz#9708889386a5b9d0eb43dd3a9eba93513b57101d" + integrity sha512-11E2WLbh/+41+Qc0w8fJJTC/iz91BA+zXRMX/Wz0KSstnfzIPBoiWa++Kp2X8yCIDNywWWLJhy/B8gYzm7VKig== dependencies: "@types/uuid" "^9.0.1" commander "^10.0.1" p-queue "^6.6.2" p-retry "4" + semver "^7.6.3" uuid "^9.0.0" language-subtag-registry@^0.3.20: @@ -3590,20 +3631,6 @@ once@^1.3.0: dependencies: wrappy "1" -openai@^4.41.1: - version "4.47.2" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.47.2.tgz#075a0f9fa8e96422804ddd017428ce0a3862e1d0" - integrity sha512-E3Wq9mYdDSLajmcJm9RO/lCegTKrQ7ilAkMbhob4UgGhTjHwIHI+mXNDNPl5+sGIUp2iVUkpoi772FjYa7JlqA== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - web-streams-polyfill "^3.2.1" - openai@^4.49.1: version "4.51.0" resolved "https://registry.yarnpkg.com/openai/-/openai-4.51.0.tgz#8ab08bba2441375e8e4ce6161f9ac987d2b2c157" @@ -4087,6 +4114,11 @@ semver@^7.5.4: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== +semver@^7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + set-function-length@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" @@ -4141,11 +4173,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -solid-swr-store@0.10.7: - version "0.10.7" - resolved "https://registry.yarnpkg.com/solid-swr-store/-/solid-swr-store-0.10.7.tgz#9511308f01250a1509efbfaad5b481be7517e436" - integrity sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g== - source-map-js@^1.0.2, source-map-js@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" @@ -4156,10 +4183,10 @@ space-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== -sswr@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sswr/-/sswr-2.0.0.tgz#db5e1f7c44addb8316de8e7efe23b7ea2cba090d" - integrity sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w== +sswr@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sswr/-/sswr-2.1.0.tgz#1eb64cd647cc9e11f871e7f43554abd8c64e1103" + integrity sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ== dependencies: swrev "^4.0.0" @@ -4305,18 +4332,12 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -swr-store@0.10.6: - version "0.10.6" - resolved "https://registry.yarnpkg.com/swr-store/-/swr-store-0.10.6.tgz#1856bda886e87dbed40c8c9874c1b1624d2e502d" - integrity sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw== - dependencies: - dequal "^2.0.3" - -swr@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.0.tgz#575c6ac1bec087847f4c86a39ccbc0043c834d6a" - integrity sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ== +swr@2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.5.tgz#063eea0e9939f947227d5ca760cc53696f46446b" + integrity sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg== dependencies: + client-only "^0.0.1" use-sync-external-store "^1.2.0" swrev@^4.0.0: @@ -4617,6 +4638,11 @@ util-deprecate@^1.0.2: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +uuid@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" + integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== + uuid@^9.0.0, uuid@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"