Skip to content

Commit 8e2e18d

Browse files
committed
Address PR review comments
- Remove hardcoded port 8101 from workflow_magenticone.py (EN+ES) - Revert Spanish agent/workflow names to English in workflow_fan_out_fan_in_edges, workflow_converge - Fix Run: -> Ejecutar: in Spanish workflow_magenticone.py - Improve summarizer comment in workflow_aggregator_summary (EN+ES) - Fix handoff output handling with get_outputs() guard in workflow_handoffbuilder_rules (EN+ES) - Bump max_iterations 8->20 in workflow_conditional_state (EN+ES) - Translate 'Please add a fix' to Spanish in workflow_aggregator_voting
1 parent 9dc9569 commit 8e2e18d

12 files changed

Lines changed: 31 additions & 25 deletions

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Each example .py file should have a corresponding file with the same name under
3737
* Identifiers (functions/classes/vars): English
3838
* User-facing output/data (e.g., example responses, sample values): Spanish
3939
* HITL control words: bilingual (approve/aprobar, exit/salir)
40-
* Agent or workflow names: Spanish ("Escritor" instead of "Writer")
40+
* Agent and workflow names: English ("TravelPlannerAgent" should be the same in both versions, not "AgentePlanificadorDeViajes")
4141

4242
Use informal (tuteo) LATAM Spanish, tu not usted, puedes not podes, etc. The content is technical so if a word is best kept in English, then do so.
4343

examples/spanish/workflow_aggregator_summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ async def run(self, results: list[AgentExecutorResponse], ctx: WorkflowContext[N
114114
),
115115
)
116116

117-
# El ejecutor resumidor envuelve un Agent para manejar el fan-in directamente —
118-
# formatea las salidas expertas recopiladas y sintetiza un brief.
117+
# El ejecutor resumidor envuelve un Agent que formatea las salidas
118+
# expertas recopiladas y las sintetiza en un brief ejecutivo conciso.
119119
summarizer = SummarizerExecutor(client=client)
120120

121121
workflow = (

examples/spanish/workflow_aggregator_voting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def main() -> None:
165165
# Caso claro: los tres deberían coincidir
166166
"La app se crashea cada vez que intento subir una foto. Código de error 500.",
167167
# Keyword → feature_request (add, wish), Sentiment → bug (angry), Intent → bug (fix broken)
168-
"Ojalá el botón de exportar funcionara. Please add a fix — ¡pierdo datos a diario!",
168+
"Ojalá el botón de exportar funcionara. Por favor agrega una solución — ¡pierdo datos a diario!",
169169
# Keyword → bug (error, fail), Sentiment → feature_request (hopeful), Intent → feature_request (new ability)
170170
"La búsqueda actual falla con consultas largas — estaría increíble si pudieras agregar fuzzy matching.",
171171
]

