mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-07 23:02:39 +02:00
Coerce deliverables thread_id and invoke domain agents asynchronously.
This commit is contained in:
parent
5bc33626b9
commit
8f8d7540f0
3 changed files with 30 additions and 8 deletions
|
|
@ -107,10 +107,10 @@ def _normalize_domain_output(spec: DomainRoutingSpec, raw_text: str) -> str:
|
|||
|
||||
def _routing_tool_for_spec(spec: DomainRoutingSpec) -> BaseTool:
|
||||
@tool(spec.tool_name, description=spec.description)
|
||||
def _route(task: str) -> str:
|
||||
async def _route(task: str) -> str:
|
||||
curated = spec.curated_context(task) if spec.curated_context else None
|
||||
content = compose_child_task(task, curated_context=curated)
|
||||
result = spec.domain_agent.invoke(
|
||||
result = await spec.domain_agent.ainvoke(
|
||||
{"messages": [{"role": "user", "content": content}]},
|
||||
)
|
||||
return _normalize_domain_output(spec, extract_last_assistant_text(result))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue