diff --git a/src/codeinterpreterapi/agents/structured_chat/agent.py b/src/codeinterpreterapi/agents/structured_chat/agent.py index d488d3a4..f956cd34 100644 --- a/src/codeinterpreterapi/agents/structured_chat/agent.py +++ b/src/codeinterpreterapi/agents/structured_chat/agent.py @@ -1,9 +1,9 @@ -from typing import List, Sequence, Union +from typing import Callable, List, Sequence, Union from langchain.agents.agent import AgentOutputParser from langchain.agents.format_scratchpad import format_log_to_str from langchain.agents.output_parsers import JSONAgentOutputParser -from langchain.tools.render import ToolsRenderer, render_text_description_and_args +from langchain.tools.render import render_text_description_and_args from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.chat import ChatPromptTemplate from langchain_core.runnables import Runnable, RunnableConfig, RunnablePassthrough @@ -15,6 +15,8 @@ from codeinterpreterapi.utils.runnable import create_complement_input from codeinterpreterapi.utils.runnable_history import assign_runnable_history +ToolsRenderer = Callable[[List[BaseTool]], str] + def create_structured_chat_agent_wrapper( ci_params: CodeInterpreterParams,