examples/spanish/workflow_conditional_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def publisher(_response: AgentExecutorResponse, ctx: WorkflowContext[Never
140140
# add_edge(reviewer, editor, condition=needs_revision) se activa cuando needs_revision() retorna True.
141141
# add_edge(editor, reviewer) crea un bucle acotado de revisión-edición.
142142
workflow = (
143-
WorkflowBuilder(start_executor=writer, max_iterations=8)
143+
WorkflowBuilder(start_executor=writer, max_iterations=20)
144144
.add_edge(writer, store_post_text)
145145
.add_edge(store_post_text, reviewer)
146146
.add_edge(reviewer, publisher, condition=is_approved)

examples/spanish/workflow_converge.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ def parse_review_result(message: Any) -> ReviewResult | None:
6363
return message.agent_response.value
6464

6565

66-
def esta_aprobado(message: Any) -> bool:
66+
def is_approved(message: Any) -> bool:
6767
"""Verifica si el contenido está aprobado (alta calidad)."""
6868
result = parse_review_result(message)
6969
return result is not None and result.score >= 80
7070

7171

72-
def necesita_edicion(message: Any) -> bool:
72+
def needs_editing(message: Any) -> bool:
7373
"""Enruta al editor cuando la calidad está debajo del umbral."""
7474
result = parse_review_result(message)
7575
return result is not None and result.score < 80
7676

7777

7878
writer = Agent(
7979
client=client,
80-
name="Escritor",
80+
name="Writer",
8181
instructions=(
8282
"Eres un excelente escritor de contenido. "
8383
"Crea contenido claro y atractivo basado en la solicitud del usuario. "
@@ -88,7 +88,7 @@ def necesita_edicion(message: Any) -> bool:
8888

8989
reviewer = Agent(
9090
client=client,
91-
name="Revisor",
91+
name="Reviewer",
9292
instructions=(
9393
"Eres un experto revisor de contenido. "
9494
"Evalúa el contenido del escritor basándote en:\n"
@@ -119,7 +119,7 @@ def necesita_edicion(message: Any) -> bool:
119119

120120
publisher = Agent(
121121
client=client,
122-
name="Publicador",
122+
name="Publisher",
123123
instructions=(
124124
"Eres un agente de publicación. "
125125
"Recibes contenido aprobado o editado. "
@@ -129,7 +129,7 @@ def necesita_edicion(message: Any) -> bool:
129129

130130
summarizer = Agent(
131131
client=client,
132-
name="Resumidor",
132+
name="Summarizer",
133133
instructions=(
134134
"Eres un agente resumidor. "
135135
"Crea un informe de publicación final que incluya:\n"
@@ -143,13 +143,13 @@ def necesita_edicion(message: Any) -> bool:
143143

144144
workflow = (
145145
WorkflowBuilder(
146-
name="FlujoConvergenteContenido",
146+
name="ContentConverge",
147147
start_executor=writer,
148148
description="Rutas condicionales que convergen antes del resumen final.",
149149
)
150150
.add_edge(writer, reviewer)
151-
.add_edge(reviewer, publisher, condition=esta_aprobado)
152-
.add_edge(reviewer, editor, condition=necesita_edicion)
151+
.add_edge(reviewer, publisher, condition=is_approved)
152+
.add_edge(reviewer, editor, condition=needs_editing)
153153
.add_edge(editor, publisher)
154154
.add_edge(publisher, summarizer)
155155
.build()

examples/spanish/workflow_fan_out_fan_in_edges.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def aggregate(
105105

106106
researcher = Agent(
107107
client=client,
108-
name="Investigador",
108+
name="Researcher",
109109
instructions=(
110110
"Eres un investigador de mercado experto. "
111111
"Dado el prompt, proporciona insights factuales concisos, oportunidades y riesgos. "
@@ -115,7 +115,7 @@ async def aggregate(
115115

116116
marketer = Agent(
117117
client=client,
118-
name="Estratega",
118+
name="Marketer",
119119
instructions=(
120120
"Eres un estratega de marketing. "
121121
"Dado el prompt, propone una propuesta de valor clara y mensajes para la audiencia. "
@@ -137,7 +137,7 @@ async def aggregate(
137137

138138
workflow = (
139139
WorkflowBuilder(
140-
name="AristasDispersionReunion",
140+
name="FanOutFanInEdges",
141141
description="Explicit fan-out/fan-in using edge groups.",
142142
start_executor=dispatcher,
143143
output_executors=[aggregator],

examples/spanish/workflow_handoffbuilder_rules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ async def main() -> None:
130130
logger.info("Solicitud: %s\n", request)
131131

132132
result = await workflow.run(request)
133-
print(result[-1].text)
133+
# El workflow de handoff devuelve la conversación completa como list[Message]
134+
for output in result.get_outputs():
135+
if isinstance(output, list):
136+
print(output[-1].text)
134137

135138
if async_credential:
136139
await async_credential.close()

examples/spanish/workflow_magenticone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Este ejemplo muestra cómo un manager Magentic coordina tres especialistas para
44
crear un plan de viaje, con salida en streaming y eventos del ledger de orquestación.
55
6-
Run:
6+
Ejecutar:
77
uv run examples/spanish/workflow_magenticone.py
88
uv run examples/spanish/workflow_magenticone.py --devui
99
"""
@@ -196,6 +196,6 @@ async def main() -> None:
196196
if "--devui" in sys.argv:
197197
from agent_framework.devui import serve
198198

199-
serve(entities=[magentic_workflow], port=8101, auto_open=True)
199+
serve(entities=[magentic_workflow], auto_open=True)
200200
else:
201201
asyncio.run(main())

examples/workflow_aggregator_summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ async def run(self, results: list[AgentExecutorResponse], ctx: WorkflowContext[N
114114
),
115115
)
116116

117-
# The summarizer Executor wraps an Agent to handle fan-in directly —
118-
# it formats the collected expert outputs and synthesizes a brief.
117+
# The summarizer Executor wraps an Agent that formats the collected
118+
# expert outputs and synthesizes them into a concise executive brief.
119119
summarizer = SummarizerExecutor(client=client)
120120

121121
workflow = (

examples/workflow_conditional_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def publisher(response: AgentExecutorResponse, ctx: WorkflowContext[Never,
140140
# add_edge(reviewer, editor, condition=needs_revision) fires when needs_revision() returns True.
141141
# add_edge(editor, reviewer) creates a bounded revise-review loop.
142142
workflow = (
143-
WorkflowBuilder(start_executor=writer, max_iterations=8)
143+
WorkflowBuilder(start_executor=writer, max_iterations=20)
144144
.add_edge(writer, store_post_text)
145145
.add_edge(store_post_text, reviewer)
146146
.add_edge(reviewer, publisher, condition=is_approved)

0 commit comments

Comments
 (0)