Two Speaker Conversation ======================== Source: ``examples/patterns/two_speaker_conversation.py`` Introduction ------------ AutoGen-style multi-agent conversations can externalize reasoning roles, Human-AI collaboration by design explains why role separation matters for oversight, and AI-assisted design synthesis work motivates structured dialogue in design ideation. This example implements a two-agent conversation loop with trace visibility at each turn. Technical Implementation ------------------------ 1. Configure ``Tracer`` with JSONL + console output so each run emits machine-readable traces and lifecycle logs. 2. Build the runtime surface (public APIs only) and execute ``TwoSpeakerConversationPattern.run(...)`` with a fixed ``request_id``. 3. Capture structured outputs from runtime execution and preserve termination metadata for analysis. 4. Print a compact JSON payload including ``trace_info`` for deterministic tests and docs examples. .. mermaid:: flowchart LR A["Input prompt or scenario"] --> B["main(): runtime wiring"] B --> C["TwoSpeakerConversationPattern.run(...)"] C --> D["turn-based conversation state drives each step"] C --> E["Tracer JSONL + console events"] D --> F["ExecutionResult/payload"] E --> F F --> G["Printed JSON output"] .. literalinclude:: ../../../examples/patterns/two_speaker_conversation.py :language: python :lines: 53- :linenos: Expected Results ---------------- .. rubric:: Run Command .. code-block:: bash PYTHONPATH=src python3 examples/patterns/two_speaker_conversation.py Example output shape (values vary by run): .. code-block:: text { "success": true, "final_output": "", "terminated_reason": "", "error": null, "trace": { "request_id": "", "trace_dir": "artifacts/examples/traces", "trace_path": "artifacts/examples/traces/run__.jsonl" } } References ---------- - `AutoGen `_ - `Human-AI collaboration by design `_ - `AI-assisted design synthesis and human creativity in engineering education `_