From 0a874c4c87c0ce4fc7b205ee54c83ad832ec920e Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 25 Jun 2024 20:51:08 -0700 Subject: [PATCH 01/15] community[minor]: Add ChromeAI chat model --- .../src/chat_models/chrome.ts | 181 ++++++++++++++++++ .../chat_models/tests/chromeai.int.test.ts | 0 2 files changed, 181 insertions(+) create mode 100644 libs/langchain-community/src/chat_models/chrome.ts create mode 100644 libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts diff --git a/libs/langchain-community/src/chat_models/chrome.ts b/libs/langchain-community/src/chat_models/chrome.ts new file mode 100644 index 000000000000..fca4c36a7b0e --- /dev/null +++ b/libs/langchain-community/src/chat_models/chrome.ts @@ -0,0 +1,181 @@ +import { + SimpleChatModel, + type BaseChatModelParams, +} from "@langchain/core/language_models/chat_models"; +import type { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; +import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; +import { BaseMessage, AIMessageChunk } from "@langchain/core/messages"; +import { ChatGenerationChunk } from "@langchain/core/outputs"; + +export interface AI { + canCreateTextSession(): Promise; + createTextSession(options?: AITextSessionOptions): Promise; + defaultTextSessionOptions(): Promise; +} + +export interface AITextSession { + prompt(input: string): Promise; + promptStreaming(input: string): ReadableStream; + destroy(): void; + clone(): AITextSession; +} + +export interface AITextSessionOptions { + topK: number; + temperature: number; +} + +export enum AIModelAvailability { + Readily = "readily", + AfterDownload = "after-download", + No = "no", +} + +export interface ChromeAIInputs extends BaseChatModelParams { + topK?: number; + temperature?: number; +} + +export interface ChromeAICallOptions extends BaseLanguageModelCallOptions {} + +function formatPrompt(messages: BaseMessage[]): string { + return messages + .map((message) => { + if (typeof message.content !== "string") { + throw new Error( + "ChatChromeAI does not support non-string message content." + ); + } + return `<${message._getType()}>\n${ + message.content + }\n`; + }) + .join("\n"); +} + +/** + * To use this model you need to have the `Built-in AI Early Preview Program` + * for Chrome. You can find more information about the program here: + * @link https://developer.chrome.com/docs/ai/built-in + * + * @example + * ```typescript + * // Initialize the ChatChromeAI model. + * const model = new ChatChromeAI({ + * temperature: 0.5, // Optional. Default is 0.5. + * topK: 40, // Optional. Default is 40. + * }); + * + * // Call the model with a message and await the response. + * const response = await model.invoke([ + * new HumanMessage({ content: "My name is John." }), + * ]); + * ``` + */ +export class ChatChromeAI extends SimpleChatModel { + session?: AITextSession; + + temperature = 0.5; + + topK = 40; + + static lc_name() { + return "ChatChromeAI"; + } + + constructor(inputs: ChromeAIInputs) { + super(inputs); + this.temperature = inputs.temperature ?? this.temperature; + this.topK = inputs.topK ?? this.topK; + } + + _llmType() { + return "chrome-ai"; + } + + /** + * Initialize the model. This method must be called before calling `.invoke()`. + */ + async initialize() { + if (typeof window === "undefined") { + throw new Error("ChatChromeAI can only be used in the browser."); + } + + const ai: AI = (window as any).ai; + const canCreateTextSession = await ai.canCreateTextSession(); + if (canCreateTextSession === AIModelAvailability.No) { + throw new Error("The AI model is not available."); + } else if (canCreateTextSession === AIModelAvailability.AfterDownload) { + throw new Error("The AI model is not yet downloaded."); + } + + this.session = await ai.createTextSession({ + topK: this.topK, + temperature: this.temperature, + }); + } + + /** + * Call `.destroy()` to free resources if you no longer need a session. + * When a session is destroyed, it can no longer be used, and any ongoing + * execution will be aborted. You may want to keep the session around if + * you intend to prompt the model often since creating a session can take + * some time. + */ + destroy() { + if (!this.session) { + return console.log("No session found. Returning."); + } + this.session.destroy(); + } + + async *_streamResponseChunks( + messages: BaseMessage[], + _options: this["ParsedCallOptions"], + runManager?: CallbackManagerForLLMRun + ): AsyncGenerator { + if (!this.session) { + throw new Error("Session not found. Please call `.initialize()` first."); + } + const textPrompt = formatPrompt(messages); + + const stream = this.session.promptStreaming(textPrompt); + const reader = stream.getReader(); + + try { + let previousLength = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + const newContent = value.slice(previousLength); + previousLength = value.length; + yield new ChatGenerationChunk({ + text: newContent, + message: new AIMessageChunk({ + content: newContent, + additional_kwargs: {}, + }), + }); + await runManager?.handleLLMNewToken(newContent); + } + } finally { + reader.releaseLock(); + } + } + + async _call( + messages: BaseMessage[], + options: this["ParsedCallOptions"], + runManager?: CallbackManagerForLLMRun + ): Promise { + const chunks = []; + for await (const chunk of this._streamResponseChunks( + messages, + options, + runManager + )) { + chunks.push(chunk.text); + } + return chunks.join(""); + } +} diff --git a/libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts b/libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts new file mode 100644 index 000000000000..e69de29bb2d1 From 007f5eefa989c2580e3fdf7dcdd45974f670b28e Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 25 Jun 2024 21:03:04 -0700 Subject: [PATCH 02/15] extra --- libs/langchain-community/.gitignore | 4 +++ libs/langchain-community/langchain.config.js | 1 + libs/langchain-community/package.json | 13 ++++++++ .../chat_models/{chrome.ts => chrome_ai.ts} | 0 .../src/chat_models/tests/chrome_ai.html | 32 +++++++++++++++++++ .../chat_models/tests/chromeai.int.test.ts | 0 .../src/load/import_map.ts | 1 + 7 files changed, 51 insertions(+) rename libs/langchain-community/src/chat_models/{chrome.ts => chrome_ai.ts} (100%) create mode 100644 libs/langchain-community/src/chat_models/tests/chrome_ai.html delete mode 100644 libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts diff --git a/libs/langchain-community/.gitignore b/libs/langchain-community/.gitignore index 4246a650f6df..018fa12549f4 100644 --- a/libs/langchain-community/.gitignore +++ b/libs/langchain-community/.gitignore @@ -518,6 +518,10 @@ chat_models/cloudflare_workersai.cjs chat_models/cloudflare_workersai.js chat_models/cloudflare_workersai.d.ts chat_models/cloudflare_workersai.d.cts +chat_models/chrome_ai.cjs +chat_models/chrome_ai.js +chat_models/chrome_ai.d.ts +chat_models/chrome_ai.d.cts chat_models/deepinfra.cjs chat_models/deepinfra.js chat_models/deepinfra.d.ts diff --git a/libs/langchain-community/langchain.config.js b/libs/langchain-community/langchain.config.js index 7012d8e06c5a..21ff77dcb69c 100644 --- a/libs/langchain-community/langchain.config.js +++ b/libs/langchain-community/langchain.config.js @@ -166,6 +166,7 @@ export const config = { "chat_models/bedrock": "chat_models/bedrock/index", "chat_models/bedrock/web": "chat_models/bedrock/web", "chat_models/cloudflare_workersai": "chat_models/cloudflare_workersai", + "chat_models/chrome_ai": "chat_models/chrome_ai", "chat_models/deepinfra": "chat_models/deepinfra", "chat_models/fireworks": "chat_models/fireworks", "chat_models/friendli": "chat_models/friendli", diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index 3ef6acbe7890..1c499d0f6fb0 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -1870,6 +1870,15 @@ "import": "./chat_models/cloudflare_workersai.js", "require": "./chat_models/cloudflare_workersai.cjs" }, + "./chat_models/chrome_ai": { + "types": { + "import": "./chat_models/chrome_ai.d.ts", + "require": "./chat_models/chrome_ai.d.cts", + "default": "./chat_models/chrome_ai.d.ts" + }, + "import": "./chat_models/chrome_ai.js", + "require": "./chat_models/chrome_ai.cjs" + }, "./chat_models/deepinfra": { "types": { "import": "./chat_models/deepinfra.d.ts", @@ -3555,6 +3564,10 @@ "chat_models/cloudflare_workersai.js", "chat_models/cloudflare_workersai.d.ts", "chat_models/cloudflare_workersai.d.cts", + "chat_models/chrome_ai.cjs", + "chat_models/chrome_ai.js", + "chat_models/chrome_ai.d.ts", + "chat_models/chrome_ai.d.cts", "chat_models/deepinfra.cjs", "chat_models/deepinfra.js", "chat_models/deepinfra.d.ts", diff --git a/libs/langchain-community/src/chat_models/chrome.ts b/libs/langchain-community/src/chat_models/chrome_ai.ts similarity index 100% rename from libs/langchain-community/src/chat_models/chrome.ts rename to libs/langchain-community/src/chat_models/chrome_ai.ts diff --git a/libs/langchain-community/src/chat_models/tests/chrome_ai.html b/libs/langchain-community/src/chat_models/tests/chrome_ai.html new file mode 100644 index 000000000000..4d1575458137 --- /dev/null +++ b/libs/langchain-community/src/chat_models/tests/chrome_ai.html @@ -0,0 +1,32 @@ + + + + ChatChromeAI Example + + +

ChatChromeAI Example

+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts b/libs/langchain-community/src/chat_models/tests/chromeai.int.test.ts deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libs/langchain-community/src/load/import_map.ts b/libs/langchain-community/src/load/import_map.ts index d06053cbde26..907dcc90ed59 100644 --- a/libs/langchain-community/src/load/import_map.ts +++ b/libs/langchain-community/src/load/import_map.ts @@ -46,6 +46,7 @@ export * as vectorstores__vectara from "../vectorstores/vectara.js"; export * as chat_models__alibaba_tongyi from "../chat_models/alibaba_tongyi.js"; export * as chat_models__baiduwenxin from "../chat_models/baiduwenxin.js"; export * as chat_models__cloudflare_workersai from "../chat_models/cloudflare_workersai.js"; +export * as chat_models__chrome_ai from "../chat_models/chrome_ai.js"; export * as chat_models__deepinfra from "../chat_models/deepinfra.js"; export * as chat_models__fireworks from "../chat_models/fireworks.js"; export * as chat_models__friendli from "../chat_models/friendli.js"; From 2f2ade8a7efa9a6517e30990a44518e5d6e71694 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 25 Jun 2024 21:03:44 -0700 Subject: [PATCH 03/15] chore: lint files --- .../src/chat_models/tests/chrome_ai.html | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/libs/langchain-community/src/chat_models/tests/chrome_ai.html b/libs/langchain-community/src/chat_models/tests/chrome_ai.html index 4d1575458137..d9c7bbb1c87b 100644 --- a/libs/langchain-community/src/chat_models/tests/chrome_ai.html +++ b/libs/langchain-community/src/chat_models/tests/chrome_ai.html @@ -1,32 +1,34 @@ - - ChatChromeAI Example - - -

ChatChromeAI Example

- -
-
-
- -
- - - - \ No newline at end of file + + ChatChromeAI Example + + +

ChatChromeAI Example

+ +
+
+
+ +
+ + + + From b83c14c7cab7769e2df44179f25f0a4b894b4c24 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:46:14 -0700 Subject: [PATCH 04/15] move to experimental, add demo app and instructions --- .../test-exports-bun/src/entrypoints.js | 1 + .../test-exports-cf/src/entrypoints.js | 1 + .../test-exports-cjs/src/entrypoints.js | 1 + .../test-exports-esbuild/src/entrypoints.js | 1 + .../test-exports-esm/src/entrypoints.js | 1 + .../test-exports-vercel/src/entrypoints.js | 1 + .../test-exports-vite/src/entrypoints.js | 1 + langchain/.gitignore | 4 + langchain/langchain.config.js | 1 + langchain/package.json | 13 + .../src/experimental/chrome_ai/app/README.md | 22 + .../experimental/chrome_ai/app/package.json | 16 + .../chrome_ai/app/src/chrome_ai.html | 91 + .../experimental/chrome_ai/app/src/index.js | 65 + .../chrome_ai/app/webpack.config.js | 10 + .../src/experimental/chrome_ai/app/yarn.lock | 2221 +++++++++++++++++ .../src/experimental/chrome_ai/chat_models.ts | 6 +- langchain/src/load/import_map.ts | 1 + .../src/chat_models/tests/chrome_ai.html | 34 - 19 files changed, 2453 insertions(+), 38 deletions(-) create mode 100644 langchain/src/experimental/chrome_ai/app/README.md create mode 100644 langchain/src/experimental/chrome_ai/app/package.json create mode 100644 langchain/src/experimental/chrome_ai/app/src/chrome_ai.html create mode 100644 langchain/src/experimental/chrome_ai/app/src/index.js create mode 100644 langchain/src/experimental/chrome_ai/app/webpack.config.js create mode 100644 langchain/src/experimental/chrome_ai/app/yarn.lock rename libs/langchain-community/src/chat_models/chrome_ai.ts => langchain/src/experimental/chrome_ai/chat_models.ts (97%) delete mode 100644 libs/langchain-community/src/chat_models/tests/chrome_ai.html diff --git a/environment_tests/test-exports-bun/src/entrypoints.js b/environment_tests/test-exports-bun/src/entrypoints.js index 0127a63d1c08..bef03d471759 100644 --- a/environment_tests/test-exports-bun/src/entrypoints.js +++ b/environment_tests/test-exports-bun/src/entrypoints.js @@ -68,6 +68,7 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; +export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-cf/src/entrypoints.js b/environment_tests/test-exports-cf/src/entrypoints.js index 0127a63d1c08..bef03d471759 100644 --- a/environment_tests/test-exports-cf/src/entrypoints.js +++ b/environment_tests/test-exports-cf/src/entrypoints.js @@ -68,6 +68,7 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; +export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-cjs/src/entrypoints.js b/environment_tests/test-exports-cjs/src/entrypoints.js index 5f9a19db39f2..7c30db491b23 100644 --- a/environment_tests/test-exports-cjs/src/entrypoints.js +++ b/environment_tests/test-exports-cjs/src/entrypoints.js @@ -68,6 +68,7 @@ const experimental_babyagi = require("langchain/experimental/babyagi"); const experimental_generative_agents = require("langchain/experimental/generative_agents"); const experimental_plan_and_execute = require("langchain/experimental/plan_and_execute"); const experimental_chains_violation_of_expectations = require("langchain/experimental/chains/violation_of_expectations"); +const experimental_chat_models_chrome_ai = require("langchain/experimental/chat_models/chrome_ai"); const experimental_masking = require("langchain/experimental/masking"); const experimental_prompts_custom_format = require("langchain/experimental/prompts/custom_format"); const evaluation = require("langchain/evaluation"); diff --git a/environment_tests/test-exports-esbuild/src/entrypoints.js b/environment_tests/test-exports-esbuild/src/entrypoints.js index d3b76a743d8a..693bc1eab6b7 100644 --- a/environment_tests/test-exports-esbuild/src/entrypoints.js +++ b/environment_tests/test-exports-esbuild/src/entrypoints.js @@ -68,6 +68,7 @@ import * as experimental_babyagi from "langchain/experimental/babyagi"; import * as experimental_generative_agents from "langchain/experimental/generative_agents"; import * as experimental_plan_and_execute from "langchain/experimental/plan_and_execute"; import * as experimental_chains_violation_of_expectations from "langchain/experimental/chains/violation_of_expectations"; +import * as experimental_chat_models_chrome_ai from "langchain/experimental/chat_models/chrome_ai"; import * as experimental_masking from "langchain/experimental/masking"; import * as experimental_prompts_custom_format from "langchain/experimental/prompts/custom_format"; import * as evaluation from "langchain/evaluation"; diff --git a/environment_tests/test-exports-esm/src/entrypoints.js b/environment_tests/test-exports-esm/src/entrypoints.js index d3b76a743d8a..693bc1eab6b7 100644 --- a/environment_tests/test-exports-esm/src/entrypoints.js +++ b/environment_tests/test-exports-esm/src/entrypoints.js @@ -68,6 +68,7 @@ import * as experimental_babyagi from "langchain/experimental/babyagi"; import * as experimental_generative_agents from "langchain/experimental/generative_agents"; import * as experimental_plan_and_execute from "langchain/experimental/plan_and_execute"; import * as experimental_chains_violation_of_expectations from "langchain/experimental/chains/violation_of_expectations"; +import * as experimental_chat_models_chrome_ai from "langchain/experimental/chat_models/chrome_ai"; import * as experimental_masking from "langchain/experimental/masking"; import * as experimental_prompts_custom_format from "langchain/experimental/prompts/custom_format"; import * as evaluation from "langchain/evaluation"; diff --git a/environment_tests/test-exports-vercel/src/entrypoints.js b/environment_tests/test-exports-vercel/src/entrypoints.js index 0127a63d1c08..bef03d471759 100644 --- a/environment_tests/test-exports-vercel/src/entrypoints.js +++ b/environment_tests/test-exports-vercel/src/entrypoints.js @@ -68,6 +68,7 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; +export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-vite/src/entrypoints.js b/environment_tests/test-exports-vite/src/entrypoints.js index 0127a63d1c08..bef03d471759 100644 --- a/environment_tests/test-exports-vite/src/entrypoints.js +++ b/environment_tests/test-exports-vite/src/entrypoints.js @@ -68,6 +68,7 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; +export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/langchain/.gitignore b/langchain/.gitignore index 0047dee6bc98..d24052476339 100644 --- a/langchain/.gitignore +++ b/langchain/.gitignore @@ -510,6 +510,10 @@ experimental/chains/violation_of_expectations.cjs experimental/chains/violation_of_expectations.js experimental/chains/violation_of_expectations.d.ts experimental/chains/violation_of_expectations.d.cts +experimental/chat_models/chrome_ai.cjs +experimental/chat_models/chrome_ai.js +experimental/chat_models/chrome_ai.d.ts +experimental/chat_models/chrome_ai.d.cts experimental/masking.cjs experimental/masking.js experimental/masking.d.ts diff --git a/langchain/langchain.config.js b/langchain/langchain.config.js index d086a9e2cdb8..7d7e227eece9 100644 --- a/langchain/langchain.config.js +++ b/langchain/langchain.config.js @@ -190,6 +190,7 @@ export const config = { "experimental/plan_and_execute": "experimental/plan_and_execute/index", "experimental/chains/violation_of_expectations": "experimental/chains/violation_of_expectations/index", + "experimental/chat_models/chrome_ai": "experimental/chrome_ai/chat_models", "experimental/masking": "experimental/masking/index", "experimental/prompts/custom_format": "experimental/prompts/custom_format", "experimental/prompts/handlebars": "experimental/prompts/handlebars", diff --git a/langchain/package.json b/langchain/package.json index 9bd804d77d0c..5c632daf14d5 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -522,6 +522,10 @@ "experimental/chains/violation_of_expectations.js", "experimental/chains/violation_of_expectations.d.ts", "experimental/chains/violation_of_expectations.d.cts", + "experimental/chat_models/chrome_ai.cjs", + "experimental/chat_models/chrome_ai.js", + "experimental/chat_models/chrome_ai.d.ts", + "experimental/chat_models/chrome_ai.d.cts", "experimental/masking.cjs", "experimental/masking.js", "experimental/masking.d.ts", @@ -2075,6 +2079,15 @@ "import": "./experimental/chains/violation_of_expectations.js", "require": "./experimental/chains/violation_of_expectations.cjs" }, + "./experimental/chat_models/chrome_ai": { + "types": { + "import": "./experimental/chat_models/chrome_ai.d.ts", + "require": "./experimental/chat_models/chrome_ai.d.cts", + "default": "./experimental/chat_models/chrome_ai.d.ts" + }, + "import": "./experimental/chat_models/chrome_ai.js", + "require": "./experimental/chat_models/chrome_ai.cjs" + }, "./experimental/masking": { "types": { "import": "./experimental/masking.d.ts", diff --git a/langchain/src/experimental/chrome_ai/app/README.md b/langchain/src/experimental/chrome_ai/app/README.md new file mode 100644 index 000000000000..9ec6cd46f989 --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/README.md @@ -0,0 +1,22 @@ +# ChatChromeAI + +This is a simple application designed to run in the browser that uses the webGPU and Gemini Nano. +Gemini Nano is a LLM which Google Chrome has embedded in the browser. As of 06/26/2024 it is still in beta. To request access or find more information, please visit [this link](https://developer.chrome.com/docs/ai/built-in). + +## Getting Started + +To run this application, you'll first need to build the locally dependencies. From the root of the `langchain-ai/langchainjs` repo, run the following command: + +```bash +yarn build --filter=langchain --filter=@langchain/openai +``` + +Once the dependencies are built, navigate into this directory (`langchain/src/experimental/chrome_ai/app`) and run the following command: + +```bash +yarn install # install the dependencies + +yarn start # start the application +``` + +Then, open your browser and navigate to [`http://127.0.0.1:8080/src/chrome_ai.html`](http://127.0.0.1:8080/src/chrome_ai.html). \ No newline at end of file diff --git a/langchain/src/experimental/chrome_ai/app/package.json b/langchain/src/experimental/chrome_ai/app/package.json new file mode 100644 index 000000000000..00549bbcbf7a --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/package.json @@ -0,0 +1,16 @@ +{ + "name": "chrome_ai", + "packageManager": "yarn@3.4.1", + "scripts": { + "start": "rm -rf ./dist && yarn webpack && yarn http-server -c-1 -p 8080" + }, + "devDependencies": { + "http-server": "^14.0.1", + "webpack": "^5.92.1", + "webpack-cli": "^5.1.4" + }, + "dependencies": { + "@langchain/openai": "file:../../../../../libs/langchain-openai", + "langchain": "file:../../../../" + } +} diff --git a/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html b/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html new file mode 100644 index 000000000000..045b2f161328 --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html @@ -0,0 +1,91 @@ + + + + ChatChromeAI Example + + + +

LangChain.js🦜🔗 - ChatChromeAI Example

+ + + +
+
+
+ +
+ +
+
+
+
+ First Token: -- ms + Total Time: -- ms + Total Tokens: -- +
+
+
+ + + + \ No newline at end of file diff --git a/langchain/src/experimental/chrome_ai/app/src/index.js b/langchain/src/experimental/chrome_ai/app/src/index.js new file mode 100644 index 000000000000..2177722979ed --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/src/index.js @@ -0,0 +1,65 @@ +import { ChatChromeAI } from "langchain/experimental/chat_models/chrome_ai"; +import { encodingForModel } from "@langchain/core/utils/tiktoken"; + +const model = new ChatChromeAI({ callbacks: {} }); +const destroyButton = document.getElementById("destroyButton"); +const inputForm = document.getElementById("inputForm"); +const submitButton = inputForm.querySelector("button[type='submit']"); + +// Initialize the model when the page loads +window.addEventListener("load", async () => { + try { + await model.initialize(); + destroyButton.disabled = false; + submitButton.disabled = false; + } catch (error) { + console.error("Failed to initialize model:", error); + alert("Failed to initialize model. Please try refreshing the page."); + } +}); + +destroyButton.addEventListener("click", () => { + model.destroy(); + destroyButton.disabled = true; + submitButton.disabled = true; +}); + +inputForm.addEventListener("submit", async (event) => { + event.preventDefault(); + const input = document.getElementById("inputField").value; + const humanMessage = ["human", input]; + + // Clear previous response + const responseTextElement = document.getElementById("responseText"); + responseTextElement.textContent = ""; + + let fullMsg = ""; + let timeToFirstTokenMs = 0; + let totalTimeMs = 0; + try { + const startTime = performance.now(); + for await (const chunk of await model.stream(humanMessage)) { + if (timeToFirstTokenMs === 0) { + timeToFirstTokenMs = performance.now() - startTime; + } + fullMsg += chunk.content; + // Update the response element with the new content + responseTextElement.textContent = fullMsg; + } + totalTimeMs = performance.now() - startTime; + } catch (error) { + console.error("An error occurred:", error); + responseTextElement.textContent = "An error occurred: " + error.message; + } + + const encoding = await encodingForModel("gpt2"); + const numTokens = encoding.encode(fullMsg).length; + + // Update the stat pills + console.log(`First Token: ${Math.round(timeToFirstTokenMs)} ms`); + console.log(`Total Time: ${Math.round(totalTimeMs)} ms`); + console.log(`Total Tokens: ${numTokens}`); + document.getElementById("firstTokenTime").textContent = `First Token: ${Math.round(timeToFirstTokenMs)} ms`; + document.getElementById("totalTime").textContent = `Total Time: ${Math.round(totalTimeMs)} ms`; + document.getElementById("totalTokens").textContent = `Total Tokens: ${numTokens}`; +}); diff --git a/langchain/src/experimental/chrome_ai/app/webpack.config.js b/langchain/src/experimental/chrome_ai/app/webpack.config.js new file mode 100644 index 000000000000..5f8d3209edd2 --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/webpack.config.js @@ -0,0 +1,10 @@ +const path = require('path'); + +module.exports = { + entry: './src/index.js', + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'dist'), + }, + mode: 'development', +}; \ No newline at end of file diff --git a/langchain/src/experimental/chrome_ai/app/yarn.lock b/langchain/src/experimental/chrome_ai/app/yarn.lock new file mode 100644 index 000000000000..9e4d598304f4 --- /dev/null +++ b/langchain/src/experimental/chrome_ai/app/yarn.lock @@ -0,0 +1,2221 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 6 + cacheKey: 8 + +"@discoveryjs/json-ext@npm:^0.5.0": + version: 0.5.7 + resolution: "@discoveryjs/json-ext@npm:0.5.7" + checksum: 2176d301cc258ea5c2324402997cf8134ebb212469c0d397591636cea8d3c02f2b3cf9fd58dcb748c7a0dade77ebdc1b10284fa63e608c033a1db52fddc69918 + languageName: node + linkType: hard + +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": ^1.2.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870 + languageName: node + linkType: hard + +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.6 + resolution: "@jridgewell/source-map@npm:0.3.6" + dependencies: + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + checksum: c9dc7d899397df95e3c9ec287b93c0b56f8e4453cd20743e2b9c8e779b1949bc3cccf6c01bb302779e46560eb45f62ea38d19fedd25370d814734268450a9f30 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 + languageName: node + linkType: hard + +"@langchain/core@npm:>0.2.0 <0.3.0, @langchain/core@npm:>=0.2.8 <0.3.0, @langchain/core@npm:~0.2.0": + version: 0.2.10 + resolution: "@langchain/core@npm:0.2.10" + dependencies: + ansi-styles: ^5.0.0 + camelcase: 6 + decamelize: 1.2.0 + js-tiktoken: ^1.0.12 + langsmith: ~0.1.30 + ml-distance: ^4.0.0 + mustache: ^4.2.0 + p-queue: ^6.6.2 + p-retry: 4 + uuid: ^9.0.0 + zod: ^3.22.4 + zod-to-json-schema: ^3.22.3 + checksum: e3ff277e2ac81de6b0abde68e331481d33b78f9a7a1b7bd0d2ff5c64728340e72c0017d350d4b4afc242992f5975982a2644bf7300f201ddbb108a9a0da00fb5 + languageName: node + linkType: hard + +"@langchain/openai@file:../../../../../libs/langchain-openai::locator=chrome_ai%40workspace%3A.": + version: 0.2.0 + resolution: "@langchain/openai@file:../../../../../libs/langchain-openai#../../../../../libs/langchain-openai::hash=0e7c98&locator=chrome_ai%40workspace%3A." + dependencies: + "@langchain/core": ">=0.2.8 <0.3.0" + js-tiktoken: ^1.0.12 + openai: ^4.49.1 + zod: ^3.22.4 + zod-to-json-schema: ^3.22.3 + checksum: 2b070c3c7195597d4bb85ef8265721ca4eb981a14ead9b65145a9d241402348b6e6950ef8edd0667ee77f574282aff84fa04ceb4d35fa9edfaf666fdc06567d1 + languageName: node + linkType: hard + +"@langchain/openai@npm:>=0.1.0 <0.3.0": + version: 0.2.0 + resolution: "@langchain/openai@npm:0.2.0" + dependencies: + "@langchain/core": ">=0.2.8 <0.3.0" + js-tiktoken: ^1.0.12 + openai: ^4.49.1 + zod: ^3.22.4 + zod-to-json-schema: ^3.22.3 + checksum: 47b7fb04a968bad9a69363eeaf6e7ec956179f49d0317779e5604f3197ac637888bdb2854025f117bf89455bcf2a6cf4fae17a16c21563135ee68a9fee2bbdec + languageName: node + linkType: hard + +"@langchain/textsplitters@npm:~0.0.0": + version: 0.0.3 + resolution: "@langchain/textsplitters@npm:0.0.3" + dependencies: + "@langchain/core": ">0.2.0 <0.3.0" + js-tiktoken: ^1.0.12 + checksum: f0b32d65c863a280ce7104bff4d367734b8f76f2ec42b741fb690fbc20737bb4a3a412b82d8ba308a524441b6084ecd59cf61c3ce13cbb9639fbd02241c341d1 + languageName: node + linkType: hard + +"@types/eslint-scope@npm:^3.7.3": + version: 3.7.7 + resolution: "@types/eslint-scope@npm:3.7.7" + dependencies: + "@types/eslint": "*" + "@types/estree": "*" + checksum: e2889a124aaab0b89af1bab5959847c5bec09809209255de0e63b9f54c629a94781daa04adb66bffcdd742f5e25a17614fb933965093c0eea64aacda4309380e + languageName: node + linkType: hard + +"@types/eslint@npm:*": + version: 8.56.10 + resolution: "@types/eslint@npm:8.56.10" + dependencies: + "@types/estree": "*" + "@types/json-schema": "*" + checksum: fb7137dd263ce1130b42d14452bdd0266ef81f52cb55ba1a5e9750e65da1f0596dc598c88bffc7e415458b6cb611a876dcc132bcf40ea48701c6d05b40c57be5 + languageName: node + linkType: hard + +"@types/estree@npm:*, @types/estree@npm:^1.0.5": + version: 1.0.5 + resolution: "@types/estree@npm:1.0.5" + checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a + languageName: node + linkType: hard + +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 + languageName: node + linkType: hard + +"@types/node-fetch@npm:^2.6.4": + version: 2.6.11 + resolution: "@types/node-fetch@npm:2.6.11" + dependencies: + "@types/node": "*" + form-data: ^4.0.0 + checksum: 180e4d44c432839bdf8a25251ef8c47d51e37355ddd78c64695225de8bc5dc2b50b7bb855956d471c026bb84bd7295688a0960085e7158cbbba803053492568b + languageName: node + linkType: hard + +"@types/node@npm:*": + version: 20.14.9 + resolution: "@types/node@npm:20.14.9" + dependencies: + undici-types: ~5.26.4 + checksum: 5e9eda1ac8c6cc6bcd1063903ae195eaede9aad1bdad00408a919409cfbcdd2d6535aa3d50346f0d385528f9e03dafc7d1b3bad25aedb1dcd79a6ad39d06c35d + languageName: node + linkType: hard + +"@types/node@npm:^18.11.18": + version: 18.19.39 + resolution: "@types/node@npm:18.19.39" + dependencies: + undici-types: ~5.26.4 + checksum: d1de755983127b405458c427ae2cf77c89d120a617ca70999086a75fb0b6c6dbc1bdddfe1a8a7374c9ae55ed0589a2bd023ffb3b09ee25440c013afc6502dfe6 + languageName: node + linkType: hard + +"@types/retry@npm:0.12.0": + version: 0.12.0 + resolution: "@types/retry@npm:0.12.0" + checksum: 61a072c7639f6e8126588bf1eb1ce8835f2cb9c2aba795c4491cf6310e013267b0c8488039857c261c387e9728c1b43205099223f160bb6a76b4374f741b5603 + languageName: node + linkType: hard + +"@types/uuid@npm:^9.0.1": + version: 9.0.8 + resolution: "@types/uuid@npm:9.0.8" + checksum: b8c60b7ba8250356b5088302583d1704a4e1a13558d143c549c408bf8920535602ffc12394ede77f8a8083511b023704bc66d1345792714002bfa261b17c5275 + languageName: node + linkType: hard + +"@webassemblyjs/ast@npm:1.12.1, @webassemblyjs/ast@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/ast@npm:1.12.1" + dependencies: + "@webassemblyjs/helper-numbers": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + checksum: 31bcc64147236bd7b1b6d29d1f419c1f5845c785e1e42dc9e3f8ca2e05a029e9393a271b84f3a5bff2a32d35f51ff59e2181a6e5f953fe88576acd6750506202 + languageName: node + linkType: hard + +"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" + checksum: 29b08758841fd8b299c7152eda36b9eb4921e9c584eb4594437b5cd90ed6b920523606eae7316175f89c20628da14326801090167cc7fbffc77af448ac84b7e2 + languageName: node + linkType: hard + +"@webassemblyjs/helper-api-error@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" + checksum: e8563df85161096343008f9161adb138a6e8f3c2cc338d6a36011aa55eabb32f2fd138ffe63bc278d009ada001cc41d263dadd1c0be01be6c2ed99076103689f + languageName: node + linkType: hard + +"@webassemblyjs/helper-buffer@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/helper-buffer@npm:1.12.1" + checksum: c3ffb723024130308db608e86e2bdccd4868bbb62dffb0a9a1530606496f79c87f8565bd8e02805ce64912b71f1a70ee5fb00307258b0c082c3abf961d097eca + languageName: node + linkType: hard + +"@webassemblyjs/helper-numbers@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" + dependencies: + "@webassemblyjs/floating-point-hex-parser": 1.11.6 + "@webassemblyjs/helper-api-error": 1.11.6 + "@xtuc/long": 4.2.2 + checksum: f4b562fa219f84368528339e0f8d273ad44e047a07641ffcaaec6f93e5b76fd86490a009aa91a294584e1436d74b0a01fa9fde45e333a4c657b58168b04da424 + languageName: node + linkType: hard + +"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" + checksum: 3535ef4f1fba38de3475e383b3980f4bbf3de72bbb631c2b6584c7df45be4eccd62c6ff48b5edd3f1bcff275cfd605a37679ec199fc91fd0a7705d7f1e3972dc + languageName: node + linkType: hard + +"@webassemblyjs/helper-wasm-section@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/wasm-gen": 1.12.1 + checksum: c19810cdd2c90ff574139b6d8c0dda254d42d168a9e5b3d353d1bc085f1d7164ccd1b3c05592a45a939c47f7e403dc8d03572bb686642f06a3d02932f6f0bc8f + languageName: node + linkType: hard + +"@webassemblyjs/ieee754@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/ieee754@npm:1.11.6" + dependencies: + "@xtuc/ieee754": ^1.2.0 + checksum: 13574b8e41f6ca39b700e292d7edf102577db5650fe8add7066a320aa4b7a7c09a5056feccac7a74eb68c10dea9546d4461412af351f13f6b24b5f32379b49de + languageName: node + linkType: hard + +"@webassemblyjs/leb128@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/leb128@npm:1.11.6" + dependencies: + "@xtuc/long": 4.2.2 + checksum: 7ea942dc9777d4b18a5ebfa3a937b30ae9e1d2ce1fee637583ed7f376334dd1d4274f813d2e250056cca803e0952def4b954913f1a3c9068bcd4ab4ee5143bf0 + languageName: node + linkType: hard + +"@webassemblyjs/utf8@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/utf8@npm:1.11.6" + checksum: 807fe5b5ce10c390cfdd93e0fb92abda8aebabb5199980681e7c3743ee3306a75729bcd1e56a3903980e96c885ee53ef901fcbaac8efdfa480f9c0dae1d08713 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-edit@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-edit@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/helper-wasm-section": 1.12.1 + "@webassemblyjs/wasm-gen": 1.12.1 + "@webassemblyjs/wasm-opt": 1.12.1 + "@webassemblyjs/wasm-parser": 1.12.1 + "@webassemblyjs/wast-printer": 1.12.1 + checksum: ae23642303f030af888d30c4ef37b08dfec7eab6851a9575a616e65d1219f880d9223913a39056dd654e49049d76e97555b285d1f7e56935047abf578cce0692 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-gen@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-gen@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: 5787626bb7f0b033044471ddd00ce0c9fe1ee4584e8b73e232051e3a4c99ba1a102700d75337151c8b6055bae77eefa4548960c610a5e4a504e356bd872138ff + languageName: node + linkType: hard + +"@webassemblyjs/wasm-opt@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-opt@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/wasm-gen": 1.12.1 + "@webassemblyjs/wasm-parser": 1.12.1 + checksum: 0e8fa8a0645304a1e18ff40d3db5a2e9233ebaa169b19fcc651d6fc9fe2cac0ce092ddee927318015ae735d9cd9c5d97c0cafb6a51dcd2932ac73587b62df991 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-parser@npm:1.12.1, @webassemblyjs/wasm-parser@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-parser@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-api-error": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: 176015de3551ac068cd4505d837414f258d9ade7442bd71efb1232fa26c9f6d7d4e11a5c816caeed389943f409af7ebff6899289a992d7a70343cb47009d21a8 + languageName: node + linkType: hard + +"@webassemblyjs/wast-printer@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wast-printer@npm:1.12.1" + dependencies: + "@webassemblyjs/ast": 1.12.1 + "@xtuc/long": 4.2.2 + checksum: 2974b5dda8d769145ba0efd886ea94a601e61fb37114c14f9a9a7606afc23456799af652ac3052f284909bd42edc3665a76bc9b50f95f0794c053a8a1757b713 + languageName: node + linkType: hard + +"@webpack-cli/configtest@npm:^2.1.1": + version: 2.1.1 + resolution: "@webpack-cli/configtest@npm:2.1.1" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + checksum: 9f9f9145c2d05471fc83d426db1df85cf49f329836b0c4b9f46b6948bed4b013464c00622b136d2a0a26993ce2306976682592245b08ee717500b1db45009a72 + languageName: node + linkType: hard + +"@webpack-cli/info@npm:^2.0.2": + version: 2.0.2 + resolution: "@webpack-cli/info@npm:2.0.2" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + checksum: 8f9a178afca5c82e113aed1efa552d64ee5ae4fdff63fe747c096a981ec74f18a5d07bd6e89bbe6715c3e57d96eea024a410e58977169489fe1df044c10dd94e + languageName: node + linkType: hard + +"@webpack-cli/serve@npm:^2.0.5": + version: 2.0.5 + resolution: "@webpack-cli/serve@npm:2.0.5" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + peerDependenciesMeta: + webpack-dev-server: + optional: true + checksum: 75f0e54681796d567a71ac3e2781d2901a8d8cf1cdfc82f261034dddac59a8343e8c3bc5e32b4bb9d6766759ba49fb29a5cd86ef1701d79c506fe886bb63ac75 + languageName: node + linkType: hard + +"@xtuc/ieee754@npm:^1.2.0": + version: 1.2.0 + resolution: "@xtuc/ieee754@npm:1.2.0" + checksum: ac56d4ca6e17790f1b1677f978c0c6808b1900a5b138885d3da21732f62e30e8f0d9120fcf8f6edfff5100ca902b46f8dd7c1e3f903728634523981e80e2885a + languageName: node + linkType: hard + +"@xtuc/long@npm:4.2.2": + version: 4.2.2 + resolution: "@xtuc/long@npm:4.2.2" + checksum: 8ed0d477ce3bc9c6fe2bf6a6a2cc316bb9c4127c5a7827bae947fa8ec34c7092395c5a283cc300c05b5fa01cbbfa1f938f410a7bf75db7c7846fea41949989ec + languageName: node + linkType: hard + +"abort-controller@npm:^3.0.0": + version: 3.0.0 + resolution: "abort-controller@npm:3.0.0" + dependencies: + event-target-shim: ^5.0.0 + checksum: 170bdba9b47b7e65906a28c8ce4f38a7a369d78e2271706f020849c1bfe0ee2067d4261df8bbb66eb84f79208fd5b710df759d64191db58cfba7ce8ef9c54b75 + languageName: node + linkType: hard + +"acorn-import-attributes@npm:^1.9.5": + version: 1.9.5 + resolution: "acorn-import-attributes@npm:1.9.5" + peerDependencies: + acorn: ^8 + checksum: 1c0c49b6a244503964ae46ae850baccf306e84caf99bc2010ed6103c69a423987b07b520a6c619f075d215388bd4923eccac995886a54309eda049ab78a4be95 + languageName: node + linkType: hard + +"acorn@npm:^8.7.1, acorn@npm:^8.8.2": + version: 8.12.0 + resolution: "acorn@npm:8.12.0" + bin: + acorn: bin/acorn + checksum: ae142de8739ef15a5d936c550c1d267fc4dedcdbe62ad1aa2c0009afed1de84dd0a584684a5d200bb55d8db14f3e09a95c6e92a5303973c04b9a7413c36d1df0 + languageName: node + linkType: hard + +"agentkeepalive@npm:^4.2.1": + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" + dependencies: + humanize-ms: ^1.2.1 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 + languageName: node + linkType: hard + +"ajv-keywords@npm:^3.5.2": + version: 3.5.2 + resolution: "ajv-keywords@npm:3.5.2" + peerDependencies: + ajv: ^6.9.1 + checksum: 7dc5e5931677a680589050f79dcbe1fefbb8fea38a955af03724229139175b433c63c68f7ae5f86cf8f65d55eb7c25f75a046723e2e58296707617ca690feae9 + languageName: node + linkType: hard + +"ajv@npm:^6.12.5": + version: 6.12.6 + resolution: "ajv@npm:6.12.6" + dependencies: + fast-deep-equal: ^3.1.1 + fast-json-stable-stringify: ^2.0.0 + json-schema-traverse: ^0.4.1 + uri-js: ^4.2.2 + checksum: 874972efe5c4202ab0a68379481fbd3d1b5d0a7bd6d3cc21d40d3536ebff3352a2a1fabb632d4fd2cc7fe4cbdcd5ed6782084c9bbf7f32a1536d18f9da5007d4 + languageName: node + linkType: hard + +"ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: ^2.0.1 + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + languageName: node + linkType: hard + +"ansi-styles@npm:^5.0.0": + version: 5.2.0 + resolution: "ansi-styles@npm:5.2.0" + checksum: d7f4e97ce0623aea6bc0d90dcd28881ee04cba06c570b97fd3391bd7a268eedfd9d5e2dd4fdcbdd82b8105df5faf6f24aaedc08eaf3da898e702db5948f63469 + languageName: node + linkType: hard + +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced + languageName: node + linkType: hard + +"async@npm:^2.6.4": + version: 2.6.4 + resolution: "async@npm:2.6.4" + dependencies: + lodash: ^4.17.14 + checksum: a52083fb32e1ebe1d63e5c5624038bb30be68ff07a6c8d7dfe35e47c93fc144bd8652cbec869e0ac07d57dde387aa5f1386be3559cdee799cb1f789678d88e19 + languageName: node + linkType: hard + +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + +"base64-js@npm:^1.5.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + +"basic-auth@npm:^2.0.1": + version: 2.0.1 + resolution: "basic-auth@npm:2.0.1" + dependencies: + safe-buffer: 5.1.2 + checksum: 3419b805d5dfc518f3a05dcf42aa53aa9ce820e50b6df5097f9e186322e1bc733c36722b624802cd37e791035aa73b828ed814d8362333d42d7f5cd04d7a5e48 + languageName: node + linkType: hard + +"binary-extensions@npm:^2.2.0": + version: 2.3.0 + resolution: "binary-extensions@npm:2.3.0" + checksum: bcad01494e8a9283abf18c1b967af65ee79b0c6a9e6fcfafebfe91dbe6e0fc7272bafb73389e198b310516ae04f7ad17d79aacf6cb4c0d5d5202a7e2e52c7d98 + languageName: node + linkType: hard + +"binary-search@npm:^1.3.5": + version: 1.3.6 + resolution: "binary-search@npm:1.3.6" + checksum: 2e6b3459a9c1ba1bd674a6a855a5ef7505f70707422244430e3510e989c0df6074a49fe60784a98b93b51545c9bcace1db1defee06ff861b124c036a2f2836bf + languageName: node + linkType: hard + +"browserslist@npm:^4.21.10": + version: 4.23.1 + resolution: "browserslist@npm:4.23.1" + dependencies: + caniuse-lite: ^1.0.30001629 + electron-to-chromium: ^1.4.796 + node-releases: ^2.0.14 + update-browserslist-db: ^1.0.16 + bin: + browserslist: cli.js + checksum: 06189e2d6666a203ce097cc0e713a40477d08420927b79af139211e5712f3cf676fdc4dd6af3aa493d47c09206a344b3420a8315577dbe88c58903132de9b0f5 + languageName: node + linkType: hard + +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb + languageName: node + linkType: hard + +"call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + set-function-length: ^1.2.1 + checksum: 295c0c62b90dd6522e6db3b0ab1ce26bdf9e7404215bda13cfee25b626b5ff1a7761324d58d38b1ef1607fc65aca2d06e44d2e18d0dfc6c14b465b00d8660029 + languageName: node + linkType: hard + +"camelcase@npm:6": + version: 6.3.0 + resolution: "camelcase@npm:6.3.0" + checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d + languageName: node + linkType: hard + +"caniuse-lite@npm:^1.0.30001629": + version: 1.0.30001637 + resolution: "caniuse-lite@npm:1.0.30001637" + checksum: cb8b194b8576c73d287274cf3028541c218da7f2e1871b737e4829796521f45dbb4745fa466e0e56a241693cfe8d00d20ac3e55337f3923e914995d1d5a639a6 + languageName: node + linkType: hard + +"chalk@npm:^4.1.2": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + +"chrome-trace-event@npm:^1.0.2": + version: 1.0.4 + resolution: "chrome-trace-event@npm:1.0.4" + checksum: fcbbd9dd0cd5b48444319007cc0c15870fd8612cc0df320908aa9d5e8a244084d48571eb28bf3c58c19327d2c5838f354c2d89fac3956d8e992273437401ac19 + languageName: node + linkType: hard + +"chrome_ai@workspace:.": + version: 0.0.0-use.local + resolution: "chrome_ai@workspace:." + dependencies: + "@langchain/openai": "file:../../../../../libs/langchain-openai" + http-server: ^14.0.1 + langchain: "file:../../../../" + webpack: ^5.92.1 + webpack-cli: ^5.1.4 + languageName: unknown + linkType: soft + +"clone-deep@npm:^4.0.1": + version: 4.0.1 + resolution: "clone-deep@npm:4.0.1" + dependencies: + is-plain-object: ^2.0.4 + kind-of: ^6.0.2 + shallow-clone: ^3.0.0 + checksum: 770f912fe4e6f21873c8e8fbb1e99134db3b93da32df271d00589ea4a29dbe83a9808a322c93f3bcaf8584b8b4fa6fc269fc8032efbaa6728e0c9886c74467d2 + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: ~1.1.4 + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 + languageName: node + linkType: hard + +"colorette@npm:^2.0.14": + version: 2.0.20 + resolution: "colorette@npm:2.0.20" + checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d + languageName: node + linkType: hard + +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 436901d64a818295803c1996cd856621a74f30b9f9e28a588e726b2b1670665bccd7c1a77007ebf328729f0139838a88a19265858a0fa7a8728c4656796db948 + languageName: node + linkType: hard + +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e + languageName: node + linkType: hard + +"corser@npm:^2.0.1": + version: 2.0.1 + resolution: "corser@npm:2.0.1" + checksum: 9ff6944eda760c8c3118747a636afc3ede53b41e7b9960513a15b88032209a728e630ae4b41e20a941e34da129fe9094d1f5d95123ef64ac2e16cdad8dce9c87 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.3": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + +"debug@npm:^3.2.7": + version: 3.2.7 + resolution: "debug@npm:3.2.7" + dependencies: + ms: ^2.1.1 + checksum: b3d8c5940799914d30314b7c3304a43305fd0715581a919dacb8b3176d024a782062368405b47491516d2091d6462d4d11f2f4974a405048094f8bfebfa3071c + languageName: node + linkType: hard + +"decamelize@npm:1.2.0": + version: 1.2.0 + resolution: "decamelize@npm:1.2.0" + checksum: ad8c51a7e7e0720c70ec2eeb1163b66da03e7616d7b98c9ef43cce2416395e84c1e9548dd94f5f6ffecfee9f8b94251fc57121a8b021f2ff2469b2bae247b8aa + languageName: node + linkType: hard + +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + gopd: ^1.0.1 + checksum: 8068ee6cab694d409ac25936eb861eea704b7763f7f342adbdfe337fc27c78d7ae0eff2364b2917b58c508d723c7a074326d068eef2e45c4edcd85cf94d0313b + languageName: node + linkType: hard + +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + +"electron-to-chromium@npm:^1.4.796": + version: 1.4.812 + resolution: "electron-to-chromium@npm:1.4.812" + checksum: 0205fcb6db3a719873398f46cd3341188d4a54e056567453819532c5fd1fadda43f501c252bc8d05eeaaeb1497f58d9875c46c4f9ecfbe713b9efe71cd879b13 + languageName: node + linkType: hard + +"enhanced-resolve@npm:^5.17.0": + version: 5.17.0 + resolution: "enhanced-resolve@npm:5.17.0" + dependencies: + graceful-fs: ^4.2.4 + tapable: ^2.2.0 + checksum: 1066000454da6a7aeabdbe1f433d912d1e39e6892142a78a37b6577aab27e0436091fa1399d857ad87085b1c3b73a0f811c8874da3dbdc40fbd5ebe89a5568e6 + languageName: node + linkType: hard + +"envinfo@npm:^7.7.3": + version: 7.13.0 + resolution: "envinfo@npm:7.13.0" + bin: + envinfo: dist/cli.js + checksum: 822fc30f53bd0be67f0e25be96eb6a2562b8062f3058846bbd7ec471bd4b7835fca6436ee72c4029c8ae4a3d8f8cddbe2ee725b22291f015232d20a682bee732 + languageName: node + linkType: hard + +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: ^1.2.4 + checksum: f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: ec1414527a0ccacd7f15f4a3bc66e215f04f595ba23ca75cdae0927af099b5ec865f9f4d33e9d7e86f512f252876ac77d4281a7871531a50678132429b1271b5 + languageName: node + linkType: hard + +"es-module-lexer@npm:^1.2.1": + version: 1.5.4 + resolution: "es-module-lexer@npm:1.5.4" + checksum: a0cf04fb92d052647ac7d818d1913b98d3d3d0f5b9d88f0eafb993436e4c3e2c958599db68839d57f2dfa281fdf0f60e18d448eb78fc292c33c0f25635b6854f + languageName: node + linkType: hard + +"escalade@npm:^3.1.2": + version: 3.1.2 + resolution: "escalade@npm:3.1.2" + checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 + languageName: node + linkType: hard + +"eslint-scope@npm:5.1.1": + version: 5.1.1 + resolution: "eslint-scope@npm:5.1.1" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^4.1.1 + checksum: 47e4b6a3f0cc29c7feedee6c67b225a2da7e155802c6ea13bbef4ac6b9e10c66cd2dcb987867ef176292bf4e64eccc680a49e35e9e9c669f4a02bac17e86abdb + languageName: node + linkType: hard + +"esrecurse@npm:^4.3.0": + version: 4.3.0 + resolution: "esrecurse@npm:4.3.0" + dependencies: + estraverse: ^5.2.0 + checksum: ebc17b1a33c51cef46fdc28b958994b1dc43cd2e86237515cbc3b4e5d2be6a811b2315d0a1a4d9d340b6d2308b15322f5c8291059521cc5f4802f65e7ec32837 + languageName: node + linkType: hard + +"estraverse@npm:^4.1.1": + version: 4.3.0 + resolution: "estraverse@npm:4.3.0" + checksum: a6299491f9940bb246124a8d44b7b7a413a8336f5436f9837aaa9330209bd9ee8af7e91a654a3545aee9c54b3308e78ee360cef1d777d37cfef77d2fa33b5827 + languageName: node + linkType: hard + +"estraverse@npm:^5.2.0": + version: 5.3.0 + resolution: "estraverse@npm:5.3.0" + checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b + languageName: node + linkType: hard + +"event-target-shim@npm:^5.0.0": + version: 5.0.1 + resolution: "event-target-shim@npm:5.0.1" + checksum: 1ffe3bb22a6d51bdeb6bf6f7cf97d2ff4a74b017ad12284cc9e6a279e727dc30a5de6bb613e5596ff4dc3e517841339ad09a7eec44266eccb1aa201a30448166 + languageName: node + linkType: hard + +"eventemitter3@npm:^4.0.0, eventemitter3@npm:^4.0.4": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + +"events@npm:^3.2.0": + version: 3.3.0 + resolution: "events@npm:3.3.0" + checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 + languageName: node + linkType: hard + +"fast-deep-equal@npm:^3.1.1": + version: 3.1.3 + resolution: "fast-deep-equal@npm:3.1.3" + checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d + languageName: node + linkType: hard + +"fast-json-stable-stringify@npm:^2.0.0": + version: 2.1.0 + resolution: "fast-json-stable-stringify@npm:2.1.0" + checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb + languageName: node + linkType: hard + +"fastest-levenshtein@npm:^1.0.12": + version: 1.0.16 + resolution: "fastest-levenshtein@npm:1.0.16" + checksum: a78d44285c9e2ae2c25f3ef0f8a73f332c1247b7ea7fb4a191e6bb51aa6ee1ef0dfb3ed113616dcdc7023e18e35a8db41f61c8d88988e877cf510df8edafbc71 + languageName: node + linkType: hard + +"find-up@npm:^4.0.0": + version: 4.1.0 + resolution: "find-up@npm:4.1.0" + dependencies: + locate-path: ^5.0.0 + path-exists: ^4.0.0 + checksum: 4c172680e8f8c1f78839486e14a43ef82e9decd0e74145f40707cc42e7420506d5ec92d9a11c22bd2c48fb0c384ea05dd30e10dd152fefeec6f2f75282a8b844 + languageName: node + linkType: hard + +"flat@npm:^5.0.2": + version: 5.0.2 + resolution: "flat@npm:5.0.2" + bin: + flat: cli.js + checksum: 12a1536ac746db74881316a181499a78ef953632ddd28050b7a3a43c62ef5462e3357c8c29d76072bb635f147f7a9a1f0c02efef6b4be28f8db62ceb3d5c7f5d + languageName: node + linkType: hard + +"follow-redirects@npm:^1.0.0": + version: 1.15.6 + resolution: "follow-redirects@npm:1.15.6" + peerDependenciesMeta: + debug: + optional: true + checksum: a62c378dfc8c00f60b9c80cab158ba54e99ba0239a5dd7c81245e5a5b39d10f0c35e249c3379eae719ff0285fff88c365dd446fab19dee771f1d76252df1bbf5 + languageName: node + linkType: hard + +"form-data-encoder@npm:1.7.2": + version: 1.7.2 + resolution: "form-data-encoder@npm:1.7.2" + checksum: aeebd87a1cb009e13cbb5e4e4008e6202ed5f6551eb6d9582ba8a062005178907b90f4887899d3c993de879159b6c0c940af8196725b428b4248cec5af3acf5f + languageName: node + linkType: hard + +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + mime-types: ^2.1.12 + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + +"formdata-node@npm:^4.3.2": + version: 4.4.1 + resolution: "formdata-node@npm:4.4.1" + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 4.0.0-beta.3 + checksum: d91d4f667cfed74827fc281594102c0dabddd03c9f8b426fc97123eedbf73f5060ee43205d89284d6854e2fc5827e030cd352ef68b93beda8decc2d72128c576 + languageName: node + linkType: hard + +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 + languageName: node + linkType: hard + +"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: ^1.3.0 + function-bind: ^1.1.2 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + checksum: 414e3cdf2c203d1b9d7d33111df746a4512a1aa622770b361dadddf8ed0b5aeb26c560f49ca077e24bfafb0acb55ca908d1f709216ccba33ffc548ec8a79a951 + languageName: node + linkType: hard + +"glob-to-regexp@npm:^0.4.1": + version: 0.4.1 + resolution: "glob-to-regexp@npm:0.4.1" + checksum: e795f4e8f06d2a15e86f76e4d92751cf8bbfcf0157cea5c2f0f35678a8195a750b34096b1256e436f0cebc1883b5ff0888c47348443e69546a5a87f9e1eb1167 + languageName: node + linkType: hard + +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: ^1.1.3 + checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 + languageName: node + linkType: hard + +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad + languageName: node + linkType: hard + +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: ^1.0.0 + checksum: fcbb246ea2838058be39887935231c6d5788babed499d0e9d0cc5737494c48aba4fe17ba1449e0d0fbbb1e36175442faa37f9c427ae357d6ccb1d895fbcd3de3 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: fe7c3d50b33f50f3933a04413ed1f69441d21d2d2944f81036276d30635cad9279f6b43bc8f32036c31ebdfcf6e731150f46c1907ad90c669ffe9b066c3ba5c4 + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 + languageName: node + linkType: hard + +"hasown@npm:^2.0.0, hasown@npm:^2.0.2": + version: 2.0.2 + resolution: "hasown@npm:2.0.2" + dependencies: + function-bind: ^1.1.2 + checksum: e8516f776a15149ca6c6ed2ae3110c417a00b62260e222590e54aa367cbcd6ed99122020b37b7fbdf05748df57b265e70095d7bf35a47660587619b15ffb93db + languageName: node + linkType: hard + +"he@npm:^1.2.0": + version: 1.2.0 + resolution: "he@npm:1.2.0" + bin: + he: bin/he + checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 + languageName: node + linkType: hard + +"html-encoding-sniffer@npm:^3.0.0": + version: 3.0.0 + resolution: "html-encoding-sniffer@npm:3.0.0" + dependencies: + whatwg-encoding: ^2.0.0 + checksum: 8d806aa00487e279e5ccb573366a951a9f68f65c90298eac9c3a2b440a7ffe46615aff2995a2f61c6746c639234e6179a97e18ca5ccbbf93d3725ef2099a4502 + languageName: node + linkType: hard + +"http-proxy@npm:^1.18.1": + version: 1.18.1 + resolution: "http-proxy@npm:1.18.1" + dependencies: + eventemitter3: ^4.0.0 + follow-redirects: ^1.0.0 + requires-port: ^1.0.0 + checksum: f5bd96bf83e0b1e4226633dbb51f8b056c3e6321917df402deacec31dd7fe433914fc7a2c1831cf7ae21e69c90b3a669b8f434723e9e8b71fd68afe30737b6a5 + languageName: node + linkType: hard + +"http-server@npm:^14.0.1": + version: 14.1.1 + resolution: "http-server@npm:14.1.1" + dependencies: + basic-auth: ^2.0.1 + chalk: ^4.1.2 + corser: ^2.0.1 + he: ^1.2.0 + html-encoding-sniffer: ^3.0.0 + http-proxy: ^1.18.1 + mime: ^1.6.0 + minimist: ^1.2.6 + opener: ^1.5.1 + portfinder: ^1.0.28 + secure-compare: 3.0.1 + union: ~0.5.0 + url-join: ^4.0.1 + bin: + http-server: bin/http-server + checksum: 4f9674289195eaf9f3e408e093d2080b0d4647559a32c9e7868639c327cab62efd0bb8bc9ded9a625d9ce982cbb03517d4472400af5ecf36eeb5b4fa62d113fe + languageName: node + linkType: hard + +"humanize-ms@npm:^1.2.1": + version: 1.2.1 + resolution: "humanize-ms@npm:1.2.1" + dependencies: + ms: ^2.0.0 + checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 + languageName: node + linkType: hard + +"iconv-lite@npm:0.6.3": + version: 0.6.3 + resolution: "iconv-lite@npm:0.6.3" + dependencies: + safer-buffer: ">= 2.1.2 < 3.0.0" + checksum: 3f60d47a5c8fc3313317edfd29a00a692cc87a19cac0159e2ce711d0ebc9019064108323b5e493625e25594f11c6236647d8e256fbe7a58f4a3b33b89e6d30bf + languageName: node + linkType: hard + +"import-local@npm:^3.0.2": + version: 3.1.0 + resolution: "import-local@npm:3.1.0" + dependencies: + pkg-dir: ^4.2.0 + resolve-cwd: ^3.0.0 + bin: + import-local-fixture: fixtures/cli.js + checksum: bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd + languageName: node + linkType: hard + +"interpret@npm:^3.1.1": + version: 3.1.1 + resolution: "interpret@npm:3.1.1" + checksum: 35cebcf48c7351130437596d9ab8c8fe131ce4038da4561e6d665f25640e0034702a031cf7e3a5cea60ac7ac548bf17465e0571ede126f3d3a6933152171ac82 + languageName: node + linkType: hard + +"is-any-array@npm:^2.0.0": + version: 2.0.1 + resolution: "is-any-array@npm:2.0.1" + checksum: 472ed80e17d32951435087951af30c29498b163c31bf723dd5af76545b100bcfac6fad2df3f1a648b45e3b027de8f5dc2389935267ba5258eae85762804b4982 + languageName: node + linkType: hard + +"is-core-module@npm:^2.13.0": + version: 2.14.0 + resolution: "is-core-module@npm:2.14.0" + dependencies: + hasown: ^2.0.2 + checksum: 6bba6c8dc99d88d6f3b2746709d82caddcd9565cafd5870e28ab320720e27e6d9d2bb953ba0839ed4d2ee264bfdd14a9fa1bbc242a916f7dacc8aa95f0322256 + languageName: node + linkType: hard + +"is-plain-object@npm:^2.0.4": + version: 2.0.4 + resolution: "is-plain-object@npm:2.0.4" + dependencies: + isobject: ^3.0.1 + checksum: 2a401140cfd86cabe25214956ae2cfee6fbd8186809555cd0e84574f88de7b17abacb2e477a6a658fa54c6083ecbda1e6ae404c7720244cd198903848fca70ca + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 + languageName: node + linkType: hard + +"isobject@npm:^3.0.1": + version: 3.0.1 + resolution: "isobject@npm:3.0.1" + checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 + languageName: node + linkType: hard + +"jest-worker@npm:^27.4.5": + version: 27.5.1 + resolution: "jest-worker@npm:27.5.1" + dependencies: + "@types/node": "*" + merge-stream: ^2.0.0 + supports-color: ^8.0.0 + checksum: 98cd68b696781caed61c983a3ee30bf880b5bd021c01d98f47b143d4362b85d0737f8523761e2713d45e18b4f9a2b98af1eaee77afade4111bb65c77d6f7c980 + languageName: node + linkType: hard + +"js-tiktoken@npm:^1.0.12": + version: 1.0.12 + resolution: "js-tiktoken@npm:1.0.12" + dependencies: + base64-js: ^1.5.1 + checksum: 07a0e9cd5cb05f304696ac74e76d48f960d62b0443b65f0d09adf79dc903d2fba82d2cff2907491259bbf8b59842c20f89fd1879d2c0249706e7c84507c687fd + languageName: node + linkType: hard + +"js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" + dependencies: + argparse: ^2.0.1 + bin: + js-yaml: bin/js-yaml.js + checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a + languageName: node + linkType: hard + +"json-parse-even-better-errors@npm:^2.3.1": + version: 2.3.1 + resolution: "json-parse-even-better-errors@npm:2.3.1" + checksum: 798ed4cf3354a2d9ccd78e86d2169515a0097a5c133337807cdf7f1fc32e1391d207ccfc276518cc1d7d8d4db93288b8a50ba4293d212ad1336e52a8ec0a941f + languageName: node + linkType: hard + +"json-schema-traverse@npm:^0.4.1": + version: 0.4.1 + resolution: "json-schema-traverse@npm:0.4.1" + checksum: 7486074d3ba247769fda17d5181b345c9fb7d12e0da98b22d1d71a5db9698d8b4bd900a3ec1a4ffdd60846fc2556274a5c894d0c48795f14cb03aeae7b55260b + languageName: node + linkType: hard + +"jsonpointer@npm:^5.0.1": + version: 5.0.1 + resolution: "jsonpointer@npm:5.0.1" + checksum: 0b40f712900ad0c846681ea2db23b6684b9d5eedf55807b4708c656f5894b63507d0e28ae10aa1bddbea551241035afe62b6df0800fc94c2e2806a7f3adecd7c + languageName: node + linkType: hard + +"kind-of@npm:^6.0.2": + version: 6.0.3 + resolution: "kind-of@npm:6.0.3" + checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b + languageName: node + linkType: hard + +"langchain@file:../../../../::locator=chrome_ai%40workspace%3A.": + version: 0.2.7 + resolution: "langchain@file:../../../../#../../../../::hash=8f772d&locator=chrome_ai%40workspace%3A." + dependencies: + "@langchain/core": ~0.2.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.30 + ml-distance: ^4.0.0 + openapi-types: ^12.1.3 + p-retry: 4 + uuid: ^9.0.0 + yaml: ^2.2.1 + zod: ^3.22.4 + zod-to-json-schema: ^3.22.3 + peerDependencies: + "@aws-sdk/client-s3": ^3.310.0 + "@aws-sdk/client-sagemaker-runtime": ^3.310.0 + "@aws-sdk/client-sfn": ^3.310.0 + "@aws-sdk/credential-provider-node": ^3.388.0 + "@azure/storage-blob": ^12.15.0 + "@browserbasehq/sdk": "*" + "@gomomento/sdk": ^1.51.1 + "@gomomento/sdk-core": ^1.51.1 + "@gomomento/sdk-web": ^1.51.1 + "@mendable/firecrawl-js": ^0.0.13 + "@notionhq/client": ^2.2.10 + "@pinecone-database/pinecone": "*" + "@supabase/supabase-js": ^2.10.0 + "@vercel/kv": ^0.2.3 + "@xata.io/client": ^0.28.0 + apify-client: ^2.7.1 + assemblyai: ^4.0.0 + axios: "*" + cheerio: ^1.0.0-rc.12 + chromadb: "*" + convex: ^1.3.1 + couchbase: ^4.3.0 + d3-dsv: ^2.0.0 + epub2: ^3.0.1 + fast-xml-parser: "*" + handlebars: ^4.7.8 + html-to-text: ^9.0.5 + ignore: ^5.2.0 + ioredis: ^5.3.2 + jsdom: "*" + mammoth: ^1.6.0 + mongodb: ">=5.2.0" + node-llama-cpp: "*" + notion-to-md: ^3.1.0 + officeparser: ^4.0.4 + pdf-parse: 1.1.1 + peggy: ^3.0.2 + playwright: ^1.32.1 + puppeteer: ^19.7.2 + pyodide: ^0.24.1 + redis: ^4.6.4 + sonix-speech-recognition: ^2.1.1 + srt-parser-2: ^1.2.3 + typeorm: ^0.3.20 + weaviate-ts-client: "*" + web-auth-library: ^1.0.3 + ws: ^8.14.2 + youtube-transcript: ^1.0.6 + youtubei.js: ^9.1.0 + peerDependenciesMeta: + "@aws-sdk/client-s3": + optional: true + "@aws-sdk/client-sagemaker-runtime": + optional: true + "@aws-sdk/client-sfn": + optional: true + "@aws-sdk/credential-provider-node": + optional: true + "@azure/storage-blob": + optional: true + "@browserbasehq/sdk": + optional: true + "@gomomento/sdk": + optional: true + "@gomomento/sdk-core": + optional: true + "@gomomento/sdk-web": + optional: true + "@mendable/firecrawl-js": + optional: true + "@notionhq/client": + optional: true + "@pinecone-database/pinecone": + optional: true + "@supabase/supabase-js": + optional: true + "@vercel/kv": + optional: true + "@xata.io/client": + optional: true + apify-client: + optional: true + assemblyai: + optional: true + axios: + optional: true + cheerio: + optional: true + chromadb: + optional: true + convex: + optional: true + couchbase: + optional: true + d3-dsv: + optional: true + epub2: + optional: true + faiss-node: + optional: true + fast-xml-parser: + optional: true + handlebars: + optional: true + html-to-text: + optional: true + ignore: + optional: true + ioredis: + optional: true + jsdom: + optional: true + mammoth: + optional: true + mongodb: + optional: true + node-llama-cpp: + optional: true + notion-to-md: + optional: true + officeparser: + optional: true + pdf-parse: + optional: true + peggy: + optional: true + playwright: + optional: true + puppeteer: + optional: true + pyodide: + optional: true + redis: + optional: true + sonix-speech-recognition: + optional: true + srt-parser-2: + optional: true + typeorm: + optional: true + weaviate-ts-client: + optional: true + web-auth-library: + optional: true + ws: + optional: true + youtube-transcript: + optional: true + youtubei.js: + optional: true + checksum: 81cf69fc35fb79ac4df6a1a4510cd28bad10c4a5e9b7a59c53caff1c75673e375ae80b187a84c5ef1e75814dab140fc928f47cc1985f481b93660b4acb9ef7ce + languageName: node + linkType: hard + +"langchainhub@npm:~0.0.8": + version: 0.0.11 + resolution: "langchainhub@npm:0.0.11" + checksum: 511371a6d9f277ddb0425b830afe41b029cf101becfa8ac55c3e7bf3dba2191d13772130b3c3d99f39d25f3bb22345808e0e8ce956296f49c728f8713072ce0b + languageName: node + linkType: hard + +"langsmith@npm:~0.1.30": + version: 0.1.34 + resolution: "langsmith@npm:0.1.34" + dependencies: + "@types/uuid": ^9.0.1 + commander: ^10.0.1 + lodash.set: ^4.3.2 + p-queue: ^6.6.2 + p-retry: 4 + uuid: ^9.0.0 + peerDependencies: + "@langchain/core": "*" + langchain: "*" + openai: "*" + peerDependenciesMeta: + "@langchain/core": + optional: true + langchain: + optional: true + openai: + optional: true + checksum: 6af11fe21fd8724e27ed2f4268c41e17606b699b4107730287e2a369dce12a2c1640203bdc4365b4c461b71bd0df2754d2e4b29ba133e1018f438978b729712b + languageName: node + linkType: hard + +"loader-runner@npm:^4.2.0": + version: 4.3.0 + resolution: "loader-runner@npm:4.3.0" + checksum: a90e00dee9a16be118ea43fec3192d0b491fe03a32ed48a4132eb61d498f5536a03a1315531c19d284392a8726a4ecad71d82044c28d7f22ef62e029bf761569 + languageName: node + linkType: hard + +"locate-path@npm:^5.0.0": + version: 5.0.0 + resolution: "locate-path@npm:5.0.0" + dependencies: + p-locate: ^4.1.0 + checksum: 83e51725e67517287d73e1ded92b28602e3ae5580b301fe54bfb76c0c723e3f285b19252e375712316774cf52006cb236aed5704692c32db0d5d089b69696e30 + languageName: node + linkType: hard + +"lodash.set@npm:^4.3.2": + version: 4.3.2 + resolution: "lodash.set@npm:4.3.2" + checksum: a9122f49eef9f2d0fc9061a33d87f8e5b8c6b23d46e8b9e9ce1529d3588d79741bd1145a3abdfa3b13082703e65af27ff18d8a07bfc22b9be32f3fc36f763f70 + languageName: node + linkType: hard + +"lodash@npm:^4.17.14": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 + languageName: node + linkType: hard + +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 6fa4dcc8d86629705cea944a4b88ef4cb0e07656ebf223fa287443256414283dd25d91c1cd84c77987f2aec5927af1a9db6085757cb43d90eb170ebf4b47f4f4 + languageName: node + linkType: hard + +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + +"mime@npm:^1.6.0": + version: 1.6.0 + resolution: "mime@npm:1.6.0" + bin: + mime: cli.js + checksum: fef25e39263e6d207580bdc629f8872a3f9772c923c7f8c7e793175cee22777bbe8bba95e5d509a40aaa292d8974514ce634ae35769faa45f22d17edda5e8557 + languageName: node + linkType: hard + +"minimist@npm:^1.2.6": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 75a6d645fb122dad29c06a7597bddea977258957ed88d7a6df59b5cd3fe4a527e253e9bbf2e783e4b73657f9098b96a5fe96ab8a113655d4109108577ecf85b0 + languageName: node + linkType: hard + +"mkdirp@npm:^0.5.6": + version: 0.5.6 + resolution: "mkdirp@npm:0.5.6" + dependencies: + minimist: ^1.2.6 + bin: + mkdirp: bin/cmd.js + checksum: 0c91b721bb12c3f9af4b77ebf73604baf350e64d80df91754dc509491ae93bf238581e59c7188360cec7cb62fc4100959245a42cfe01834efedc5e9d068376c2 + languageName: node + linkType: hard + +"ml-array-mean@npm:^1.1.6": + version: 1.1.6 + resolution: "ml-array-mean@npm:1.1.6" + dependencies: + ml-array-sum: ^1.1.6 + checksum: 81999dac8bad3bf2dafb23a9bc71883879b9d55889e48d00b91dd4a2568957a6f5373632ae57324760d1e1d7d29ad45ab4ea7ae32de67ce144d57a21e36dd9c2 + languageName: node + linkType: hard + +"ml-array-sum@npm:^1.1.6": + version: 1.1.6 + resolution: "ml-array-sum@npm:1.1.6" + dependencies: + is-any-array: ^2.0.0 + checksum: 369dbb3681e3f8b0d0facba9fcfc981656dac49a80924859c3ed8f0a5880fb6db2d6e534f8b7b9c3cda59248152e61b27d6419d19c69539de7c3aa6aea3094eb + languageName: node + linkType: hard + +"ml-distance-euclidean@npm:^2.0.0": + version: 2.0.0 + resolution: "ml-distance-euclidean@npm:2.0.0" + checksum: e31f98a947ce6971c35d74e6d2521800f0d219efb34c78b20b5f52debd206008d52e677685c09839e6bab5d2ed233aa009314236e4e548d5fafb60f2f71e2b3e + languageName: node + linkType: hard + +"ml-distance@npm:^4.0.0": + version: 4.0.1 + resolution: "ml-distance@npm:4.0.1" + dependencies: + ml-array-mean: ^1.1.6 + ml-distance-euclidean: ^2.0.0 + ml-tree-similarity: ^1.0.0 + checksum: 21ea014064eb7795c6c8c16e76bb834cba73f9f1ee2f761a3c3c34536f70bd6299b044dd05c495c533f5bdfea7401011dd4bdd159545ef69f5a021f5be4c77a2 + languageName: node + linkType: hard + +"ml-tree-similarity@npm:^1.0.0": + version: 1.0.0 + resolution: "ml-tree-similarity@npm:1.0.0" + dependencies: + binary-search: ^1.3.5 + num-sort: ^2.0.0 + checksum: f99e217dc94acf75c089469dc3c278f388146e43c82212160b6b75daa14309902f84eb0a00c67d502fc79dc171cf15a33d392326e024b2e89881adc585d15513 + languageName: node + linkType: hard + +"ms@npm:^2.0.0, ms@npm:^2.1.1": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d + languageName: node + linkType: hard + +"mustache@npm:^4.2.0": + version: 4.2.0 + resolution: "mustache@npm:4.2.0" + bin: + mustache: bin/mustache + checksum: 928fcb63e3aa44a562bfe9b59ba202cccbe40a46da50be6f0dd831b495be1dd7e38ca4657f0ecab2c1a89dc7bccba0885eab7ee7c1b215830da765758c7e0506 + languageName: node + linkType: hard + +"neo-async@npm:^2.6.2": + version: 2.6.2 + resolution: "neo-async@npm:2.6.2" + checksum: deac9f8d00eda7b2e5cd1b2549e26e10a0faa70adaa6fdadca701cc55f49ee9018e427f424bac0c790b7c7e2d3068db97f3093f1093975f2acb8f8818b936ed9 + languageName: node + linkType: hard + +"node-domexception@npm:1.0.0": + version: 1.0.0 + resolution: "node-domexception@npm:1.0.0" + checksum: ee1d37dd2a4eb26a8a92cd6b64dfc29caec72bff5e1ed9aba80c294f57a31ba4895a60fd48347cf17dd6e766da0ae87d75657dfd1f384ebfa60462c2283f5c7f + languageName: node + linkType: hard + +"node-fetch@npm:^2.6.7": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" + dependencies: + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 + languageName: node + linkType: hard + +"node-releases@npm:^2.0.14": + version: 2.0.14 + resolution: "node-releases@npm:2.0.14" + checksum: 59443a2f77acac854c42d321bf1b43dea0aef55cd544c6a686e9816a697300458d4e82239e2d794ea05f7bbbc8a94500332e2d3ac3f11f52e4b16cbe638b3c41 + languageName: node + linkType: hard + +"num-sort@npm:^2.0.0": + version: 2.1.0 + resolution: "num-sort@npm:2.1.0" + checksum: 5a80cd0456c8847f71fb80ad3c3596714cebede76de585aa4fed2b9a4fb0907631edca1f7bb31c24dbb9928b66db3d03059994cc365d2ae011b80ddddac28f6e + languageName: node + linkType: hard + +"object-inspect@npm:^1.13.1": + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 9f850b3c045db60e0e97746e809ee4090d6ce62195af17dd1e9438ac761394a7d8ec4f7906559aea5424eaf61e35d3e53feded2ccd5f62fcc7d9670d3c8eb353 + languageName: node + linkType: hard + +"openai@npm:^4.49.1": + version: 4.52.1 + resolution: "openai@npm:4.52.1" + 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 + bin: + openai: bin/cli + checksum: ba23030819f0fbcf20ebc60993800413d43963f7006af791767a7ce5eb9a63fe2f973c2b375d593f2beb3289b30215d871ca39b2d0a4b8f10e07a60eeaa66214 + languageName: node + linkType: hard + +"openapi-types@npm:^12.1.3": + version: 12.1.3 + resolution: "openapi-types@npm:12.1.3" + checksum: 7fa5547f87a58d2aa0eba6e91d396f42d7d31bc3ae140e61b5d60b47d2fd068b48776f42407d5a8da7280cf31195aa128c2fc285e8bb871d1105edee5647a0bb + languageName: node + linkType: hard + +"opener@npm:^1.5.1": + version: 1.5.2 + resolution: "opener@npm:1.5.2" + bin: + opener: bin/opener-bin.js + checksum: 33b620c0d53d5b883f2abc6687dd1c5fd394d270dbe33a6356f2d71e0a2ec85b100d5bac94694198ccf5c30d592da863b2292c5539009c715a9c80c697b4f6cc + languageName: node + linkType: hard + +"p-finally@npm:^1.0.0": + version: 1.0.0 + resolution: "p-finally@npm:1.0.0" + checksum: 93a654c53dc805dd5b5891bab16eb0ea46db8f66c4bfd99336ae929323b1af2b70a8b0654f8f1eae924b2b73d037031366d645f1fd18b3d30cbd15950cc4b1d4 + languageName: node + linkType: hard + +"p-limit@npm:^2.2.0": + version: 2.3.0 + resolution: "p-limit@npm:2.3.0" + dependencies: + p-try: ^2.0.0 + checksum: 84ff17f1a38126c3314e91ecfe56aecbf36430940e2873dadaa773ffe072dc23b7af8e46d4b6485d302a11673fe94c6b67ca2cfbb60c989848b02100d0594ac1 + languageName: node + linkType: hard + +"p-locate@npm:^4.1.0": + version: 4.1.0 + resolution: "p-locate@npm:4.1.0" + dependencies: + p-limit: ^2.2.0 + checksum: 513bd14a455f5da4ebfcb819ef706c54adb09097703de6aeaa5d26fe5ea16df92b48d1ac45e01e3944ce1e6aa2a66f7f8894742b8c9d6e276e16cd2049a2b870 + languageName: node + linkType: hard + +"p-queue@npm:^6.6.2": + version: 6.6.2 + resolution: "p-queue@npm:6.6.2" + dependencies: + eventemitter3: ^4.0.4 + p-timeout: ^3.2.0 + checksum: 832642fcc4ab6477b43e6d7c30209ab10952969ed211c6d6f2931be8a4f9935e3578c72e8cce053dc34f2eb6941a408a2c516a54904e989851a1a209cf19761c + languageName: node + linkType: hard + +"p-retry@npm:4": + version: 4.6.2 + resolution: "p-retry@npm:4.6.2" + dependencies: + "@types/retry": 0.12.0 + retry: ^0.13.1 + checksum: 45c270bfddaffb4a895cea16cb760dcc72bdecb6cb45fef1971fa6ea2e91ddeafddefe01e444ac73e33b1b3d5d29fb0dd18a7effb294262437221ddc03ce0f2e + languageName: node + linkType: hard + +"p-timeout@npm:^3.2.0": + version: 3.2.0 + resolution: "p-timeout@npm:3.2.0" + dependencies: + p-finally: ^1.0.0 + checksum: 3dd0eaa048780a6f23e5855df3dd45c7beacff1f820476c1d0d1bcd6648e3298752ba2c877aa1c92f6453c7dd23faaf13d9f5149fc14c0598a142e2c5e8d649c + languageName: node + linkType: hard + +"p-try@npm:^2.0.0": + version: 2.2.0 + resolution: "p-try@npm:2.2.0" + checksum: f8a8e9a7693659383f06aec604ad5ead237c7a261c18048a6e1b5b85a5f8a067e469aa24f5bc009b991ea3b058a87f5065ef4176793a200d4917349881216cae + languageName: node + linkType: hard + +"path-exists@npm:^4.0.0": + version: 4.0.0 + resolution: "path-exists@npm:4.0.0" + checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 + languageName: node + linkType: hard + +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + +"path-parse@npm:^1.0.7": + version: 1.0.7 + resolution: "path-parse@npm:1.0.7" + checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a + languageName: node + linkType: hard + +"picocolors@npm:^1.0.1": + version: 1.0.1 + resolution: "picocolors@npm:1.0.1" + checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 + languageName: node + linkType: hard + +"pkg-dir@npm:^4.2.0": + version: 4.2.0 + resolution: "pkg-dir@npm:4.2.0" + dependencies: + find-up: ^4.0.0 + checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 + languageName: node + linkType: hard + +"portfinder@npm:^1.0.28": + version: 1.0.32 + resolution: "portfinder@npm:1.0.32" + dependencies: + async: ^2.6.4 + debug: ^3.2.7 + mkdirp: ^0.5.6 + checksum: 116b4aed1b9e16f6d5503823d966d9ffd41b1c2339e27f54c06cd2f3015a9d8ef53e2a53b57bc0a25af0885977b692007353aa28f9a0a98a44335cb50487240d + languageName: node + linkType: hard + +"punycode@npm:^2.1.0": + version: 2.3.1 + resolution: "punycode@npm:2.3.1" + checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2 + languageName: node + linkType: hard + +"qs@npm:^6.4.0": + version: 6.12.1 + resolution: "qs@npm:6.12.1" + dependencies: + side-channel: ^1.0.6 + checksum: aa761d99e65b6936ba2dd2187f2d9976afbcda38deb3ff1b3fe331d09b0c578ed79ca2abdde1271164b5be619c521ec7db9b34c23f49a074e5921372d16242d5 + languageName: node + linkType: hard + +"randombytes@npm:^2.1.0": + version: 2.1.0 + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: ^5.1.0 + checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 + languageName: node + linkType: hard + +"rechoir@npm:^0.8.0": + version: 0.8.0 + resolution: "rechoir@npm:0.8.0" + dependencies: + resolve: ^1.20.0 + checksum: ad3caed8afdefbc33fbc30e6d22b86c35b3d51c2005546f4e79bcc03c074df804b3640ad18945e6bef9ed12caedc035655ec1082f64a5e94c849ff939dc0a788 + languageName: node + linkType: hard + +"requires-port@npm:^1.0.0": + version: 1.0.0 + resolution: "requires-port@npm:1.0.0" + checksum: eee0e303adffb69be55d1a214e415cf42b7441ae858c76dfc5353148644f6fd6e698926fc4643f510d5c126d12a705e7c8ed7e38061113bdf37547ab356797ff + languageName: node + linkType: hard + +"resolve-cwd@npm:^3.0.0": + version: 3.0.0 + resolution: "resolve-cwd@npm:3.0.0" + dependencies: + resolve-from: ^5.0.0 + checksum: 546e0816012d65778e580ad62b29e975a642989108d9a3c5beabfb2304192fa3c9f9146fbdfe213563c6ff51975ae41bac1d3c6e047dd9572c94863a057b4d81 + languageName: node + linkType: hard + +"resolve-from@npm:^5.0.0": + version: 5.0.0 + resolution: "resolve-from@npm:5.0.0" + checksum: 4ceeb9113e1b1372d0cd969f3468fa042daa1dd9527b1b6bb88acb6ab55d8b9cd65dbf18819f9f9ddf0db804990901dcdaade80a215e7b2c23daae38e64f5bdf + languageName: node + linkType: hard + +"resolve@npm:^1.20.0": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c + languageName: node + linkType: hard + +"resolve@patch:resolve@^1.20.0#~builtin": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 + languageName: node + linkType: hard + +"retry@npm:^0.13.1": + version: 0.13.1 + resolution: "retry@npm:0.13.1" + checksum: 47c4d5be674f7c13eee4cfe927345023972197dbbdfba5d3af7e461d13b44de1bfd663bfc80d2f601f8ef3fc8164c16dd99655a221921954a65d044a2fc1233b + languageName: node + linkType: hard + +"safe-buffer@npm:5.1.2": + version: 5.1.2 + resolution: "safe-buffer@npm:5.1.2" + checksum: f2f1f7943ca44a594893a852894055cf619c1fbcb611237fc39e461ae751187e7baf4dc391a72125e0ac4fb2d8c5c0b3c71529622e6a58f46b960211e704903c + languageName: node + linkType: hard + +"safe-buffer@npm:^5.1.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 + languageName: node + linkType: hard + +"safer-buffer@npm:>= 2.1.2 < 3.0.0": + version: 2.1.2 + resolution: "safer-buffer@npm:2.1.2" + checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 + languageName: node + linkType: hard + +"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": + version: 3.3.0 + resolution: "schema-utils@npm:3.3.0" + dependencies: + "@types/json-schema": ^7.0.8 + ajv: ^6.12.5 + ajv-keywords: ^3.5.2 + checksum: ea56971926fac2487f0757da939a871388891bc87c6a82220d125d587b388f1704788f3706e7f63a7b70e49fc2db974c41343528caea60444afd5ce0fe4b85c0 + languageName: node + linkType: hard + +"secure-compare@npm:3.0.1": + version: 3.0.1 + resolution: "secure-compare@npm:3.0.1" + checksum: 0a8d8d3e54d5772d2cf1c02325f01fc7366d0bd33f964a08a84fe3ee5f34d46435a6ae729c1d239c750e160ef9b58c764d3efb945a1d07faf47978a8e4161594 + languageName: node + linkType: hard + +"serialize-javascript@npm:^6.0.1": + version: 6.0.2 + resolution: "serialize-javascript@npm:6.0.2" + dependencies: + randombytes: ^2.1.0 + checksum: c4839c6206c1d143c0f80763997a361310305751171dd95e4b57efee69b8f6edd8960a0b7fbfc45042aadff98b206d55428aee0dc276efe54f100899c7fa8ab7 + languageName: node + linkType: hard + +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: ^1.1.4 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.2 + checksum: a8248bdacdf84cb0fab4637774d9fb3c7a8e6089866d04c817583ff48e14149c87044ce683d7f50759a8c50fb87c7a7e173535b06169c87ef76f5fb276dfff72 + languageName: node + linkType: hard + +"shallow-clone@npm:^3.0.0": + version: 3.0.1 + resolution: "shallow-clone@npm:3.0.1" + dependencies: + kind-of: ^6.0.2 + checksum: 39b3dd9630a774aba288a680e7d2901f5c0eae7b8387fc5c8ea559918b29b3da144b7bdb990d7ccd9e11be05508ac9e459ce51d01fd65e583282f6ffafcba2e7 + languageName: node + linkType: hard + +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + +"side-channel@npm:^1.0.6": + version: 1.0.6 + resolution: "side-channel@npm:1.0.6" + dependencies: + call-bind: ^1.0.7 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.4 + object-inspect: ^1.13.1 + checksum: bfc1afc1827d712271453e91b7cd3878ac0efd767495fd4e594c4c2afaa7963b7b510e249572bfd54b0527e66e4a12b61b80c061389e129755f34c493aad9b97 + languageName: node + linkType: hard + +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: ^1.0.0 + source-map: ^0.6.0 + checksum: 43e98d700d79af1d36f859bdb7318e601dfc918c7ba2e98456118ebc4c4872b327773e5a1df09b0524e9e5063bb18f0934538eace60cca2710d1fa687645d137 + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2 + languageName: node + linkType: hard + +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: ^4.0.0 + checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + languageName: node + linkType: hard + +"supports-color@npm:^8.0.0": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + +"supports-preserve-symlinks-flag@npm:^1.0.0": + version: 1.0.0 + resolution: "supports-preserve-symlinks-flag@npm:1.0.0" + checksum: 53b1e247e68e05db7b3808b99b892bd36fb096e6fba213a06da7fab22045e97597db425c724f2bbd6c99a3c295e1e73f3e4de78592289f38431049e1277ca0ae + languageName: node + linkType: hard + +"tapable@npm:^2.1.1, tapable@npm:^2.2.0": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + +"terser-webpack-plugin@npm:^5.3.10": + version: 5.3.10 + resolution: "terser-webpack-plugin@npm:5.3.10" + dependencies: + "@jridgewell/trace-mapping": ^0.3.20 + jest-worker: ^27.4.5 + schema-utils: ^3.1.1 + serialize-javascript: ^6.0.1 + terser: ^5.26.0 + peerDependencies: + webpack: ^5.1.0 + peerDependenciesMeta: + "@swc/core": + optional: true + esbuild: + optional: true + uglify-js: + optional: true + checksum: bd6e7596cf815f3353e2a53e79cbdec959a1b0276f5e5d4e63e9d7c3c5bb5306df567729da287d1c7b39d79093e56863c569c42c6c24cc34c76aa313bd2cbcea + languageName: node + linkType: hard + +"terser@npm:^5.26.0": + version: 5.31.1 + resolution: "terser@npm:5.31.1" + dependencies: + "@jridgewell/source-map": ^0.3.3 + acorn: ^8.8.2 + commander: ^2.20.0 + source-map-support: ~0.5.20 + bin: + terser: bin/terser + checksum: 6ab57e62e9cd690dc99b3d0ee2e07289cd3408109a950c7118bf39e32851a5bf08b67fe19e0ac43a5a98813792ac78101bf25e5aa524f05ae8bb4e0131d0feef + languageName: node + linkType: hard + +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487 + languageName: node + linkType: hard + +"union@npm:~0.5.0": + version: 0.5.0 + resolution: "union@npm:0.5.0" + dependencies: + qs: ^6.4.0 + checksum: 021530d02363fb7470ce45d4cb06ae28a97d5a245666e6d0fca6bab0673bea8c7988e7d2f8046acfbab120908cedcb099ca216b357d4483bcd96518b39101be0 + languageName: node + linkType: hard + +"update-browserslist-db@npm:^1.0.16": + version: 1.0.16 + resolution: "update-browserslist-db@npm:1.0.16" + dependencies: + escalade: ^3.1.2 + picocolors: ^1.0.1 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 51b1f7189c9ea5925c80154b0a6fd3ec36106d07858d8f69826427d8edb4735d1801512c69eade38ba0814d7407d11f400d74440bbf3da0309f3d788017f35b2 + languageName: node + linkType: hard + +"uri-js@npm:^4.2.2": + version: 4.4.1 + resolution: "uri-js@npm:4.4.1" + dependencies: + punycode: ^2.1.0 + checksum: 7167432de6817fe8e9e0c9684f1d2de2bb688c94388f7569f7dbdb1587c9f4ca2a77962f134ec90be0cc4d004c939ff0d05acc9f34a0db39a3c797dada262633 + languageName: node + linkType: hard + +"url-join@npm:^4.0.1": + version: 4.0.1 + resolution: "url-join@npm:4.0.1" + checksum: f74e868bf25dbc8be6a8d7237d4c36bb5b6c62c72e594d5ab1347fe91d6af7ccd9eb5d621e30152e4da45c2e9a26bec21390e911ab54a62d4d82e76028374ee5 + languageName: node + linkType: hard + +"uuid@npm:^9.0.0": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + +"watchpack@npm:^2.4.1": + version: 2.4.1 + resolution: "watchpack@npm:2.4.1" + dependencies: + glob-to-regexp: ^0.4.1 + graceful-fs: ^4.1.2 + checksum: 5b0179348655dcdf19cac7cb4ff923fdc024d630650c0bf6bec8899cf47c60e19d4f810a88dba692ed0e7f684cf0fcffea86efdbf6c35d81f031e328043b7fab + languageName: node + linkType: hard + +"web-streams-polyfill@npm:4.0.0-beta.3": + version: 4.0.0-beta.3 + resolution: "web-streams-polyfill@npm:4.0.0-beta.3" + checksum: dfec1fbf52b9140e4183a941e380487b6c3d5d3838dd1259be81506c1c9f2abfcf5aeb670aeeecfd9dff4271a6d8fef931b193c7bedfb42542a3b05ff36c0d16 + languageName: node + linkType: hard + +"web-streams-polyfill@npm:^3.2.1": + version: 3.3.3 + resolution: "web-streams-polyfill@npm:3.3.3" + checksum: 21ab5ea08a730a2ef8023736afe16713b4f2023ec1c7085c16c8e293ee17ed085dff63a0ad8722da30c99c4ccbd4ccd1b2e79c861829f7ef2963d7de7004c2cb + languageName: node + linkType: hard + +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"webpack-cli@npm:^5.1.4": + version: 5.1.4 + resolution: "webpack-cli@npm:5.1.4" + dependencies: + "@discoveryjs/json-ext": ^0.5.0 + "@webpack-cli/configtest": ^2.1.1 + "@webpack-cli/info": ^2.0.2 + "@webpack-cli/serve": ^2.0.5 + colorette: ^2.0.14 + commander: ^10.0.1 + cross-spawn: ^7.0.3 + envinfo: ^7.7.3 + fastest-levenshtein: ^1.0.12 + import-local: ^3.0.2 + interpret: ^3.1.1 + rechoir: ^0.8.0 + webpack-merge: ^5.7.3 + peerDependencies: + webpack: 5.x.x + peerDependenciesMeta: + "@webpack-cli/generators": + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + bin: + webpack-cli: bin/cli.js + checksum: 3a4ad0d0342a6815c850ee4633cc2a8a5dae04f918e7847f180bf24ab400803cf8a8943707ffbed03eb20fe6ce647f996f60a2aade87b0b4a9954da3da172ce0 + languageName: node + linkType: hard + +"webpack-merge@npm:^5.7.3": + version: 5.10.0 + resolution: "webpack-merge@npm:5.10.0" + dependencies: + clone-deep: ^4.0.1 + flat: ^5.0.2 + wildcard: ^2.0.0 + checksum: 1fe8bf5309add7298e1ac72fb3f2090e1dfa80c48c7e79fa48aa60b5961332c7d0d61efa8851acb805e6b91a4584537a347bc106e05e9aec87fa4f7088c62f2f + languageName: node + linkType: hard + +"webpack-sources@npm:^3.2.3": + version: 3.2.3 + resolution: "webpack-sources@npm:3.2.3" + checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 + languageName: node + linkType: hard + +"webpack@npm:^5.92.1": + version: 5.92.1 + resolution: "webpack@npm:5.92.1" + dependencies: + "@types/eslint-scope": ^3.7.3 + "@types/estree": ^1.0.5 + "@webassemblyjs/ast": ^1.12.1 + "@webassemblyjs/wasm-edit": ^1.12.1 + "@webassemblyjs/wasm-parser": ^1.12.1 + acorn: ^8.7.1 + acorn-import-attributes: ^1.9.5 + browserslist: ^4.21.10 + chrome-trace-event: ^1.0.2 + enhanced-resolve: ^5.17.0 + es-module-lexer: ^1.2.1 + eslint-scope: 5.1.1 + events: ^3.2.0 + glob-to-regexp: ^0.4.1 + graceful-fs: ^4.2.11 + json-parse-even-better-errors: ^2.3.1 + loader-runner: ^4.2.0 + mime-types: ^2.1.27 + neo-async: ^2.6.2 + schema-utils: ^3.2.0 + tapable: ^2.1.1 + terser-webpack-plugin: ^5.3.10 + watchpack: ^2.4.1 + webpack-sources: ^3.2.3 + peerDependenciesMeta: + webpack-cli: + optional: true + bin: + webpack: bin/webpack.js + checksum: 11bec781260c4180883e98a4a15a08df297aca654ded45e70598f688881dd722f992d680addafe6f6342debede345cddcce2b781c50f5cde29d6c0bc33a82452 + languageName: node + linkType: hard + +"whatwg-encoding@npm:^2.0.0": + version: 2.0.0 + resolution: "whatwg-encoding@npm:2.0.0" + dependencies: + iconv-lite: 0.6.3 + checksum: 7087810c410aa9b689cbd6af8773341a53cdc1f3aae2a882c163bd5522ec8ca4cdfc269aef417a5792f411807d5d77d50df4c24e3abb00bb60192858a40cc675 + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: ~0.0.3 + webidl-conversions: ^3.0.0 + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + +"which@npm:^2.0.1": + version: 2.0.2 + resolution: "which@npm:2.0.2" + dependencies: + isexe: ^2.0.0 + bin: + node-which: ./bin/node-which + checksum: 1a5c563d3c1b52d5f893c8b61afe11abc3bab4afac492e8da5bde69d550de701cf9806235f20a47b5c8fa8a1d6a9135841de2596535e998027a54589000e66d1 + languageName: node + linkType: hard + +"wildcard@npm:^2.0.0": + version: 2.0.1 + resolution: "wildcard@npm:2.0.1" + checksum: e0c60a12a219e4b12065d1199802d81c27b841ed6ad6d9d28240980c73ceec6f856771d575af367cbec2982d9ae7838759168b551776577f155044f5a5ba843c + languageName: node + linkType: hard + +"yaml@npm:^2.2.1": + version: 2.4.5 + resolution: "yaml@npm:2.4.5" + bin: + yaml: bin.mjs + checksum: f8efd407c07e095f00f3031108c9960b2b12971d10162b1ec19007200f6c987d2e28f73283f4731119aa610f177a3ea03d4a8fcf640600a25de1b74d00c69b3d + languageName: node + linkType: hard + +"zod-to-json-schema@npm:^3.22.3": + version: 3.23.1 + resolution: "zod-to-json-schema@npm:3.23.1" + peerDependencies: + zod: ^3.23.3 + checksum: bbb0fdd8d28179c912d2d1c93051e418fc933288b8ac3704e7a514498fadf7781a8417aa9d52129a6a89ed5bc5a59793d3739c4869aa38600743cb009b52856d + languageName: node + linkType: hard + +"zod@npm:^3.22.4": + version: 3.23.8 + resolution: "zod@npm:3.23.8" + checksum: 15949ff82118f59c893dacd9d3c766d02b6fa2e71cf474d5aa888570c469dbf5446ac5ad562bb035bf7ac9650da94f290655c194f4a6de3e766f43febd432c5c + languageName: node + linkType: hard diff --git a/libs/langchain-community/src/chat_models/chrome_ai.ts b/langchain/src/experimental/chrome_ai/chat_models.ts similarity index 97% rename from libs/langchain-community/src/chat_models/chrome_ai.ts rename to langchain/src/experimental/chrome_ai/chat_models.ts index fca4c36a7b0e..05251a2bc24b 100644 --- a/libs/langchain-community/src/chat_models/chrome_ai.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -25,7 +25,7 @@ export interface AITextSessionOptions { temperature: number; } -export enum AIModelAvailability { +export const enum AIModelAvailability { Readily = "readily", AfterDownload = "after-download", No = "no", @@ -46,9 +46,7 @@ function formatPrompt(messages: BaseMessage[]): string { "ChatChromeAI does not support non-string message content." ); } - return `<${message._getType()}>\n${ - message.content - }\n`; + return `${message._getType()}: ${message.content}`; }) .join("\n"); } diff --git a/langchain/src/load/import_map.ts b/langchain/src/load/import_map.ts index 115793fcac92..69f3fe8fac5c 100644 --- a/langchain/src/load/import_map.ts +++ b/langchain/src/load/import_map.ts @@ -59,6 +59,7 @@ export * as experimental__babyagi from "../experimental/babyagi/index.js"; export * as experimental__generative_agents from "../experimental/generative_agents/index.js"; export * as experimental__plan_and_execute from "../experimental/plan_and_execute/index.js"; export * as experimental__chains__violation_of_expectations from "../experimental/chains/violation_of_expectations/index.js"; +export * as experimental__chat_models__chrome_ai from "../experimental/chrome_ai/chat_models.js"; export * as experimental__masking from "../experimental/masking/index.js"; export * as experimental__prompts__custom_format from "../experimental/prompts/custom_format.js"; export * as evaluation from "../evaluation/index.js"; diff --git a/libs/langchain-community/src/chat_models/tests/chrome_ai.html b/libs/langchain-community/src/chat_models/tests/chrome_ai.html deleted file mode 100644 index d9c7bbb1c87b..000000000000 --- a/libs/langchain-community/src/chat_models/tests/chrome_ai.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - ChatChromeAI Example - - -

ChatChromeAI Example

- -
-
-
- -
- - - - From 2d9303bc576d7261d5fe7f07ce67d3d4e54c735e Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:47:13 -0700 Subject: [PATCH 05/15] chore: lint files --- .../src/experimental/chrome_ai/app/README.md | 2 +- .../chrome_ai/app/src/chrome_ai.html | 36 ++++++++++++++----- .../experimental/chrome_ai/app/src/index.js | 12 +++++-- .../chrome_ai/app/webpack.config.js | 12 +++---- .../src/experimental/chrome_ai/chat_models.ts | 2 +- 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/langchain/src/experimental/chrome_ai/app/README.md b/langchain/src/experimental/chrome_ai/app/README.md index 9ec6cd46f989..aa0cc34642b3 100644 --- a/langchain/src/experimental/chrome_ai/app/README.md +++ b/langchain/src/experimental/chrome_ai/app/README.md @@ -19,4 +19,4 @@ yarn install # install the dependencies yarn start # start the application ``` -Then, open your browser and navigate to [`http://127.0.0.1:8080/src/chrome_ai.html`](http://127.0.0.1:8080/src/chrome_ai.html). \ No newline at end of file +Then, open your browser and navigate to [`http://127.0.0.1:8080/src/chrome_ai.html`](http://127.0.0.1:8080/src/chrome_ai.html). diff --git a/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html b/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html index 045b2f161328..f08f7131e587 100644 --- a/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html +++ b/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html @@ -15,7 +15,7 @@ text-align: center; } button { - background-color: #4CAF50; + background-color: #4caf50; border: none; color: white; padding: 10px 20px; @@ -34,7 +34,7 @@ background-color: white; padding: 20px; border-radius: 8px; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } input[type="text"] { width: 100%; @@ -48,7 +48,7 @@ background-color: white; padding: 20px; border-radius: 8px; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin-top: 20px; } .stats { @@ -71,7 +71,12 @@

LangChain.js🦜🔗 - ChatChromeAI Example


-
+
@@ -79,13 +84,28 @@

LangChain.js🦜🔗 - ChatChromeAI Example

- First Token: -- ms - Total Time: -- ms - Total Tokens: -- + First Token: -- ms + Total Time: -- ms + Total Tokens: --
- \ No newline at end of file + diff --git a/langchain/src/experimental/chrome_ai/app/src/index.js b/langchain/src/experimental/chrome_ai/app/src/index.js index 2177722979ed..2ceea0ad2e24 100644 --- a/langchain/src/experimental/chrome_ai/app/src/index.js +++ b/langchain/src/experimental/chrome_ai/app/src/index.js @@ -59,7 +59,13 @@ inputForm.addEventListener("submit", async (event) => { console.log(`First Token: ${Math.round(timeToFirstTokenMs)} ms`); console.log(`Total Time: ${Math.round(totalTimeMs)} ms`); console.log(`Total Tokens: ${numTokens}`); - document.getElementById("firstTokenTime").textContent = `First Token: ${Math.round(timeToFirstTokenMs)} ms`; - document.getElementById("totalTime").textContent = `Total Time: ${Math.round(totalTimeMs)} ms`; - document.getElementById("totalTokens").textContent = `Total Tokens: ${numTokens}`; + document.getElementById( + "firstTokenTime" + ).textContent = `First Token: ${Math.round(timeToFirstTokenMs)} ms`; + document.getElementById("totalTime").textContent = `Total Time: ${Math.round( + totalTimeMs + )} ms`; + document.getElementById( + "totalTokens" + ).textContent = `Total Tokens: ${numTokens}`; }); diff --git a/langchain/src/experimental/chrome_ai/app/webpack.config.js b/langchain/src/experimental/chrome_ai/app/webpack.config.js index 5f8d3209edd2..b61b991f68b1 100644 --- a/langchain/src/experimental/chrome_ai/app/webpack.config.js +++ b/langchain/src/experimental/chrome_ai/app/webpack.config.js @@ -1,10 +1,10 @@ -const path = require('path'); +const path = require("path"); module.exports = { - entry: './src/index.js', + entry: "./src/index.js", output: { - filename: 'bundle.js', - path: path.resolve(__dirname, 'dist'), + filename: "bundle.js", + path: path.resolve(__dirname, "dist"), }, - mode: 'development', -}; \ No newline at end of file + mode: "development", +}; diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/langchain/src/experimental/chrome_ai/chat_models.ts index 05251a2bc24b..0b83a5c11548 100644 --- a/langchain/src/experimental/chrome_ai/chat_models.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -99,7 +99,7 @@ export class ChatChromeAI extends SimpleChatModel { throw new Error("ChatChromeAI can only be used in the browser."); } - const ai: AI = (window as any).ai; + const {ai} = window as any; const canCreateTextSession = await ai.canCreateTextSession(); if (canCreateTextSession === AIModelAvailability.No) { throw new Error("The AI model is not available."); From a9eb87a6bd7380b8cb5db4e32ff3fe9d7ef528b5 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:47:58 -0700 Subject: [PATCH 06/15] cr --- libs/langchain-community/.gitignore | 4 ---- libs/langchain-community/chat_models/chrome_ai.cjs | 1 + .../langchain-community/chat_models/chrome_ai.d.cts | 1 + libs/langchain-community/chat_models/chrome_ai.d.ts | 1 + libs/langchain-community/chat_models/chrome_ai.js | 1 + libs/langchain-community/langchain.config.js | 1 - libs/langchain-community/package.json | 13 ------------- libs/langchain-community/src/load/import_map.ts | 1 - 8 files changed, 4 insertions(+), 19 deletions(-) create mode 100644 libs/langchain-community/chat_models/chrome_ai.cjs create mode 100644 libs/langchain-community/chat_models/chrome_ai.d.cts create mode 100644 libs/langchain-community/chat_models/chrome_ai.d.ts create mode 100644 libs/langchain-community/chat_models/chrome_ai.js diff --git a/libs/langchain-community/.gitignore b/libs/langchain-community/.gitignore index 018fa12549f4..4246a650f6df 100644 --- a/libs/langchain-community/.gitignore +++ b/libs/langchain-community/.gitignore @@ -518,10 +518,6 @@ chat_models/cloudflare_workersai.cjs chat_models/cloudflare_workersai.js chat_models/cloudflare_workersai.d.ts chat_models/cloudflare_workersai.d.cts -chat_models/chrome_ai.cjs -chat_models/chrome_ai.js -chat_models/chrome_ai.d.ts -chat_models/chrome_ai.d.cts chat_models/deepinfra.cjs chat_models/deepinfra.js chat_models/deepinfra.d.ts diff --git a/libs/langchain-community/chat_models/chrome_ai.cjs b/libs/langchain-community/chat_models/chrome_ai.cjs new file mode 100644 index 000000000000..2a0c111f92e4 --- /dev/null +++ b/libs/langchain-community/chat_models/chrome_ai.cjs @@ -0,0 +1 @@ +module.exports = require('../dist/chat_models/chrome_ai.cjs'); \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.d.cts b/libs/langchain-community/chat_models/chrome_ai.d.cts new file mode 100644 index 000000000000..40caf3c9f60f --- /dev/null +++ b/libs/langchain-community/chat_models/chrome_ai.d.cts @@ -0,0 +1 @@ +export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.d.ts b/libs/langchain-community/chat_models/chrome_ai.d.ts new file mode 100644 index 000000000000..40caf3c9f60f --- /dev/null +++ b/libs/langchain-community/chat_models/chrome_ai.d.ts @@ -0,0 +1 @@ +export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.js b/libs/langchain-community/chat_models/chrome_ai.js new file mode 100644 index 000000000000..40caf3c9f60f --- /dev/null +++ b/libs/langchain-community/chat_models/chrome_ai.js @@ -0,0 +1 @@ +export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file diff --git a/libs/langchain-community/langchain.config.js b/libs/langchain-community/langchain.config.js index 21ff77dcb69c..7012d8e06c5a 100644 --- a/libs/langchain-community/langchain.config.js +++ b/libs/langchain-community/langchain.config.js @@ -166,7 +166,6 @@ export const config = { "chat_models/bedrock": "chat_models/bedrock/index", "chat_models/bedrock/web": "chat_models/bedrock/web", "chat_models/cloudflare_workersai": "chat_models/cloudflare_workersai", - "chat_models/chrome_ai": "chat_models/chrome_ai", "chat_models/deepinfra": "chat_models/deepinfra", "chat_models/fireworks": "chat_models/fireworks", "chat_models/friendli": "chat_models/friendli", diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index 1c499d0f6fb0..3ef6acbe7890 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -1870,15 +1870,6 @@ "import": "./chat_models/cloudflare_workersai.js", "require": "./chat_models/cloudflare_workersai.cjs" }, - "./chat_models/chrome_ai": { - "types": { - "import": "./chat_models/chrome_ai.d.ts", - "require": "./chat_models/chrome_ai.d.cts", - "default": "./chat_models/chrome_ai.d.ts" - }, - "import": "./chat_models/chrome_ai.js", - "require": "./chat_models/chrome_ai.cjs" - }, "./chat_models/deepinfra": { "types": { "import": "./chat_models/deepinfra.d.ts", @@ -3564,10 +3555,6 @@ "chat_models/cloudflare_workersai.js", "chat_models/cloudflare_workersai.d.ts", "chat_models/cloudflare_workersai.d.cts", - "chat_models/chrome_ai.cjs", - "chat_models/chrome_ai.js", - "chat_models/chrome_ai.d.ts", - "chat_models/chrome_ai.d.cts", "chat_models/deepinfra.cjs", "chat_models/deepinfra.js", "chat_models/deepinfra.d.ts", diff --git a/libs/langchain-community/src/load/import_map.ts b/libs/langchain-community/src/load/import_map.ts index 907dcc90ed59..d06053cbde26 100644 --- a/libs/langchain-community/src/load/import_map.ts +++ b/libs/langchain-community/src/load/import_map.ts @@ -46,7 +46,6 @@ export * as vectorstores__vectara from "../vectorstores/vectara.js"; export * as chat_models__alibaba_tongyi from "../chat_models/alibaba_tongyi.js"; export * as chat_models__baiduwenxin from "../chat_models/baiduwenxin.js"; export * as chat_models__cloudflare_workersai from "../chat_models/cloudflare_workersai.js"; -export * as chat_models__chrome_ai from "../chat_models/chrome_ai.js"; export * as chat_models__deepinfra from "../chat_models/deepinfra.js"; export * as chat_models__fireworks from "../chat_models/fireworks.js"; export * as chat_models__friendli from "../chat_models/friendli.js"; From a3e0c251e0301000afa5f7d41f1c32284ecc656c Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:48:56 -0700 Subject: [PATCH 07/15] cr --- langchain/src/experimental/chrome_ai/app/src/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/langchain/src/experimental/chrome_ai/app/src/index.js b/langchain/src/experimental/chrome_ai/app/src/index.js index 2ceea0ad2e24..9c1197736f47 100644 --- a/langchain/src/experimental/chrome_ai/app/src/index.js +++ b/langchain/src/experimental/chrome_ai/app/src/index.js @@ -56,9 +56,6 @@ inputForm.addEventListener("submit", async (event) => { const numTokens = encoding.encode(fullMsg).length; // Update the stat pills - console.log(`First Token: ${Math.round(timeToFirstTokenMs)} ms`); - console.log(`Total Time: ${Math.round(totalTimeMs)} ms`); - console.log(`Total Tokens: ${numTokens}`); document.getElementById( "firstTokenTime" ).textContent = `First Token: ${Math.round(timeToFirstTokenMs)} ms`; From 611114ca92b1bdac3210b8b4090babe8beb930ff Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:55:11 -0700 Subject: [PATCH 08/15] chore: lint files --- .../src/experimental/chrome_ai/chat_models.ts | 36 ++++++++----------- .../chat_models/chrome_ai.cjs | 1 - .../chat_models/chrome_ai.d.cts | 1 - .../chat_models/chrome_ai.d.ts | 1 - .../chat_models/chrome_ai.js | 1 - 5 files changed, 15 insertions(+), 25 deletions(-) delete mode 100644 libs/langchain-community/chat_models/chrome_ai.cjs delete mode 100644 libs/langchain-community/chat_models/chrome_ai.d.cts delete mode 100644 libs/langchain-community/chat_models/chrome_ai.d.ts delete mode 100644 libs/langchain-community/chat_models/chrome_ai.js diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/langchain/src/experimental/chrome_ai/chat_models.ts index 0b83a5c11548..50a53f5400b3 100644 --- a/langchain/src/experimental/chrome_ai/chat_models.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -136,28 +136,22 @@ export class ChatChromeAI extends SimpleChatModel { throw new Error("Session not found. Please call `.initialize()` first."); } const textPrompt = formatPrompt(messages); - + const stream = this.session.promptStreaming(textPrompt); - const reader = stream.getReader(); - - try { - let previousLength = 0; - while (true) { - const { done, value } = await reader.read(); - if (done) break; - const newContent = value.slice(previousLength); - previousLength = value.length; - yield new ChatGenerationChunk({ - text: newContent, - message: new AIMessageChunk({ - content: newContent, - additional_kwargs: {}, - }), - }); - await runManager?.handleLLMNewToken(newContent); - } - } finally { - reader.releaseLock(); + const iterableStream = stream.pipeThrough(new TextDecoderStream()).getIterator(); + + let previousContent = ""; + for await (const chunk of iterableStream) { + const newContent = chunk.slice(previousContent.length); + previousContent += newContent; + yield new ChatGenerationChunk({ + text: newContent, + message: new AIMessageChunk({ + content: newContent, + additional_kwargs: {}, + }), + }); + await runManager?.handleLLMNewToken(newContent); } } diff --git a/libs/langchain-community/chat_models/chrome_ai.cjs b/libs/langchain-community/chat_models/chrome_ai.cjs deleted file mode 100644 index 2a0c111f92e4..000000000000 --- a/libs/langchain-community/chat_models/chrome_ai.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../dist/chat_models/chrome_ai.cjs'); \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.d.cts b/libs/langchain-community/chat_models/chrome_ai.d.cts deleted file mode 100644 index 40caf3c9f60f..000000000000 --- a/libs/langchain-community/chat_models/chrome_ai.d.cts +++ /dev/null @@ -1 +0,0 @@ -export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.d.ts b/libs/langchain-community/chat_models/chrome_ai.d.ts deleted file mode 100644 index 40caf3c9f60f..000000000000 --- a/libs/langchain-community/chat_models/chrome_ai.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file diff --git a/libs/langchain-community/chat_models/chrome_ai.js b/libs/langchain-community/chat_models/chrome_ai.js deleted file mode 100644 index 40caf3c9f60f..000000000000 --- a/libs/langchain-community/chat_models/chrome_ai.js +++ /dev/null @@ -1 +0,0 @@ -export * from '../dist/chat_models/chrome_ai.js' \ No newline at end of file From ddcc08b340e3fdd3c5c36bb88ba12a8b8a7b7f80 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 10:58:11 -0700 Subject: [PATCH 09/15] chore: lint files --- langchain/src/experimental/chrome_ai/chat_models.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/langchain/src/experimental/chrome_ai/chat_models.ts index 50a53f5400b3..e61a3420d791 100644 --- a/langchain/src/experimental/chrome_ai/chat_models.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -6,6 +6,7 @@ import type { BaseLanguageModelCallOptions } from "@langchain/core/language_mode import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { BaseMessage, AIMessageChunk } from "@langchain/core/messages"; import { ChatGenerationChunk } from "@langchain/core/outputs"; +import { IterableReadableStream } from "@langchain/core/utils/stream"; export interface AI { canCreateTextSession(): Promise; @@ -138,7 +139,7 @@ export class ChatChromeAI extends SimpleChatModel { const textPrompt = formatPrompt(messages); const stream = this.session.promptStreaming(textPrompt); - const iterableStream = stream.pipeThrough(new TextDecoderStream()).getIterator(); + const iterableStream = IterableReadableStream.fromReadableStream(stream); let previousContent = ""; for await (const chunk of iterableStream) { From 80b3ffe49e70e013de637e0fd823dd056d57e36d Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 11:02:08 -0700 Subject: [PATCH 10/15] chore: lint files --- langchain/src/experimental/chrome_ai/chat_models.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/langchain/src/experimental/chrome_ai/chat_models.ts index e61a3420d791..14b27200226c 100644 --- a/langchain/src/experimental/chrome_ai/chat_models.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -100,7 +100,7 @@ export class ChatChromeAI extends SimpleChatModel { throw new Error("ChatChromeAI can only be used in the browser."); } - const {ai} = window as any; + const { ai } = window as any; const canCreateTextSession = await ai.canCreateTextSession(); if (canCreateTextSession === AIModelAvailability.No) { throw new Error("The AI model is not available."); @@ -137,10 +137,10 @@ export class ChatChromeAI extends SimpleChatModel { throw new Error("Session not found. Please call `.initialize()` first."); } const textPrompt = formatPrompt(messages); - + const stream = this.session.promptStreaming(textPrompt); const iterableStream = IterableReadableStream.fromReadableStream(stream); - + let previousContent = ""; for await (const chunk of iterableStream) { const newContent = chunk.slice(previousContent.length); From f86e10b8b98a4d235079a6248d60a956639b176f Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 11:22:35 -0700 Subject: [PATCH 11/15] docs --- .../docs/integrations/chat/chrome_ai.mdx | 58 +++++++++++++++++++ .../experimental/chrome_ai/app/src/index.js | 2 +- .../src/experimental/chrome_ai/app/yarn.lock | 8 +-- .../src/experimental/chrome_ai/chat_models.ts | 16 +++-- 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 docs/core_docs/docs/integrations/chat/chrome_ai.mdx diff --git a/docs/core_docs/docs/integrations/chat/chrome_ai.mdx b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx new file mode 100644 index 000000000000..74e5f5362e64 --- /dev/null +++ b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx @@ -0,0 +1,58 @@ +--- +sidebar_label: ChromeAI +--- + +import CodeBlock from "@theme/CodeBlock"; + +# ChatChromeAI + +:::info +This feature is **experimental** and is subject to change. +::: +:::note +The `Built-in AI Early Preview Program` by Google is currently in beta. To apply for access or find more information, please visit [this link](https://developer.chrome.com/docs/ai/built-in). +::: + +ChatChromeAI leverages the webGPU and Gemini Nano to run LLMs directly in the browser, without the need for an internet connection. +This allows for running faster and private models without ever having data leave the consumers device. + +## Getting started + +Once you've been granted access to the program, follow all steps to download the model. + +Once downloaded, you can start using `ChatChromeAI` in the browser as follows: + +```typescript +import { ChatChromeAI } from "langchain/experimental/chat_models/chrome_ai"; +import { HumanMessage } from "@langchain/core/messages"; + +const model = new ChatChromeAI({ + temperature: 0.5, // Optional, defaults to 0.5 + topK: 40, // Optional, defaults to 40 +}); + +const message = new HumanMessage("Write me a short poem please"); + +const response = await model.invoke([message]); +``` + +### Streaming + +`ChatChromeAI` also supports streaming chunks: + +```typescript +import { AIMessageChunk } from "@langchain/core/messages"; + +let fullMessage: AIMessageChunk | undefined = undefined; +for await (const chunk of await model.stream([message])) { + if (!fullMessage) { + fullMessage = chunk; + } else { + fullMessage = fullMessage.concat(chunk); + } + console.log(fullMessage.content); +} +``` + +We also have a simple demo application which you can copy to instantly start running `ChatChromeAI` in your browser. +Navigate to the [README.md](../../../../../langchain/src/experimental/chrome_ai/app/README.md) in the `./app` directory of the integration for more instructions. diff --git a/langchain/src/experimental/chrome_ai/app/src/index.js b/langchain/src/experimental/chrome_ai/app/src/index.js index 9c1197736f47..5cebb03bce15 100644 --- a/langchain/src/experimental/chrome_ai/app/src/index.js +++ b/langchain/src/experimental/chrome_ai/app/src/index.js @@ -1,7 +1,7 @@ import { ChatChromeAI } from "langchain/experimental/chat_models/chrome_ai"; import { encodingForModel } from "@langchain/core/utils/tiktoken"; -const model = new ChatChromeAI({ callbacks: {} }); +const model = new ChatChromeAI(); const destroyButton = document.getElementById("destroyButton"); const inputForm = document.getElementById("inputForm"); const submitButton = inputForm.querySelector("button[type='submit']"); diff --git a/langchain/src/experimental/chrome_ai/app/yarn.lock b/langchain/src/experimental/chrome_ai/app/yarn.lock index 9e4d598304f4..9cf9aa6fca5e 100644 --- a/langchain/src/experimental/chrome_ai/app/yarn.lock +++ b/langchain/src/experimental/chrome_ai/app/yarn.lock @@ -86,14 +86,14 @@ __metadata: "@langchain/openai@file:../../../../../libs/langchain-openai::locator=chrome_ai%40workspace%3A.": version: 0.2.0 - resolution: "@langchain/openai@file:../../../../../libs/langchain-openai#../../../../../libs/langchain-openai::hash=0e7c98&locator=chrome_ai%40workspace%3A." + resolution: "@langchain/openai@file:../../../../../libs/langchain-openai#../../../../../libs/langchain-openai::hash=1fbca0&locator=chrome_ai%40workspace%3A." dependencies: "@langchain/core": ">=0.2.8 <0.3.0" js-tiktoken: ^1.0.12 openai: ^4.49.1 zod: ^3.22.4 zod-to-json-schema: ^3.22.3 - checksum: 2b070c3c7195597d4bb85ef8265721ca4eb981a14ead9b65145a9d241402348b6e6950ef8edd0667ee77f574282aff84fa04ceb4d35fa9edfaf666fdc06567d1 + checksum: bee5a6cebd31e036d531fe00f3fa477bf41f18778931753cf9ed1b3acab35fd2fc2baf0192b5a05e709736ec0a117e73440ce01975a5bde7b902ca58cf708344 languageName: node linkType: hard @@ -1165,7 +1165,7 @@ __metadata: "langchain@file:../../../../::locator=chrome_ai%40workspace%3A.": version: 0.2.7 - resolution: "langchain@file:../../../../#../../../../::hash=8f772d&locator=chrome_ai%40workspace%3A." + resolution: "langchain@file:../../../../#../../../../::hash=4f9e2d&locator=chrome_ai%40workspace%3A." dependencies: "@langchain/core": ~0.2.0 "@langchain/openai": ">=0.1.0 <0.3.0" @@ -1334,7 +1334,7 @@ __metadata: optional: true youtubei.js: optional: true - checksum: 81cf69fc35fb79ac4df6a1a4510cd28bad10c4a5e9b7a59c53caff1c75673e375ae80b187a84c5ef1e75814dab140fc928f47cc1985f481b93660b4acb9ef7ce + checksum: b5094561ed6a8826c8c8240f492372ba7dd3afdeecce3ec1fdd9c7e85d99428e0e70849d3dc1681e834d378f62f1e7f9f5e407ff3dcbc87287c26191657f9c31 languageName: node linkType: hard diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/langchain/src/experimental/chrome_ai/chat_models.ts index 14b27200226c..79fe73493ef0 100644 --- a/langchain/src/experimental/chrome_ai/chat_models.ts +++ b/langchain/src/experimental/chrome_ai/chat_models.ts @@ -3,7 +3,10 @@ import { type BaseChatModelParams, } from "@langchain/core/language_models/chat_models"; import type { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; -import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; +import { + CallbackManagerForLLMRun, + Callbacks, +} from "@langchain/core/callbacks/manager"; import { BaseMessage, AIMessageChunk } from "@langchain/core/messages"; import { ChatGenerationChunk } from "@langchain/core/outputs"; import { IterableReadableStream } from "@langchain/core/utils/stream"; @@ -82,10 +85,13 @@ export class ChatChromeAI extends SimpleChatModel { return "ChatChromeAI"; } - constructor(inputs: ChromeAIInputs) { - super(inputs); - this.temperature = inputs.temperature ?? this.temperature; - this.topK = inputs.topK ?? this.topK; + constructor(inputs?: ChromeAIInputs) { + super({ + callbacks: {} as Callbacks, + ...inputs, + }); + this.temperature = inputs?.temperature ?? this.temperature; + this.topK = inputs?.topK ?? this.topK; } _llmType() { From 1f2e0e132976788dafe37ae34e9d00b17b82fcb3 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 26 Jun 2024 11:53:05 -0700 Subject: [PATCH 12/15] fix docs link --- docs/core_docs/docs/integrations/chat/chrome_ai.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core_docs/docs/integrations/chat/chrome_ai.mdx b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx index 74e5f5362e64..b60dcc0da88d 100644 --- a/docs/core_docs/docs/integrations/chat/chrome_ai.mdx +++ b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx @@ -55,4 +55,4 @@ for await (const chunk of await model.stream([message])) { ``` We also have a simple demo application which you can copy to instantly start running `ChatChromeAI` in your browser. -Navigate to the [README.md](../../../../../langchain/src/experimental/chrome_ai/app/README.md) in the `./app` directory of the integration for more instructions. +Navigate to the [README.md](https://github.com/langchain-ai/langchainjs/tree/main/langchain/src/experimental/chrome_ai/app/README.md) in the `./app` directory of the integration for more instructions. From 8e259b6db3935168ba52f22610b483a04fedc85d Mon Sep 17 00:00:00 2001 From: bracesproul Date: Thu, 27 Jun 2024 16:53:40 -0700 Subject: [PATCH 13/15] moved to community --- .../docs/integrations/chat/chrome_ai.mdx | 5 +- .../test-exports-bun/src/entrypoints.js | 1 - .../test-exports-cf/src/entrypoints.js | 1 - .../test-exports-cjs/src/entrypoints.js | 1 - .../test-exports-esbuild/src/entrypoints.js | 1 - .../test-exports-esm/src/entrypoints.js | 1 - .../test-exports-vercel/src/entrypoints.js | 1 - .../test-exports-vite/src/entrypoints.js | 1 - langchain/.gitignore | 4 - langchain/langchain.config.js | 1 - langchain/package.json | 13 - langchain/src/load/import_map.ts | 1 - libs/langchain-community/.gitignore | 4 + libs/langchain-community/langchain.config.js | 1 + libs/langchain-community/package.json | 13 + .../chat_models}/chrome_ai/app/README.md | 0 .../chat_models}/chrome_ai/app/package.json | 4 +- .../chrome_ai/app/src/chrome_ai.html | 0 .../chat_models}/chrome_ai/app/src/index.js | 2 +- .../chrome_ai/app/webpack.config.js | 0 .../chat_models}/chrome_ai/app/yarn.lock | 447 +++++++++++++++++- .../chat_models}/chrome_ai/chat_models.ts | 0 .../src/load/import_map.ts | 1 + 23 files changed, 449 insertions(+), 54 deletions(-) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/README.md (100%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/package.json (71%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/src/chrome_ai.html (100%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/src/index.js (96%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/webpack.config.js (100%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/app/yarn.lock (86%) rename {langchain/src/experimental => libs/langchain-community/src/experimental/chat_models}/chrome_ai/chat_models.ts (100%) diff --git a/docs/core_docs/docs/integrations/chat/chrome_ai.mdx b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx index b60dcc0da88d..c13ba779e34a 100644 --- a/docs/core_docs/docs/integrations/chat/chrome_ai.mdx +++ b/docs/core_docs/docs/integrations/chat/chrome_ai.mdx @@ -9,6 +9,7 @@ import CodeBlock from "@theme/CodeBlock"; :::info This feature is **experimental** and is subject to change. ::: + :::note The `Built-in AI Early Preview Program` by Google is currently in beta. To apply for access or find more information, please visit [this link](https://developer.chrome.com/docs/ai/built-in). ::: @@ -23,7 +24,7 @@ Once you've been granted access to the program, follow all steps to download the Once downloaded, you can start using `ChatChromeAI` in the browser as follows: ```typescript -import { ChatChromeAI } from "langchain/experimental/chat_models/chrome_ai"; +import { ChatChromeAI } from "@langchain/community/experimental/chat_models/chrome_ai"; import { HumanMessage } from "@langchain/core/messages"; const model = new ChatChromeAI({ @@ -55,4 +56,4 @@ for await (const chunk of await model.stream([message])) { ``` We also have a simple demo application which you can copy to instantly start running `ChatChromeAI` in your browser. -Navigate to the [README.md](https://github.com/langchain-ai/langchainjs/tree/main/langchain/src/experimental/chrome_ai/app/README.md) in the `./app` directory of the integration for more instructions. +Navigate to the [README.md](https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-community/src/experimental/chrome_ai/app/README.md) in the `./app` directory of the integration for more instructions. diff --git a/environment_tests/test-exports-bun/src/entrypoints.js b/environment_tests/test-exports-bun/src/entrypoints.js index bef03d471759..0127a63d1c08 100644 --- a/environment_tests/test-exports-bun/src/entrypoints.js +++ b/environment_tests/test-exports-bun/src/entrypoints.js @@ -68,7 +68,6 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; -export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-cf/src/entrypoints.js b/environment_tests/test-exports-cf/src/entrypoints.js index bef03d471759..0127a63d1c08 100644 --- a/environment_tests/test-exports-cf/src/entrypoints.js +++ b/environment_tests/test-exports-cf/src/entrypoints.js @@ -68,7 +68,6 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; -export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-cjs/src/entrypoints.js b/environment_tests/test-exports-cjs/src/entrypoints.js index 7c30db491b23..5f9a19db39f2 100644 --- a/environment_tests/test-exports-cjs/src/entrypoints.js +++ b/environment_tests/test-exports-cjs/src/entrypoints.js @@ -68,7 +68,6 @@ const experimental_babyagi = require("langchain/experimental/babyagi"); const experimental_generative_agents = require("langchain/experimental/generative_agents"); const experimental_plan_and_execute = require("langchain/experimental/plan_and_execute"); const experimental_chains_violation_of_expectations = require("langchain/experimental/chains/violation_of_expectations"); -const experimental_chat_models_chrome_ai = require("langchain/experimental/chat_models/chrome_ai"); const experimental_masking = require("langchain/experimental/masking"); const experimental_prompts_custom_format = require("langchain/experimental/prompts/custom_format"); const evaluation = require("langchain/evaluation"); diff --git a/environment_tests/test-exports-esbuild/src/entrypoints.js b/environment_tests/test-exports-esbuild/src/entrypoints.js index 693bc1eab6b7..d3b76a743d8a 100644 --- a/environment_tests/test-exports-esbuild/src/entrypoints.js +++ b/environment_tests/test-exports-esbuild/src/entrypoints.js @@ -68,7 +68,6 @@ import * as experimental_babyagi from "langchain/experimental/babyagi"; import * as experimental_generative_agents from "langchain/experimental/generative_agents"; import * as experimental_plan_and_execute from "langchain/experimental/plan_and_execute"; import * as experimental_chains_violation_of_expectations from "langchain/experimental/chains/violation_of_expectations"; -import * as experimental_chat_models_chrome_ai from "langchain/experimental/chat_models/chrome_ai"; import * as experimental_masking from "langchain/experimental/masking"; import * as experimental_prompts_custom_format from "langchain/experimental/prompts/custom_format"; import * as evaluation from "langchain/evaluation"; diff --git a/environment_tests/test-exports-esm/src/entrypoints.js b/environment_tests/test-exports-esm/src/entrypoints.js index 693bc1eab6b7..d3b76a743d8a 100644 --- a/environment_tests/test-exports-esm/src/entrypoints.js +++ b/environment_tests/test-exports-esm/src/entrypoints.js @@ -68,7 +68,6 @@ import * as experimental_babyagi from "langchain/experimental/babyagi"; import * as experimental_generative_agents from "langchain/experimental/generative_agents"; import * as experimental_plan_and_execute from "langchain/experimental/plan_and_execute"; import * as experimental_chains_violation_of_expectations from "langchain/experimental/chains/violation_of_expectations"; -import * as experimental_chat_models_chrome_ai from "langchain/experimental/chat_models/chrome_ai"; import * as experimental_masking from "langchain/experimental/masking"; import * as experimental_prompts_custom_format from "langchain/experimental/prompts/custom_format"; import * as evaluation from "langchain/evaluation"; diff --git a/environment_tests/test-exports-vercel/src/entrypoints.js b/environment_tests/test-exports-vercel/src/entrypoints.js index bef03d471759..0127a63d1c08 100644 --- a/environment_tests/test-exports-vercel/src/entrypoints.js +++ b/environment_tests/test-exports-vercel/src/entrypoints.js @@ -68,7 +68,6 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; -export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/environment_tests/test-exports-vite/src/entrypoints.js b/environment_tests/test-exports-vite/src/entrypoints.js index bef03d471759..0127a63d1c08 100644 --- a/environment_tests/test-exports-vite/src/entrypoints.js +++ b/environment_tests/test-exports-vite/src/entrypoints.js @@ -68,7 +68,6 @@ export * from "langchain/experimental/babyagi"; export * from "langchain/experimental/generative_agents"; export * from "langchain/experimental/plan_and_execute"; export * from "langchain/experimental/chains/violation_of_expectations"; -export * from "langchain/experimental/chat_models/chrome_ai"; export * from "langchain/experimental/masking"; export * from "langchain/experimental/prompts/custom_format"; export * from "langchain/evaluation"; diff --git a/langchain/.gitignore b/langchain/.gitignore index d24052476339..0047dee6bc98 100644 --- a/langchain/.gitignore +++ b/langchain/.gitignore @@ -510,10 +510,6 @@ experimental/chains/violation_of_expectations.cjs experimental/chains/violation_of_expectations.js experimental/chains/violation_of_expectations.d.ts experimental/chains/violation_of_expectations.d.cts -experimental/chat_models/chrome_ai.cjs -experimental/chat_models/chrome_ai.js -experimental/chat_models/chrome_ai.d.ts -experimental/chat_models/chrome_ai.d.cts experimental/masking.cjs experimental/masking.js experimental/masking.d.ts diff --git a/langchain/langchain.config.js b/langchain/langchain.config.js index 7d7e227eece9..d086a9e2cdb8 100644 --- a/langchain/langchain.config.js +++ b/langchain/langchain.config.js @@ -190,7 +190,6 @@ export const config = { "experimental/plan_and_execute": "experimental/plan_and_execute/index", "experimental/chains/violation_of_expectations": "experimental/chains/violation_of_expectations/index", - "experimental/chat_models/chrome_ai": "experimental/chrome_ai/chat_models", "experimental/masking": "experimental/masking/index", "experimental/prompts/custom_format": "experimental/prompts/custom_format", "experimental/prompts/handlebars": "experimental/prompts/handlebars", diff --git a/langchain/package.json b/langchain/package.json index 5c632daf14d5..9bd804d77d0c 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -522,10 +522,6 @@ "experimental/chains/violation_of_expectations.js", "experimental/chains/violation_of_expectations.d.ts", "experimental/chains/violation_of_expectations.d.cts", - "experimental/chat_models/chrome_ai.cjs", - "experimental/chat_models/chrome_ai.js", - "experimental/chat_models/chrome_ai.d.ts", - "experimental/chat_models/chrome_ai.d.cts", "experimental/masking.cjs", "experimental/masking.js", "experimental/masking.d.ts", @@ -2079,15 +2075,6 @@ "import": "./experimental/chains/violation_of_expectations.js", "require": "./experimental/chains/violation_of_expectations.cjs" }, - "./experimental/chat_models/chrome_ai": { - "types": { - "import": "./experimental/chat_models/chrome_ai.d.ts", - "require": "./experimental/chat_models/chrome_ai.d.cts", - "default": "./experimental/chat_models/chrome_ai.d.ts" - }, - "import": "./experimental/chat_models/chrome_ai.js", - "require": "./experimental/chat_models/chrome_ai.cjs" - }, "./experimental/masking": { "types": { "import": "./experimental/masking.d.ts", diff --git a/langchain/src/load/import_map.ts b/langchain/src/load/import_map.ts index 69f3fe8fac5c..115793fcac92 100644 --- a/langchain/src/load/import_map.ts +++ b/langchain/src/load/import_map.ts @@ -59,7 +59,6 @@ export * as experimental__babyagi from "../experimental/babyagi/index.js"; export * as experimental__generative_agents from "../experimental/generative_agents/index.js"; export * as experimental__plan_and_execute from "../experimental/plan_and_execute/index.js"; export * as experimental__chains__violation_of_expectations from "../experimental/chains/violation_of_expectations/index.js"; -export * as experimental__chat_models__chrome_ai from "../experimental/chrome_ai/chat_models.js"; export * as experimental__masking from "../experimental/masking/index.js"; export * as experimental__prompts__custom_format from "../experimental/prompts/custom_format.js"; export * as evaluation from "../evaluation/index.js"; diff --git a/libs/langchain-community/.gitignore b/libs/langchain-community/.gitignore index 4246a650f6df..1e47ea0ab61e 100644 --- a/libs/langchain-community/.gitignore +++ b/libs/langchain-community/.gitignore @@ -1030,6 +1030,10 @@ experimental/chat_models/ollama_functions.cjs experimental/chat_models/ollama_functions.js experimental/chat_models/ollama_functions.d.ts experimental/chat_models/ollama_functions.d.cts +experimental/chat_models/chrome_ai.cjs +experimental/chat_models/chrome_ai.js +experimental/chat_models/chrome_ai.d.ts +experimental/chat_models/chrome_ai.d.cts chains/graph_qa/cypher.cjs chains/graph_qa/cypher.js chains/graph_qa/cypher.d.ts diff --git a/libs/langchain-community/langchain.config.js b/libs/langchain-community/langchain.config.js index 7012d8e06c5a..e73c23b4938c 100644 --- a/libs/langchain-community/langchain.config.js +++ b/libs/langchain-community/langchain.config.js @@ -316,6 +316,7 @@ export const config = { "experimental/hubs/makersuite/googlemakersuitehub": "experimental/hubs/makersuite/googlemakersuitehub", "experimental/chat_models/ollama_functions": "experimental/chat_models/ollama_functions", + "experimental/chat_models/chrome_ai": "experimental/chat_models/chrome_ai/chat_models", // chains "chains/graph_qa/cypher": "chains/graph_qa/cypher" }, diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index 3ef6acbe7890..b7feada5ff7d 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -3022,6 +3022,15 @@ "import": "./experimental/chat_models/ollama_functions.js", "require": "./experimental/chat_models/ollama_functions.cjs" }, + "./experimental/chat_models/chrome_ai": { + "types": { + "import": "./experimental/chat_models/chrome_ai.d.ts", + "require": "./experimental/chat_models/chrome_ai.d.cts", + "default": "./experimental/chat_models/chrome_ai.d.ts" + }, + "import": "./experimental/chat_models/chrome_ai.js", + "require": "./experimental/chat_models/chrome_ai.cjs" + }, "./chains/graph_qa/cypher": { "types": { "import": "./chains/graph_qa/cypher.d.ts", @@ -4067,6 +4076,10 @@ "experimental/chat_models/ollama_functions.js", "experimental/chat_models/ollama_functions.d.ts", "experimental/chat_models/ollama_functions.d.cts", + "experimental/chat_models/chrome_ai.cjs", + "experimental/chat_models/chrome_ai.js", + "experimental/chat_models/chrome_ai.d.ts", + "experimental/chat_models/chrome_ai.d.cts", "chains/graph_qa/cypher.cjs", "chains/graph_qa/cypher.js", "chains/graph_qa/cypher.d.ts", diff --git a/langchain/src/experimental/chrome_ai/app/README.md b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md similarity index 100% rename from langchain/src/experimental/chrome_ai/app/README.md rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md diff --git a/langchain/src/experimental/chrome_ai/app/package.json b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/package.json similarity index 71% rename from langchain/src/experimental/chrome_ai/app/package.json rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/package.json index 00549bbcbf7a..461f8683a307 100644 --- a/langchain/src/experimental/chrome_ai/app/package.json +++ b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/package.json @@ -10,7 +10,7 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "@langchain/openai": "file:../../../../../libs/langchain-openai", - "langchain": "file:../../../../" + "@langchain/community": "file:../../../../../", + "@langchain/openai": "file:../../../../../../langchain-openai" } } diff --git a/langchain/src/experimental/chrome_ai/app/src/chrome_ai.html b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/src/chrome_ai.html similarity index 100% rename from langchain/src/experimental/chrome_ai/app/src/chrome_ai.html rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/src/chrome_ai.html diff --git a/langchain/src/experimental/chrome_ai/app/src/index.js b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/src/index.js similarity index 96% rename from langchain/src/experimental/chrome_ai/app/src/index.js rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/src/index.js index 5cebb03bce15..1edd95feeec2 100644 --- a/langchain/src/experimental/chrome_ai/app/src/index.js +++ b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/src/index.js @@ -1,4 +1,4 @@ -import { ChatChromeAI } from "langchain/experimental/chat_models/chrome_ai"; +import { ChatChromeAI } from "@langchain/community/experimental/chat_models/chrome_ai"; import { encodingForModel } from "@langchain/core/utils/tiktoken"; const model = new ChatChromeAI(); diff --git a/langchain/src/experimental/chrome_ai/app/webpack.config.js b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/webpack.config.js similarity index 100% rename from langchain/src/experimental/chrome_ai/app/webpack.config.js rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/webpack.config.js diff --git a/langchain/src/experimental/chrome_ai/app/yarn.lock b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/yarn.lock similarity index 86% rename from langchain/src/experimental/chrome_ai/app/yarn.lock rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/app/yarn.lock index 9cf9aa6fca5e..86d7f91a365a 100644 --- a/langchain/src/experimental/chrome_ai/app/yarn.lock +++ b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/yarn.lock @@ -64,7 +64,388 @@ __metadata: languageName: node linkType: hard -"@langchain/core@npm:>0.2.0 <0.3.0, @langchain/core@npm:>=0.2.8 <0.3.0, @langchain/core@npm:~0.2.0": +"@langchain/community@file:../../../../../::locator=chrome_ai%40workspace%3A.": + version: 0.2.14 + resolution: "@langchain/community@file:../../../../../#../../../../../::hash=6c19e0&locator=chrome_ai%40workspace%3A." + dependencies: + "@langchain/core": ~0.2.9 + "@langchain/openai": ~0.1.0 + binary-extensions: ^2.2.0 + expr-eval: ^2.0.2 + flat: ^5.0.2 + js-yaml: ^4.1.0 + langchain: 0.2.3 + langsmith: ~0.1.30 + uuid: ^9.0.0 + zod: ^3.22.3 + zod-to-json-schema: ^3.22.5 + peerDependencies: + "@aws-crypto/sha256-js": ^5.0.0 + "@aws-sdk/client-bedrock-agent-runtime": ^3.583.0 + "@aws-sdk/client-bedrock-runtime": ^3.422.0 + "@aws-sdk/client-dynamodb": ^3.310.0 + "@aws-sdk/client-kendra": ^3.352.0 + "@aws-sdk/client-lambda": ^3.310.0 + "@aws-sdk/client-s3": ^3.310.0 + "@aws-sdk/client-sagemaker-runtime": ^3.310.0 + "@aws-sdk/client-sfn": ^3.310.0 + "@aws-sdk/credential-provider-node": ^3.388.0 + "@azure/search-documents": ^12.0.0 + "@azure/storage-blob": ^12.15.0 + "@browserbasehq/sdk": "*" + "@clickhouse/client": ^0.2.5 + "@cloudflare/ai": "*" + "@datastax/astra-db-ts": ^1.0.0 + "@elastic/elasticsearch": ^8.4.0 + "@getmetal/metal-sdk": "*" + "@getzep/zep-cloud": ^1.0.6 + "@getzep/zep-js": ^0.9.0 + "@gomomento/sdk": ^1.51.1 + "@gomomento/sdk-core": ^1.51.1 + "@google-ai/generativelanguage": "*" + "@google-cloud/storage": ^6.10.1 || ^7.7.0 + "@gradientai/nodejs-sdk": ^1.2.0 + "@huggingface/inference": ^2.6.4 + "@layerup/layerup-security": ^1.5.12 + "@mendable/firecrawl-js": ^0.0.13 + "@mlc-ai/web-llm": 0.2.46 + "@mozilla/readability": "*" + "@neondatabase/serverless": "*" + "@notionhq/client": ^2.2.10 + "@opensearch-project/opensearch": "*" + "@pinecone-database/pinecone": "*" + "@planetscale/database": ^1.8.0 + "@premai/prem-sdk": ^0.3.25 + "@qdrant/js-client-rest": ^1.8.2 + "@raycast/api": ^1.55.2 + "@rockset/client": ^0.9.1 + "@smithy/eventstream-codec": ^2.0.5 + "@smithy/protocol-http": ^3.0.6 + "@smithy/signature-v4": ^2.0.10 + "@smithy/util-utf8": ^2.0.0 + "@spider-cloud/spider-client": ^0.0.21 + "@supabase/postgrest-js": ^1.1.1 + "@supabase/supabase-js": ^2.10.0 + "@tensorflow-models/universal-sentence-encoder": "*" + "@tensorflow/tfjs-converter": "*" + "@tensorflow/tfjs-core": "*" + "@upstash/ratelimit": ^1.1.3 + "@upstash/redis": ^1.20.6 + "@upstash/vector": ^1.1.1 + "@vercel/kv": ^0.2.3 + "@vercel/postgres": ^0.5.0 + "@writerai/writer-sdk": ^0.40.2 + "@xata.io/client": ^0.28.0 + "@xenova/transformers": ^2.5.4 + "@zilliz/milvus2-sdk-node": ">=2.3.5" + apify-client: ^2.7.1 + assemblyai: ^4.0.0 + better-sqlite3: ">=9.4.0 <12.0.0" + cassandra-driver: ^4.7.2 + cborg: ^4.1.1 + cheerio: ^1.0.0-rc.12 + chromadb: "*" + closevector-common: 0.1.3 + closevector-node: 0.1.6 + closevector-web: 0.1.6 + cohere-ai: "*" + convex: ^1.3.1 + couchbase: ^4.3.0 + crypto-js: ^4.2.0 + d3-dsv: ^2.0.0 + discord.js: ^14.14.1 + dria: ^0.0.3 + duck-duck-scrape: ^2.2.5 + epub2: ^3.0.1 + faiss-node: ^0.5.1 + firebase-admin: ^11.9.0 || ^12.0.0 + google-auth-library: "*" + googleapis: ^126.0.1 + hnswlib-node: ^3.0.0 + html-to-text: ^9.0.5 + ignore: ^5.2.0 + interface-datastore: ^8.2.11 + ioredis: ^5.3.2 + it-all: ^3.0.4 + jsdom: "*" + jsonwebtoken: ^9.0.2 + llmonitor: ^0.5.9 + lodash: ^4.17.21 + lunary: ^0.6.11 + mammoth: ^1.6.0 + mongodb: ">=5.2.0" + mysql2: ^3.3.3 + neo4j-driver: "*" + node-llama-cpp: "*" + notion-to-md: ^3.1.0 + officeparser: ^4.0.4 + pdf-parse: 1.1.1 + pg: ^8.11.0 + pg-copy-streams: ^6.0.5 + pickleparser: ^0.2.1 + playwright: ^1.32.1 + portkey-ai: ^0.1.11 + puppeteer: ^19.7.2 + redis: "*" + replicate: ^0.29.4 + sonix-speech-recognition: ^2.1.1 + srt-parser-2: ^1.2.3 + typeorm: ^0.3.20 + typesense: ^1.5.3 + usearch: ^1.1.1 + vectordb: ^0.1.4 + voy-search: 0.6.2 + weaviate-ts-client: "*" + web-auth-library: ^1.0.3 + ws: ^8.14.2 + youtube-transcript: ^1.0.6 + youtubei.js: ^9.1.0 + peerDependenciesMeta: + "@aws-crypto/sha256-js": + optional: true + "@aws-sdk/client-bedrock-agent-runtime": + optional: true + "@aws-sdk/client-bedrock-runtime": + optional: true + "@aws-sdk/client-dynamodb": + optional: true + "@aws-sdk/client-kendra": + optional: true + "@aws-sdk/client-lambda": + optional: true + "@aws-sdk/client-s3": + optional: true + "@aws-sdk/client-sagemaker-runtime": + optional: true + "@aws-sdk/client-sfn": + optional: true + "@aws-sdk/credential-provider-node": + optional: true + "@azure/search-documents": + optional: true + "@azure/storage-blob": + optional: true + "@browserbasehq/sdk": + optional: true + "@clickhouse/client": + optional: true + "@cloudflare/ai": + optional: true + "@datastax/astra-db-ts": + optional: true + "@elastic/elasticsearch": + optional: true + "@getmetal/metal-sdk": + optional: true + "@getzep/zep-cloud": + optional: true + "@getzep/zep-js": + optional: true + "@gomomento/sdk": + optional: true + "@gomomento/sdk-core": + optional: true + "@google-ai/generativelanguage": + optional: true + "@google-cloud/storage": + optional: true + "@gradientai/nodejs-sdk": + optional: true + "@huggingface/inference": + optional: true + "@layerup/layerup-security": + optional: true + "@mendable/firecrawl-js": + optional: true + "@mlc-ai/web-llm": + optional: true + "@mozilla/readability": + optional: true + "@neondatabase/serverless": + optional: true + "@notionhq/client": + optional: true + "@opensearch-project/opensearch": + optional: true + "@pinecone-database/pinecone": + optional: true + "@planetscale/database": + optional: true + "@premai/prem-sdk": + optional: true + "@qdrant/js-client-rest": + optional: true + "@raycast/api": + optional: true + "@rockset/client": + optional: true + "@smithy/eventstream-codec": + optional: true + "@smithy/protocol-http": + optional: true + "@smithy/signature-v4": + optional: true + "@smithy/util-utf8": + optional: true + "@spider-cloud/spider-client": + optional: true + "@supabase/postgrest-js": + optional: true + "@supabase/supabase-js": + optional: true + "@tensorflow-models/universal-sentence-encoder": + optional: true + "@tensorflow/tfjs-converter": + optional: true + "@tensorflow/tfjs-core": + optional: true + "@upstash/ratelimit": + optional: true + "@upstash/redis": + optional: true + "@upstash/vector": + optional: true + "@vercel/kv": + optional: true + "@vercel/postgres": + optional: true + "@writerai/writer-sdk": + optional: true + "@xata.io/client": + optional: true + "@xenova/transformers": + optional: true + "@zilliz/milvus2-sdk-node": + optional: true + apify-client: + optional: true + assemblyai: + optional: true + better-sqlite3: + optional: true + cassandra-driver: + optional: true + cborg: + optional: true + cheerio: + optional: true + chromadb: + optional: true + closevector-common: + optional: true + closevector-node: + optional: true + closevector-web: + optional: true + cohere-ai: + optional: true + convex: + optional: true + couchbase: + optional: true + crypto-js: + optional: true + d3-dsv: + optional: true + discord.js: + optional: true + dria: + optional: true + duck-duck-scrape: + optional: true + epub2: + optional: true + faiss-node: + optional: true + firebase-admin: + optional: true + google-auth-library: + optional: true + googleapis: + optional: true + hnswlib-node: + optional: true + html-to-text: + optional: true + ignore: + optional: true + interface-datastore: + optional: true + ioredis: + optional: true + it-all: + optional: true + jsdom: + optional: true + jsonwebtoken: + optional: true + llmonitor: + optional: true + lodash: + optional: true + lunary: + optional: true + mammoth: + optional: true + mongodb: + optional: true + mysql2: + optional: true + neo4j-driver: + optional: true + node-llama-cpp: + optional: true + notion-to-md: + optional: true + officeparser: + optional: true + pdf-parse: + optional: true + pg: + optional: true + pg-copy-streams: + optional: true + pickleparser: + optional: true + playwright: + optional: true + portkey-ai: + optional: true + puppeteer: + optional: true + redis: + optional: true + replicate: + optional: true + sonix-speech-recognition: + optional: true + srt-parser-2: + optional: true + typeorm: + optional: true + typesense: + optional: true + usearch: + optional: true + vectordb: + optional: true + voy-search: + optional: true + weaviate-ts-client: + optional: true + web-auth-library: + optional: true + ws: + optional: true + youtube-transcript: + optional: true + youtubei.js: + optional: true + checksum: 337c8e37919b753c7818ca0a722f4d3de79b9df7ba3e5cdac9a40453db4bf13c15025cd9a2b8e64bdb4277ffefe1483e9c3ee1db01db83c0472bbf60e812598b + languageName: node + linkType: hard + +"@langchain/core@npm:>0.1.56 <0.3.0, @langchain/core@npm:>0.2.0 <0.3.0, @langchain/core@npm:>=0.2.5 <0.3.0, @langchain/core@npm:>=0.2.8 <0.3.0, @langchain/core@npm:~0.2.0, @langchain/core@npm:~0.2.9": version: 0.2.10 resolution: "@langchain/core@npm:0.2.10" dependencies: @@ -84,29 +465,42 @@ __metadata: languageName: node linkType: hard -"@langchain/openai@file:../../../../../libs/langchain-openai::locator=chrome_ai%40workspace%3A.": - version: 0.2.0 - resolution: "@langchain/openai@file:../../../../../libs/langchain-openai#../../../../../libs/langchain-openai::hash=1fbca0&locator=chrome_ai%40workspace%3A." +"@langchain/openai@file:../../../../../../langchain-openai::locator=chrome_ai%40workspace%3A.": + version: 0.2.1 + resolution: "@langchain/openai@file:../../../../../../langchain-openai#../../../../../../langchain-openai::hash=54b7d6&locator=chrome_ai%40workspace%3A." dependencies: "@langchain/core": ">=0.2.8 <0.3.0" js-tiktoken: ^1.0.12 openai: ^4.49.1 zod: ^3.22.4 zod-to-json-schema: ^3.22.3 - checksum: bee5a6cebd31e036d531fe00f3fa477bf41f18778931753cf9ed1b3acab35fd2fc2baf0192b5a05e709736ec0a117e73440ce01975a5bde7b902ca58cf708344 + checksum: 448dfb7a2b99f4d742d2a328e473d59b5a578db05c843b378b0f88c85bdbd540a9f24451e427177915b5da31bed85665ad086c514d36ee20a1b76ac95a957883 languageName: node linkType: hard -"@langchain/openai@npm:>=0.1.0 <0.3.0": - version: 0.2.0 - resolution: "@langchain/openai@npm:0.2.0" +"@langchain/openai@npm:~0.0.28": + version: 0.0.34 + resolution: "@langchain/openai@npm:0.0.34" dependencies: - "@langchain/core": ">=0.2.8 <0.3.0" + "@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 + checksum: d2a5568b7fd0507af2510d68cf568945d5c7f6e45f57ac1178f65d0092e0437e7c908e2af3e20b829ce4507f63e71ddc38df7dc35b7e3d21394daa380243e297 + languageName: node + linkType: hard + +"@langchain/openai@npm:~0.1.0": + version: 0.1.3 + resolution: "@langchain/openai@npm:0.1.3" + dependencies: + "@langchain/core": ">=0.2.5 <0.3.0" js-tiktoken: ^1.0.12 openai: ^4.49.1 zod: ^3.22.4 zod-to-json-schema: ^3.22.3 - checksum: 47b7fb04a968bad9a69363eeaf6e7ec956179f49d0317779e5604f3197ac637888bdb2854025f117bf89455bcf2a6cf4fae17a16c21563135ee68a9fee2bbdec + checksum: 43aaafad2e1416bc23846c6c5084502025d3972c0b11b2ef2bcefd9da3dc1cd933cdf838c596404584af024adccc26e34476fededed0e614a19b47a4e5a8c8e5 languageName: node linkType: hard @@ -589,9 +983,9 @@ __metadata: version: 0.0.0-use.local resolution: "chrome_ai@workspace:." dependencies: - "@langchain/openai": "file:../../../../../libs/langchain-openai" + "@langchain/community": "file:../../../../../" + "@langchain/openai": "file:../../../../../../langchain-openai" http-server: ^14.0.1 - langchain: "file:../../../../" webpack: ^5.92.1 webpack-cli: ^5.1.4 languageName: unknown @@ -816,6 +1210,13 @@ __metadata: languageName: node linkType: hard +"expr-eval@npm:^2.0.2": + version: 2.0.2 + resolution: "expr-eval@npm:2.0.2" + checksum: 01862f09b50b17b45a6268b1153280afede99e1b51752a323661f7f4010eaed34cd6c682bf439b7f8a92df6aa82f326f0ce0aa20964d175feee97377fe53921d + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -1163,19 +1564,19 @@ __metadata: languageName: node linkType: hard -"langchain@file:../../../../::locator=chrome_ai%40workspace%3A.": - version: 0.2.7 - resolution: "langchain@file:../../../../#../../../../::hash=4f9e2d&locator=chrome_ai%40workspace%3A." +"langchain@npm:0.2.3": + version: 0.2.3 + resolution: "langchain@npm:0.2.3" dependencies: "@langchain/core": ~0.2.0 - "@langchain/openai": ">=0.1.0 <0.3.0" + "@langchain/openai": ~0.0.28 "@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.30 + langsmith: ~0.1.7 ml-distance: ^4.0.0 openapi-types: ^12.1.3 p-retry: 4 @@ -1227,7 +1628,7 @@ __metadata: redis: ^4.6.4 sonix-speech-recognition: ^2.1.1 srt-parser-2: ^1.2.3 - typeorm: ^0.3.20 + typeorm: ^0.3.12 weaviate-ts-client: "*" web-auth-library: ^1.0.3 ws: ^8.14.2 @@ -1334,7 +1735,7 @@ __metadata: optional: true youtubei.js: optional: true - checksum: b5094561ed6a8826c8c8240f492372ba7dd3afdeecce3ec1fdd9c7e85d99428e0e70849d3dc1681e834d378f62f1e7f9f5e407ff3dcbc87287c26191657f9c31 + checksum: 92507963c919a2d6c9bc20055b93b1271045ba760f9af340d1fe7ef9a2a3c6382eaf6c622bed16c5680a6bf26553520cbafd13fd94b8e66b176ba31fe8106020 languageName: node linkType: hard @@ -1345,7 +1746,7 @@ __metadata: languageName: node linkType: hard -"langsmith@npm:~0.1.30": +"langsmith@npm:~0.1.30, langsmith@npm:~0.1.7": version: 0.1.34 resolution: "langsmith@npm:0.1.34" dependencies: @@ -1561,7 +1962,7 @@ __metadata: languageName: node linkType: hard -"openai@npm:^4.49.1": +"openai@npm:^4.41.1, openai@npm:^4.49.1": version: 4.52.1 resolution: "openai@npm:4.52.1" dependencies: @@ -2204,7 +2605,7 @@ __metadata: languageName: node linkType: hard -"zod-to-json-schema@npm:^3.22.3": +"zod-to-json-schema@npm:^3.22.3, zod-to-json-schema@npm:^3.22.5": version: 3.23.1 resolution: "zod-to-json-schema@npm:3.23.1" peerDependencies: @@ -2213,7 +2614,7 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.22.4": +"zod@npm:^3.22.3, zod@npm:^3.22.4": version: 3.23.8 resolution: "zod@npm:3.23.8" checksum: 15949ff82118f59c893dacd9d3c766d02b6fa2e71cf474d5aa888570c469dbf5446ac5ad562bb035bf7ac9650da94f290655c194f4a6de3e766f43febd432c5c diff --git a/langchain/src/experimental/chrome_ai/chat_models.ts b/libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts similarity index 100% rename from langchain/src/experimental/chrome_ai/chat_models.ts rename to libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts diff --git a/libs/langchain-community/src/load/import_map.ts b/libs/langchain-community/src/load/import_map.ts index d06053cbde26..06afe430b297 100644 --- a/libs/langchain-community/src/load/import_map.ts +++ b/libs/langchain-community/src/load/import_map.ts @@ -77,3 +77,4 @@ export * as utils__event_source_parse from "../utils/event_source_parse.js"; export * as experimental__callbacks__handlers__datadog from "../experimental/callbacks/handlers/datadog.js"; export * as experimental__graph_transformers__llm from "../experimental/graph_transformers/llm.js"; export * as experimental__chat_models__ollama_functions from "../experimental/chat_models/ollama_functions.js"; +export * as experimental__chat_models__chrome_ai from "../experimental/chat_models/chrome_ai/chat_models.js"; From 6aa2a9d43b9f92e323ea1c6c4402eaaef1bd5ed5 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Thu, 27 Jun 2024 16:57:08 -0700 Subject: [PATCH 14/15] nits --- .../src/experimental/chat_models/chrome_ai/app/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md index aa0cc34642b3..d16118000176 100644 --- a/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md +++ b/libs/langchain-community/src/experimental/chat_models/chrome_ai/app/README.md @@ -1,17 +1,18 @@ # ChatChromeAI This is a simple application designed to run in the browser that uses the webGPU and Gemini Nano. -Gemini Nano is a LLM which Google Chrome has embedded in the browser. As of 06/26/2024 it is still in beta. To request access or find more information, please visit [this link](https://developer.chrome.com/docs/ai/built-in). +Gemini Nano is a LLM which Google Chrome has embedded in the browser. As of 06/26/2024 it is still in beta. +To request access or find more information, please visit [this link](https://developer.chrome.com/docs/ai/built-in). ## Getting Started To run this application, you'll first need to build the locally dependencies. From the root of the `langchain-ai/langchainjs` repo, run the following command: ```bash -yarn build --filter=langchain --filter=@langchain/openai +yarn build --filter=@langchain/community --filter=@langchain/openai ``` -Once the dependencies are built, navigate into this directory (`langchain/src/experimental/chrome_ai/app`) and run the following command: +Once the dependencies are built, navigate into this directory (`libs/langchain-community/src/experimental/chat_models/chrome_ai/app`) and run the following commands: ```bash yarn install # install the dependencies From 33a04d675d97c0bbe32d904c0a439cb087c9cb25 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Thu, 27 Jun 2024 17:30:08 -0700 Subject: [PATCH 15/15] allow for custom prompt formatters --- .../experimental/chat_models/chrome_ai/chat_models.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts b/libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts index 79fe73493ef0..83c8e74171d3 100644 --- a/libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts +++ b/libs/langchain-community/src/experimental/chat_models/chrome_ai/chat_models.ts @@ -38,6 +38,10 @@ export const enum AIModelAvailability { export interface ChromeAIInputs extends BaseChatModelParams { topK?: number; temperature?: number; + /** + * An optional function to format the prompt before sending it to the model. + */ + promptFormatter?: (messages: BaseMessage[]) => string; } export interface ChromeAICallOptions extends BaseLanguageModelCallOptions {} @@ -81,6 +85,8 @@ export class ChatChromeAI extends SimpleChatModel { topK = 40; + promptFormatter: (messages: BaseMessage[]) => string; + static lc_name() { return "ChatChromeAI"; } @@ -92,6 +98,7 @@ export class ChatChromeAI extends SimpleChatModel { }); this.temperature = inputs?.temperature ?? this.temperature; this.topK = inputs?.topK ?? this.topK; + this.promptFormatter = inputs?.promptFormatter ?? formatPrompt; } _llmType() { @@ -142,7 +149,7 @@ export class ChatChromeAI extends SimpleChatModel { if (!this.session) { throw new Error("Session not found. Please call `.initialize()` first."); } - const textPrompt = formatPrompt(messages); + const textPrompt = this.promptFormatter(messages); const stream = this.session.promptStreaming(textPrompt); const iterableStream = IterableReadableStream.fromReadableStream(stream);