Docs: "Chat as a tool" multi-agent delegation recipe
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
Lee docs/tool-calling/how-it-works.qmd, las páginas adyacentes sobre tool-calling, docs/_quarto.yml y las definiciones de register_tool(), chat() y get_cost() en chatlas/_chat.py. Añade un artículo centrado o una sección acordada sobre la delegación entre múltiples agentes, enlazando issue #43 cuando corresponda, y verifica el ejemplo y la limitación documentada de la contabilidad de costes frente a la API actual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Motivation
Pydantic AI's agent-delegation pattern — one agent calls another agent via a tool call — covers most of the practical value people reach for "multi-agent frameworks" for, without needing a graph/orchestration layer. chatlas can already do this today with zero new API: register one Chat's .chat() method (wrapped in a closure with a docstring, exactly like any other tool) as a tool on another Chat via register_tool() (chatlas/_chat.py). This pattern currently isn't documented anywhere — not in docs/tool-calling/ (how-it-works.qmd, displays.qmd, approval.qmd) nor docs/misc/.
Proposed approach
Add a docs article, e.g. docs/tool-calling/multi-agent.qmd (added as a 4th entry to the existing "Tool calling" section in docs/_quarto.yml's sidebar, alongside how-it-works.qmd/displays.qmd/approval.qmd — that section is the natural home since this is fundamentally a tool-calling pattern, not new API).
Minimal accurate example to include (verified against _chat.py's register_tool/chat signatures):
from chatlas import ChatOpenAI
sql_specialist = ChatOpenAI(
system_prompt="You are a SQL expert. Given a natural-language question and a "
"table schema, write a single correct SQL query. Return only the query.",
)
def ask_sql_specialist(question: str, schema: str) -> str:
"""
Delegate a natural-language question to a SQL-writing specialist.
Parameters
----------
question
The natural-language question to translate into SQL.
schema
The relevant table schema(s) as DDL or a plain-text description.
"""
return str(sql_specialist.chat(f"Schema:\n{schema}\n\nQuestion: {question}", echo="none"))
coordinator = ChatOpenAI(system_prompt="You help users explore their data.")
coordinator.register_tool(ask_sql_specialist)
coordinator.chat("How many orders were placed last week? (orders table: id, placed_at, status)")
Points to cover in the article:
- System-prompt separation: the specialist gets its own focused system prompt; the coordinator's stays general. This is the main value over "one chat with many tools."
- Cost accounting across chats: each
Chathas its ownget_cost()(_chat.py); there is no combined/rollup accounting across a coordinator + specialist(s) today. State this plainly as a limitation — anyone wanting a total spend needs to sumcoordinator.get_cost() + sql_specialist.get_cost()themselves. - When to prefer this over one chat with many tools: when a sub-task needs a materially different system prompt, tool set, or even a different/cheaper model, or when you want to cap what context a sub-task is exposed to.
- Note
register_tool'smodel=parameter for cases where the specialist call needs more structured input than plain strings.
Alternatives / prior art
Related: #43 (a gallery/collection of common tool-calling recipes) — this could live as one gallery entry there instead of/in addition to a standalone article; worth cross-linking either way.
Open questions
- Standalone article vs. a section added to an existing tool-calling page?
- Should this also mention
to_solver()/InspectAI as a tangential way to evaluate sub-agents, or keep scope tight to the delegation pattern itself?
Drafted from a competitive review of llm / Pydantic AI / LangChain / LiteLLM (July 2026); filed via Claude Code on behalf of @cpsievert.
- Lenguaje dominante
- Python
- Estrellas
- 179
- Forks
- 32
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 10
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de posit-dev/chatlas
-
A streaming text delta that repeats everything streamed so far is missing from the recorded turnPosiblemente ocupada @cpsievert la tomó hace 81 días. Abiertoai-triage:done Priority: Medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
ai-triage:done Priority: Low
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
ai-triage:done Priority: Medium
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
posit-dev/chatlas#432 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de posit-dev/chatlas
Issues similares
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[TV SHOW]: Dynasty (1981)Abiertocountry:US rating:6 request-theme type:TV SHOW
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
LizardByte/ThemerrDB#10501 · 1 comentario ·
-
triage/confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
agentscope-ai/agentscope#4563 ·
Los mantenedores suelen responder en 2 días
-
comp/desktop desktop/chat P3 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
NousResearch/hermes-agent#164451 ·
Los mantenedores suelen responder en 1 día
-
external integration integration-submission
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
langchain-ai/docs#8426 ·
Los mantenedores suelen responder en 1 día