diff --git a/langchain/package.json b/langchain/package.json index be829a04e17b..9d74bf139303 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -907,7 +907,7 @@ "portkey-ai": "^0.1.11", "prettier": "^2.8.3", "puppeteer": "^19.7.2", - "pyodide": "0.24.1", + "pyodide": "^0.24.1", "redis": "^4.6.6", "release-it": "^15.10.1", "replicate": "^0.18.0", @@ -1012,7 +1012,7 @@ "playwright": "^1.32.1", "portkey-ai": "^0.1.11", "puppeteer": "^19.7.2", - "pyodide": "0.24.1", + "pyodide": "^0.24.1", "redis": "^4.6.4", "replicate": "^0.18.0", "sonix-speech-recognition": "^2.1.1", @@ -1277,6 +1277,9 @@ "puppeteer": { "optional": true }, + "pyodide": { + "optional": true + }, "redis": { "optional": true }, diff --git a/langchain/scripts/create-entrypoints.js b/langchain/scripts/create-entrypoints.js index 972c3cdc6482..c91db9bb8fee 100644 --- a/langchain/scripts/create-entrypoints.js +++ b/langchain/scripts/create-entrypoints.js @@ -326,7 +326,7 @@ const requiresOptionalDependency = [ "tools/sql", "tools/webbrowser", "tools/google_calendar", - "tools/pyinterpreter", + "tools/experimental/pyinterpreter", "callbacks/handlers/llmonitor", "chains/load", "chains/sql_db", diff --git a/langchain/src/tools/pyinterpreter.ts b/langchain/src/tools/experimental/pyinterpreter.ts similarity index 98% rename from langchain/src/tools/pyinterpreter.ts rename to langchain/src/tools/experimental/pyinterpreter.ts index 4320a6090176..84c511411e05 100644 --- a/langchain/src/tools/pyinterpreter.ts +++ b/langchain/src/tools/experimental/pyinterpreter.ts @@ -1,5 +1,5 @@ import { loadPyodide, PyodideInterface } from "pyodide"; -import { Tool } from "./base.js"; +import { Tool } from "../base.js"; export class PythonInterpreterTool extends Tool { static lc_name() { diff --git a/langchain/src/tools/index.ts b/langchain/src/tools/index.ts index 9baf617cf11a..b13f10dc3f5c 100644 --- a/langchain/src/tools/index.ts +++ b/langchain/src/tools/index.ts @@ -44,4 +44,3 @@ export { export { SearxngSearch } from "./searxng_search.js"; export { SearchApi, type SearchApiParameters } from "./searchapi.js"; export { formatToOpenAIFunction } from "./convert_to_openai.js"; -export { PythonInterpreterTool } from "./pyinterpreter.js"; diff --git a/langchain/src/tools/tests/pyinterpreter.test.ts b/langchain/src/tools/tests/pyinterpreter.test.ts index d9b63154c8d9..6f77105b433c 100644 --- a/langchain/src/tools/tests/pyinterpreter.test.ts +++ b/langchain/src/tools/tests/pyinterpreter.test.ts @@ -2,7 +2,7 @@ import { test, expect } from "@jest/globals"; import { StringOutputParser } from "../../schema/output_parser.js"; import { OpenAI } from "../../llms/openai.js"; import { PromptTemplate } from "../../prompts/index.js"; -import { PythonInterpreterTool } from "../pyinterpreter.js"; +import { PythonInterpreterTool } from "../experimental/pyinterpreter.js"; describe("Python Interpreter testsuite", () => { test("fibonacci sequence", async () => {