Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecate function #208

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/app/agent_types/openai_agent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

from langchain.tools import BaseTool
from langchain.tools.render import format_tool_to_openai_tool
from langchain_core.utils.function_calling import convert_to_openai_tool
from langchain_core.language_models.base import LanguageModelLike
from langchain_core.messages import SystemMessage, ToolMessage
from langgraph.checkpoint import BaseCheckpointSaver
Expand Down Expand Up @@ -33,7 +33,7 @@ async def _get_messages(messages):
return [SystemMessage(content=system_message)] + msgs

if tools:
llm_with_tools = llm.bind(tools=[format_tool_to_openai_tool(t) for t in tools])
llm_with_tools = llm.bind(tools=[convert_to_openai_tool(t) for t in tools])
else:
llm_with_tools = llm
agent = _get_messages | llm_with_tools
Expand Down