Spaces:
Sleeping
Sleeping
tobyvertommen Claude Sonnet 4.6 commited on
Commit ·
df5ced9
1
Parent(s): 45b0018
Fix: use create_openai_tools_agent instead of create_tool_calling_agent
Browse filescreate_tool_calling_agent not available in installed langchain version.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from langchain_groq import ChatGroq
|
| 6 |
-
from langchain.agents import
|
| 7 |
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
|
| 8 |
from langchain_community.utilities import WikipediaAPIWrapper
|
| 9 |
from langchain_experimental.tools import PythonREPLTool
|
|
@@ -55,7 +55,7 @@ class BasicAgent:
|
|
| 55 |
("human", "{input}"),
|
| 56 |
MessagesPlaceholder("agent_scratchpad"),
|
| 57 |
])
|
| 58 |
-
agent =
|
| 59 |
self.executor = AgentExecutor(
|
| 60 |
agent=agent,
|
| 61 |
tools=tools,
|
|
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from langchain_groq import ChatGroq
|
| 6 |
+
from langchain.agents import create_openai_tools_agent, AgentExecutor
|
| 7 |
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
|
| 8 |
from langchain_community.utilities import WikipediaAPIWrapper
|
| 9 |
from langchain_experimental.tools import PythonREPLTool
|
|
|
|
| 55 |
("human", "{input}"),
|
| 56 |
MessagesPlaceholder("agent_scratchpad"),
|
| 57 |
])
|
| 58 |
+
agent = create_openai_tools_agent(llm, tools, prompt)
|
| 59 |
self.executor = AgentExecutor(
|
| 60 |
agent=agent,
|
| 61 |
tools=tools,
|