Commit Graph

15 Commits

Author SHA1 Message Date
Mery-Sanz 38c0d3c9cc restructure 2025-05-14 11:25:55 +02:00
Mery-Sanz 97f67c88cd new brnach 2025-05-14 11:18:48 +02:00
Víctor Mayoral Vilches 56479c5a01 Add minor updates in docs
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-05-12 11:48:24 +02:00
Víctor Mayoral Vilches d1fd6623e5 Merge remote-tracking branch 'origin/main' into cai 2025-03-31 13:21:34 +02:00
Víctor Mayoral Vilches ac4797cec6 Re-structure under sdk/agents, get CLI mockup
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-27 14:31:38 +01:00
Víctor Mayoral Vilches 21048444c6 Minor changes for alignment
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-26 18:55:21 +01:00
Víctor Mayoral Vilches adb358baae Update docs to integrate CAI, minor refinements
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-26 12:41:45 +01:00
Rohan Mehta 4c93a5d9b1 feat: Add Graphviz-based agent visualization functionality (#147)
This pull request introduces functionality for visualizing agent
structures using Graphviz. The changes include adding a new dependency,
implementing functions to generate and draw graphs, and adding tests for
these functions.

New functionality for visualizing agent structures:

* Added `graphviz` as a new dependency in `pyproject.toml`.
* Implemented functions in `src/agents/visualizations.py` to generate
and draw graphs for agents using Graphviz. These functions include
`get_main_graph`, `get_all_nodes`, `get_all_edges`, and `draw_graph`.

Testing the new visualization functionality:

* Added tests in `tests/test_visualizations.py` to verify the
correctness of the graph generation and drawing functions. The tests
cover `get_main_graph`, `get_all_nodes`, `get_all_edges`, and
`draw_graph`.

For example, given the following code:

```python
from agents import Agent, function_tool
from agents.visualizations import draw_graph


@function_tool
def get_weather(city: str) -> str:
    return f"The weather in {city} is sunny."


spanish_agent = Agent(
    name="Spanish agent",
    instructions="You only speak Spanish.",
)

english_agent = Agent(
    name="English agent",
    instructions="You only speak English",
)

triage_agent = Agent(
    name="Triage agent",
    instructions="Handoff to the appropriate agent based on the language of the request.",
    handoffs=[spanish_agent, english_agent],
    tools=[get_weather],
)


draw_graph(triage_agent)
```

Generates the following image:

<img width="614" alt="Screenshot 2025-03-13 at 18 36 23"
src="https://github.com/user-attachments/assets/d01fe502-6886-4efb-aaf8-c92e4524b0fe"
/>
2025-03-25 19:22:58 -04:00
Martín Bravo 650d151314 Add visualization.md to navigation in mkdocs.yml 2025-03-25 18:56:01 +01:00
Rohan Mehta a93ad02688 [4/n] Add docs for MCP
Just adding docs.
-
2025-03-25 13:25:50 -04:00
Víctor Mayoral Vilches 147fc8142e Initial re-structuring towards CAI
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-24 19:47:41 +01:00
Dominik Kundel 20f0793862 feat: add voice pipeline support
> Co-authored-by: rm@openai.com
2025-03-20 09:43:13 -07:00
Rohan Mehta 9d27b33cde Indentation for mkdocs.yml 2025-03-20 11:18:08 -04:00
jhills20 266359977d add examples section to docs 2025-03-19 11:43:09 -07:00
Rohan Mehta aaec57a426 Initial commit 2025-03-11 09:42:28 -07:00