Spaces:
Sleeping
Sleeping
Update agents/langgraph.py
#2
by
sahil-1-garg
- opened
- agents/langgraph.py +7 -1
agents/langgraph.py
CHANGED
|
@@ -28,6 +28,9 @@ def make_workflow(tool_func):
|
|
| 28 |
# Add feedback_context if available
|
| 29 |
if "feedback_context" in state:
|
| 30 |
tool_params["feedback_context"] = state["feedback_context"]
|
|
|
|
|
|
|
|
|
|
| 31 |
# Use .invoke() to avoid deprecation warning
|
| 32 |
result = tool_func.invoke(tool_params)
|
| 33 |
state["result"] = result
|
|
@@ -65,6 +68,9 @@ def run_workflow(file_path: str, kind: str, **kwargs) -> Dict[str, Any]:
|
|
| 65 |
)
|
| 66 |
# Add feedback_context if provided
|
| 67 |
if "feedback_context" in kwargs:
|
| 68 |
-
state["feedback_context"] = kwargs["feedback_context"]
|
|
|
|
|
|
|
|
|
|
| 69 |
final = workflows[kind].invoke(state)
|
| 70 |
return final
|
|
|
|
| 28 |
# Add feedback_context if available
|
| 29 |
if "feedback_context" in state:
|
| 30 |
tool_params["feedback_context"] = state["feedback_context"]
|
| 31 |
+
# Add user_api_key if available
|
| 32 |
+
if "user_api_key" in state:
|
| 33 |
+
tool_params["user_api_key"] = state["user_api_key"]
|
| 34 |
# Use .invoke() to avoid deprecation warning
|
| 35 |
result = tool_func.invoke(tool_params)
|
| 36 |
state["result"] = result
|
|
|
|
| 68 |
)
|
| 69 |
# Add feedback_context if provided
|
| 70 |
if "feedback_context" in kwargs:
|
| 71 |
+
state["feedback_context"] = kwargs["feedback_context"]
|
| 72 |
+
# Add user_api_key if provided
|
| 73 |
+
if "user_api_key" in kwargs:
|
| 74 |
+
state["user_api_key"] = kwargs["user_api_key"]
|
| 75 |
final = workflows[kind].invoke(state)
|
| 76 |
return final
|