Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
@@ -1104,7 +1104,12 @@ def build_graph(vector_store, provider: str, model_config: dict) -> StateGraph:
|
|
1104 |
global tool_map
|
1105 |
tool_map = {t.name: t for t in tools}
|
1106 |
|
1107 |
-
|
|
|
|
|
|
|
|
|
|
|
1108 |
sys_msg = SystemMessage(content="You are a helpful assistant.")
|
1109 |
|
1110 |
retriever = RunnableLambda(lambda state: {
|
|
|
1104 |
global tool_map
|
1105 |
tool_map = {t.name: t for t in tools}
|
1106 |
|
1107 |
+
if hasattr(llm, "bind_tools"):
|
1108 |
+
llm_with_tools = llm.bind_tools(tools)
|
1109 |
+
else:
|
1110 |
+
llm_with_tools = llm # fallback: no tool binding
|
1111 |
+
|
1112 |
+
|
1113 |
sys_msg = SystemMessage(content="You are a helpful assistant.")
|
1114 |
|
1115 |
retriever = RunnableLambda(lambda state: {
|