Commit Graph

154 Commits

Author SHA1 Message Date
Mery-Sanz 9991b89af5 add tree 2025-05-14 13:40:25 +02:00
lidia9 3844dc57ae modifs 2025-05-14 13:37:20 +02:00
Mery-Sanz 9ecd81b4e9 update /load 2025-05-14 13:16:37 +02:00
Mery-Sanz b3458a3fa0 tree 2025-05-14 13:00:23 +02:00
lidia9 f4d83f1a15 modifs 2025-05-14 12:59:21 +02:00
Mery-Sanz 7690f9a942 add patterns 2025-05-14 12:37:39 +02:00
lidia9 bdb67e3faa modifs 2025-05-14 12:19:51 +02:00
Mery-Sanz 30f3b40e60 review doc 2025-05-14 12:14:33 +02:00
lidia9 465e9d3605 modif 2025-05-14 12:11:23 +02:00
Mery-Sanz a28dd413af Merge branch 'docs_new' of https://gitlab.com/aliasrobotics/alias_research/cai into docs_new 2025-05-14 12:06:17 +02:00
Mery-Sanz ea3cf8bcaf tools api 2025-05-14 12:06:08 +02:00
lidia9 007a989137 dev 2025-05-14 12:05:30 +02:00
lidia9 87538793d4 modifs 2025-05-14 11:59:02 +02:00
lidia9 00671adacd modifs 2025-05-14 11:56:27 +02:00
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 5b29fbe4db Fix docs
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-04-02 16:48:23 +02:00
Víctor Mayoral Vilches d1fd6623e5 Merge remote-tracking branch 'origin/main' into cai 2025-03-31 13:21:34 +02:00
Eric Peter e891dfc314 Databricks MLflow tracing integration (#401) 2025-03-30 23:53:09 -04:00
Víctor Mayoral Vilches f0b93aec91 Fix paths in docs
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-28 08:35:25 +01:00
Víctor Mayoral Vilches f18e659ec8 Fix docs
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-03-28 07:55:41 +01:00
Ali Waleed 4c40fec70f Add Langtrace to `tracing.md` (#371) 2025-03-27 21:33:49 -04: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
Rohan Mehta 1c8e9a55db Tracing screenshot for MCP docs (#355) 2025-03-26 10:56:34 -07: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
Rohan Mehta db13026c0e Update visualization.md 2025-03-25 13:34:45 -04:00
Martín Bravo 8ba7b0932f Update installation instructions for visualization dependency to use 'viz' 2025-03-25 18:29:55 +01:00
Rohan Mehta 944b730da9 Make the reset behavior on tool use configurable
## Summary:

#263 added this behavior. The goal was to prevent infinite loops when tool choice was set. The key change I'm making is:
1. Making it configurable on the agent.
2. Doing bookkeeping in the Runner to track this, to prevent mutating agents.
3. Not resetting the global tool choice in RunConfig.

## Test Plan:
Unit tests.
.
2025-03-25 13:29:32 -04:00
Rohan Mehta a93ad02688 [4/n] Add docs for MCP
Just adding docs.
-
2025-03-25 13:25:50 -04:00
Martín Bravo 1ec5c2e233 Merge branch 'main' of https://github.com/openai/openai-agents-python into feat/draw_graph 2025-03-25 16:58:01 +01:00
Rohan Mehta 69907b8eed Fix potential infinite tool call loop by resetting tool_choice after … (#263)
# Fix potential infinite tool call loop by resetting tool_choice after
tool execution

## Summary

This PR fixes an issue where setting `tool_choice` to "required" or a
specific function name could cause models to get stuck in an infinite
tool call loop.

When `tool_choice` is set to force tool usage, this setting persists
across model invocations. This PR automatically resets `tool_choice` to
"auto" after tool execution, allowing the model to decide whether to
make additional tool calls in subsequent turns.

Unlike using `tool_use_behavior="stop_on_first_tool"`, this approach
lets the model continue processing tool results while preventing forced
repeated tool calls.

## Test plan

- Added tests to verify tool_choice reset behavior for both agent and
run_config settings
- Added integration test to verify the solution prevents infinite loops
- All tests pass

## Checks

- [x] I've added new tests for the fix
- [x] I've updated the relevant documentation (added comment in code)
- [x] I've run `make lint` and `make format`
- [x] I've made sure tests pass
2025-03-25 11:30:53 -04:00
Rohan Mehta 9f5ebd0e18 Update quickstart.md 2025-03-23 17:56:55 -04:00
xianghuijin b6ed16686b docs: Update tool_choice reset documentation to match implementation 2025-03-22 14:22:47 +08:00
Rohan Mehta 84e3c22645 Fix code examples in voice pipeline quickstart docs (#277) 2025-03-21 21:44:14 -04:00
Rohan Mehta 7af3f82a18 [docs] fix annotation numbering in context management (#293)
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 19:33:30 -04:00
Scott Condron 849aed4f3a Add Weights & Biases to tracing docs 2025-03-21 21:37:54 +00:00
Han Hwang Lim b2e04bef06 fix annotation numbering in context management
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 21:10:30 +00:00
James Hills 860eddd749 fix line in guardrails 2025-03-21 15:58:34 -04:00
Rohan Mehta caa3c6c856 docs: add Langfuse to tracing documentation (#284) 2025-03-21 10:31:05 -04:00
Jannik Maierhöfer d0e25ad1e3 docs: add Langfuse to tracing documentation 2025-03-21 13:39:17 +01:00
Pepijn a32dc7825c Fix voice pipeline code examples in quickstart docs 2025-03-21 06:47:12 +01:00
Sir Qasim 56f53caa36 fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline in quickstart.md
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,

remove extra "," from the first line
2025-03-21 06:58:47 +05:00
Kazuhiro Sera 4bc92307d8 Make the optional dependency installation compatible with zsh 2025-03-21 10:01:24 +09:00
Rohan Mehta bba8ba5406 Updating tracing doc for new spans (#272) 2025-03-20 20:05:42 -04:00
Dmitry Pimenov 9dabf96fe8 fixing object path 2025-03-20 17:03:52 -07:00
Yoshinori Sano d212b0d0e7 [doc] fix invalid imports 2025-03-21 08:37:45 +09:00
Dmitry Pimenov 3e8103ad72 removing erroneous changes 2025-03-20 15:53:41 -07:00
Dominik Kundel 20f0793862 feat: add voice pipeline support
> Co-authored-by: rm@openai.com
2025-03-20 09:43:13 -07:00
xianghuijin 5f430076a3 Update documentation for tool_choice auto-reset feature 2025-03-20 21:49:38 +08:00
James Hills 3de6c69f25 formatting updates to examples doc 2025-03-19 14:23:28 -07:00
jhills20 266359977d add examples section to docs 2025-03-19 11:43:09 -07:00
Rohan Mehta 4d6edb9eb9 chore(docs): Added comet opik to tracing AND formatted into a list (#73)
Comet Opik added support for Agent SDK tracing and should be included.
2025-03-19 12:31:02 -04:00
Rohan Mehta de5710f229 Introduce tool_use_behavior on agents (#203)
## Context
By default, the outputs of tools are sent to the LLM again. The LLM gets
to read the outputs, and produce a new response. There are cases where
this is not desired:
1. Every tool results in another round trip, and sometimes the output of
the tool is enough.
2. If you force tool use (via model settings `tool_choice=required`),
then the agent will just infinite loop.

This enables you to have different behavior, e.g. use the first tool
output as the final output, or write a custom function to process tool
results and potentially produce an output.

## Test plan
Added new tests and ran existing tests
Also added examples.


Closes #117
2025-03-19 12:27:02 -04:00
Vincent Koc ef3f1d73b5 Merge branch 'main' into patch-1 2025-03-20 02:57:34 +11:00
CCM b642cd4506 fix reasoning order in guardrails.md 2025-03-19 11:10:58 +08:00
Rohan Mehta c91db09d3c Introduce tool_use_behavior on agents 2025-03-18 21:55:12 -04:00
Dmitry Pimenov 11ce7c9995 chore: adds Maxim AI to tracing processors (#210) 2025-03-18 09:10:52 -07:00
Martín Bravo 3521ab0e48 feat: add documentation for agent visualization using Graphviz 2025-03-18 09:55:23 +01:00
B-Step62 aeb6917e17 [doc] add mlflow tracing integration
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
2025-03-18 11:29:21 +09:00
Akshay Deo 5b86a4eadc chore: adds Maxim AI to tracing processors 2025-03-18 07:49:33 +05:30
Martín Bravo dba2d4bd23 Merge branch 'main' of https://github.com/openai/openai-agents-python into feat/draw_graph 2025-03-17 23:50:52 +01:00
Rohan Mehta 2cccc61118 docs: add arize-phoenix to tracing documentation (#169) 2025-03-17 15:58:28 -04:00
Rohan Mehta 4bb506e16b docs: List LangSmith tracing integration (#197)
LangChain employee/maintainer, happy to make edits to our
docs/integrations if needed.
2025-03-17 15:58:20 -04:00
Dmitry Pimenov 807e95681f Update tracing docs (#204)
Update the README to point to the list of tracing processors. The docs
will contain all the external processors, so the readme doesn't get too
long.
2025-03-17 12:02:44 -07:00
Rohan Mehta 18397319e2 Update tracing docs 2025-03-17 14:57:43 -04:00
James Hills ff0af156bd Update tracing.md
Add callout for ZDR intracing
2025-03-17 09:13:22 -07:00
Bagatur f96d352142 docs: List LangSmith tracing integration 2025-03-17 08:47:28 -07:00
MartinEBravo 4dc9b6712e Merge branch 'main' of https://github.com/openai/openai-agents-python into feat/draw_graph 2025-03-17 10:17:36 +01:00
Alexander Song add02a9f9c docs: add arize-phoenix to tracing documentation 2025-03-14 17:50:10 -07:00
Vincent Koc 33693eccb0 Merge branch 'main' into patch-1 2025-03-14 05:33:08 +11:00
Martín Bravo 9edf335258 Add documentation and example for agent visualization using Graphviz 2025-03-13 18:48:12 +01:00
Rohan Mehta d60e7f48fc Update model docs with common issues 2025-03-13 13:43:18 -04:00
Rohan Mehta b2dc3e7ac9 Add examples and documentation for using custom model providers (#110) 2025-03-13 08:17:25 -07:00
Rohan Mehta e881d72d38 Add examples and documentation for using custom model providers 2025-03-12 17:34:38 -07:00
Dare 0b4ff9b7e5 Merge branch 'main' into main 2025-03-12 17:24:39 -07:00
Dingkang Wang 2acac3e0db fix typo in tracing.md 2025-03-12 14:54:11 -07:00
Vincent Koc 61cce7930f Update tracing.md 2025-03-13 07:56:27 +11:00
Vincent Koc 2c62f0a030 Merge branch 'main' into patch-1 2025-03-13 07:53:07 +11:00
Dmitry Pimenov 5ccc113084 Merge pull request #104 from openai/readme/new-trace-provider
Adding Keywords AI as a trace processor
2025-03-12 13:33:02 -07:00
Rohan Mehta c5174861f1 Merge pull request #84 from leykun10/fix-doc-error
Replace undefined variable name in documentation code snippet
2025-03-12 13:31:12 -07:00
Dmitry Pimenov 4f842cfec2 adding Keywords AI as a trace processor 2025-03-12 13:15:53 -07:00
jhills20 737dcedc79 use @function_tool decorator in docs 2025-03-12 11:15:42 -07:00
Vincent Koc 4e00f5677c Update tracing.md 2025-03-12 23:26:57 +11:00
leykun10 d152c9c51d fix: replace undefined variable name in documentation code snippet 2025-03-12 15:07:56 +03:00
Dare 911bdefd6a Update tracing.md 2025-03-12 04:46:05 -07:00
Dare 9cda36b3c2 Adding link to docs on Scorecard AgentSDK Support
Incredibly excited to add support the agentsdk for Scorecard tracing!
2025-03-12 04:43:50 -07:00
Vincent Koc 5a927bf1d9 chore(docs): Update tracing.md 2025-03-12 20:46:54 +11:00
Rohan Mehta e732428b9e Merge pull request #57 from sumitaryal/fix-typo-models.md
Fix typo in models.md
2025-03-11 22:33:33 -07:00
sumitaryal 06547f43e9 fix: Added missing space after 'the' for better clarity 2025-03-12 11:04:29 +05:45
sumitaryal 981c6d83e7 fix: Removed the repeated the 2025-03-12 11:03:28 +05:45
sumitaryal 5c59e2dcfc fix: hyphenated compound adjective out of the box -> out-of-the-box for clarity 2025-03-12 11:03:03 +05:45
sumitaryal 49f3deda6a fix: hyphenated compound adjective real world -> real-world for clarity 2025-03-12 10:48:29 +05:45
sumitaryal e8bd872340 fix: hyphenated compound adjective easy to use -> easy-to-use for clarity 2025-03-12 10:47:48 +05:45
Rohan Mehta de310e2692 Merge pull request #45 from junjzhang/typo_fix
fix typo in docs of configuring custom client
2025-03-11 21:46:42 -07:00
Junjie_ZHANG 30fb6e57a3 fix typo 2025-03-12 11:24:12 +08:00
Matthew Ford e9b090d780 Update quickstart.md
Add an example that works before the guard, so people don't think the task just failed.
2025-03-12 00:48:29 +00:00
Ali Yaman 3a94e4ece9 docs: Fix typos in documentation files 2025-03-12 00:12:31 +01:00
Ali Yaman ecf4beab9f docs: clarify multi-agent orchestration description 2025-03-11 23:57:03 +01:00