From 4a03d4bb2b307ca69e9069dcb06b8a3bce4c3e40 Mon Sep 17 00:00:00 2001 From: ehsan Date: Fri, 11 Sep 2026 17:07:27 -0700 Subject: [PATCH] Migrate to langchain >=0.1.0,<0.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **langchain.schema.*, langchain.prompts.*, langchain.callbacks.base, langchain.output_parsers (base)** → `langchain_core.{messages,documents,prompts,callbacks,output_parsers,runnables}` (2 sites): Base abstractions moved to langchain-core. Files touched: 1. Deterministic rewrites from a machine-readable MigrationSpec for this upgrade, then a review pass on the semantic residue; every changed file was parsed and checked with pyflakes for new undefined names before this PR was prepared. No behaviour beyond the migration was touched: no reformatting, no import reordering, no unrelated code. Happy to adjust anything — if the project deliberately pins the old major version, say so and I will close this. --- pyproject.toml | 4 +++- src/codeinterpreterapi/session.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97e474c..070cdb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,12 @@ version = "0.1.20" description = "CodeInterpreterAPI is an (unofficial) open source python interface for the ChatGPT CodeInterpreter." authors = [{ name = "Shroominic", email = "contact@shroominic.com" }] dependencies = [ - "langchain>=0.1, <0.2", + "langchain>=0.1", "langchain_openai", "codeboxapi==0.1.19", "pyzmq==25.1.2", + "langchain-community>=0.0.20", + "langchain-core>=0.1", ] license = { file = "LICENSE" } readme = "README.md" diff --git a/src/codeinterpreterapi/session.py b/src/codeinterpreterapi/session.py index 3ec1f01..f0a8310 100644 --- a/src/codeinterpreterapi/session.py +++ b/src/codeinterpreterapi/session.py @@ -15,8 +15,8 @@ ConversationalChatAgent, ) from langchain.agents.openai_functions_agent.base import OpenAIFunctionsAgent -from langchain.callbacks.base import Callbacks -from langchain.chat_models.base import BaseChatModel +from langchain_core.callbacks import Callbacks +from langchain_core.language_models import BaseChatModel from langchain.memory.buffer import ConversationBufferMemory from langchain_community.chat_message_histories.in_memory import ChatMessageHistory from langchain_community.chat_message_histories.postgres import (