mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-19 18:45:15 +02:00
multi_agent_chat/main_agent: one specialist per task; advertise write_todos for multi-turn plans
This commit is contained in:
parent
379cc992f4
commit
6b60d324a3
4 changed files with 42 additions and 16 deletions
|
|
@ -5,5 +5,8 @@ from __future__ import annotations
|
|||
from langchain.agents.middleware import TodoListMiddleware
|
||||
|
||||
|
||||
def build_todos_mw() -> TodoListMiddleware:
|
||||
return TodoListMiddleware()
|
||||
def build_todos_mw(*, system_prompt: str | None = None) -> TodoListMiddleware:
|
||||
"""Pass ``system_prompt=""`` to suppress the upstream prompt append. We use a custom system prompt in the main agent."""
|
||||
if system_prompt is None:
|
||||
return TodoListMiddleware()
|
||||
return TodoListMiddleware(system_prompt=system_prompt)
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ def build_main_agent_deepagent_middleware(
|
|||
stack: list[Any] = [
|
||||
build_busy_mutex_mw(flags),
|
||||
build_otel_mw(flags),
|
||||
build_todos_mw(),
|
||||
build_todos_mw(system_prompt=""),
|
||||
memory_mw,
|
||||
build_anonymous_doc_mw(
|
||||
filesystem_mode=filesystem_mode, anon_session_id=anon_session_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue