Spaces:
Running
Running
Daniel Amendoeira
commited on
Update agent.py
Browse files
agent.py
CHANGED
@@ -15,10 +15,21 @@ from .prompt import system_prompt
|
|
15 |
# gpt-4.1-nano (cheaper for debugging) with temperature 0 for less randomness
|
16 |
# for benchmarking use gpt-4.1-mini or 04-mini
|
17 |
|
18 |
-
llm = ChatOpenAI(
|
|
|
|
|
|
|
19 |
|
|
|
|
|
20 |
search_tool = BraveSearch.from_api_key(
|
21 |
api_key=os.getenv("BRAVE_SEARCH_API"),
|
22 |
search_kwargs={"count": 4}, # returns the 4 best results and their URL
|
23 |
description="Web search using Brave"
|
24 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# gpt-4.1-nano (cheaper for debugging) with temperature 0 for less randomness
|
16 |
# for benchmarking use gpt-4.1-mini or 04-mini
|
17 |
|
18 |
+
llm = ChatOpenAI(
|
19 |
+
model="gpt-4.1-nano",
|
20 |
+
temperature=0
|
21 |
+
)
|
22 |
|
23 |
+
calculator_tool = Calculator()
|
24 |
+
python_tool = PythonAstREPLTool()
|
25 |
search_tool = BraveSearch.from_api_key(
|
26 |
api_key=os.getenv("BRAVE_SEARCH_API"),
|
27 |
search_kwargs={"count": 4}, # returns the 4 best results and their URL
|
28 |
description="Web search using Brave"
|
29 |
+
)
|
30 |
+
|
31 |
+
community_tools = [calculator_tool, python_tool, search_tool]
|
32 |
+
custom_tools = [datetime_tools, transcribe_audio_tool].
|
33 |
+
|
34 |
+
tools = community_tools + custom_tools
|
35 |
+
llm_with_tools = llm.bind_tools(tools)
|