Spaces:
Sleeping
Sleeping
Update pipeline.py
Browse files- pipeline.py +29 -8
pipeline.py
CHANGED
@@ -41,7 +41,22 @@ from mistralai import Mistral
|
|
41 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
42 |
|
43 |
# Web search
|
44 |
-
from smolagents import DuckDuckGoSearchTool, ManagedAgent, HfApiModel, CodeAgent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
# Import new prompts
|
47 |
from prompts import (
|
@@ -217,14 +232,20 @@ def do_web_search(query: str) -> str:
|
|
217 |
return cached
|
218 |
|
219 |
logger.info("Performing a new web search for: '%s'", query)
|
220 |
-
model = HfApiModel()
|
221 |
-
search_tool = DuckDuckGoSearchTool()
|
222 |
-
web_agent = CodeAgent(tools=[search_tool], model=model)
|
223 |
|
224 |
-
managed_web_agent = ManagedAgent(
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
)
|
229 |
|
230 |
manager_agent = CodeAgent(
|
|
|
41 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
42 |
|
43 |
# Web search
|
44 |
+
# from smolagents import DuckDuckGoSearchTool, ManagedAgent, HfApiModel, CodeAgent
|
45 |
+
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
46 |
+
from phoenix.otel import register
|
47 |
+
|
48 |
+
|
49 |
+
register()
|
50 |
+
SmolagentsInstrumentor().instrument(skip_dep_check=True)
|
51 |
+
|
52 |
+
|
53 |
+
from smolagents import (
|
54 |
+
CodeAgent,
|
55 |
+
DuckDuckGoSearchTool,
|
56 |
+
HfApiModel,
|
57 |
+
ToolCallingAgent,
|
58 |
+
VisitWebpageTool,
|
59 |
+
)
|
60 |
|
61 |
# Import new prompts
|
62 |
from prompts import (
|
|
|
232 |
return cached
|
233 |
|
234 |
logger.info("Performing a new web search for: '%s'", query)
|
235 |
+
# model = HfApiModel()
|
236 |
+
# search_tool = DuckDuckGoSearchTool()
|
237 |
+
# web_agent = CodeAgent(tools=[search_tool], model=model)
|
238 |
|
239 |
+
# managed_web_agent = ManagedAgent(
|
240 |
+
# agent=web_agent,
|
241 |
+
# name="web_search",
|
242 |
+
# description="Runs a web search. Provide your query."
|
243 |
+
# )
|
244 |
+
search_agent = ToolCallingAgent(
|
245 |
+
tools=[DuckDuckGoSearchTool(), VisitWebpageTool()],
|
246 |
+
model=HfApiModel(),
|
247 |
+
name="search_agent",
|
248 |
+
description="This is an agent that can do web search.",
|
249 |
)
|
250 |
|
251 |
manager_agent = CodeAgent(
|