Spaces:
Paused
Paused
Soham Waghmare
commited on
Commit
·
85d5551
1
Parent(s):
ed16911
feat: skeleton for true agentic deep research
Browse files
langgraph_backend/agent_tools.py
CHANGED
|
@@ -85,9 +85,14 @@ async def invoke_agent(message: str, thread_id: str, idx_retry: int = 1, create_
|
|
| 85 |
for m in event["agent"]["messages"]
|
| 86 |
]
|
| 87 |
if not event["agent"]["messages"][0].additional_kwargs:
|
|
|
|
| 88 |
response = [
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
for m in event["agent"]["messages"]
|
| 92 |
]
|
| 93 |
|
|
|
|
| 85 |
for m in event["agent"]["messages"]
|
| 86 |
]
|
| 87 |
if not event["agent"]["messages"][0].additional_kwargs:
|
| 88 |
+
history = [f"{m.type}:\n{m.content}" for m in agent.get_state({"configurable": {"thread_id": "1234"}}).values["messages"]]
|
| 89 |
response = [
|
| 90 |
+
{
|
| 91 |
+
"type": "ai_msg_report",
|
| 92 |
+
"content": gen_report("\n\n".join(history), message),
|
| 93 |
+
"total_tokens": m.usage_metadata["total_tokens"],
|
| 94 |
+
"tool_calls": m.tool_calls,
|
| 95 |
+
}
|
| 96 |
for m in event["agent"]["messages"]
|
| 97 |
]
|
| 98 |
|