Spaces:
Runtime error
Runtime error
Upload agent.py
Browse files
agent.py
CHANGED
|
@@ -279,7 +279,7 @@ tools = [
|
|
| 279 |
]
|
| 280 |
|
| 281 |
# Build graph function
|
| 282 |
-
def build_graph(provider: str = "
|
| 283 |
"""Build the graph"""
|
| 284 |
# Load environment variables from .env file
|
| 285 |
if provider == "openai":
|
|
@@ -307,8 +307,9 @@ def build_graph(provider: str = "groq"):
|
|
| 307 |
|
| 308 |
# Node
|
| 309 |
def assistant(state: MessagesState):
|
| 310 |
-
|
| 311 |
-
return {"messages": [llm_with_tools.invoke(
|
|
|
|
| 312 |
|
| 313 |
def retriever(state: MessagesState):
|
| 314 |
"""Retriever node"""
|
|
|
|
| 279 |
]
|
| 280 |
|
| 281 |
# Build graph function
|
| 282 |
+
def build_graph(provider: str = "anthropic"):
|
| 283 |
"""Build the graph"""
|
| 284 |
# Load environment variables from .env file
|
| 285 |
if provider == "openai":
|
|
|
|
| 307 |
|
| 308 |
# Node
|
| 309 |
def assistant(state: MessagesState):
|
| 310 |
+
messages_with_sys = [sys_msg] + state["messages"]
|
| 311 |
+
return {"messages": [llm_with_tools.invoke(messages_with_sys)]}
|
| 312 |
+
|
| 313 |
|
| 314 |
def retriever(state: MessagesState):
|
| 315 |
"""Retriever node"""
|