wt002 commited on
Commit
7a08145
·
verified ·
1 Parent(s): 44e4111

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +6 -1
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
- llm_with_tools = llm.bind_tools(tools)
 
 
 
 
 
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: {