Skip to content

Commit dd64ed5

Browse files
committed
Update tracing docs
1 parent cdbf6b0 commit dd64ed5

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ The Agents SDK is designed to be highly flexible, allowing you to model a wide r
142142

143143
## Tracing
144144

145-
The Agents SDK automatically traces your agent runs, making it easy to track and debug the behavior of your agents. Tracing is extensible by design, supporting custom spans and a wide variety of external destinations, including [Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents), [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk), [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk), [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration), and [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent). For more details about how to customize or disable tracing, see [Tracing](http://openai.github.io/openai-agents-python/tracing).
145+
The Agents SDK automatically traces your agent runs, making it easy to track and debug the behavior of your agents. Tracing is extensible by design, supporting custom spans and a wide variety of external destinations, including [Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents), [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk), [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk), [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration), and [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent). For more details about how to customize or disable tracing, see [Tracing](http://openai.github.io/openai-agents-python/tracing), which also includes a larger list of [external tracing processors](http://openai.github.io/openai-agents-python/tracing/#external-tracing-processors-list).
146146

147147
## Development (only needed if you need to edit the SDK/examples)
148148

Diff for: docs/tracing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ To customize this default setup, to send traces to alternative or additional bac
8888
1. [`add_trace_processor()`][agents.tracing.add_trace_processor] lets you add an **additional** trace processor that will receive traces and spans as they are ready. This lets you do your own processing in addition to sending traces to OpenAI's backend.
8989
2. [`set_trace_processors()`][agents.tracing.set_trace_processors] lets you **replace** the default processors with your own trace processors. This means traces will not be sent to the OpenAI backend unless you include a `TracingProcessor` that does so.
9090

91-
External trace processors include:
91+
## External tracing processors list
9292

9393
- [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk)
9494
- [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents)
9595
- [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk)
96-
- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration))
96+
- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration)
9797
- [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent)

Diff for: examples/tools/computer_use.py

+23-11
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,29 @@
2323

2424
async def main():
2525
async with LocalPlaywrightComputer() as computer:
26+
input_items = [
27+
{
28+
"role": "user",
29+
"content": "Browse wikipedia, and keep clicking on the first link you see until you find the page about Stephen Hawking. Don't search, just click.",
30+
}
31+
]
2632
with trace("Computer use example"):
27-
agent = Agent(
28-
name="Browser user",
29-
instructions="You are a helpful agent.",
30-
tools=[ComputerTool(computer)],
31-
# Use the computer using model, and set truncation to auto because its required
32-
model="computer-use-preview",
33-
model_settings=ModelSettings(truncation="auto"),
34-
)
35-
result = await Runner.run(agent, "Search for SF sports news and summarize.")
36-
print(result.final_output)
33+
while True:
34+
print("Turn ")
35+
agent = Agent(
36+
name="Browser user",
37+
instructions="You are a helpful agent.",
38+
tools=[ComputerTool(computer)],
39+
# Use the computer using model, and set truncation to auto because its required
40+
model="computer-use-preview",
41+
model_settings=ModelSettings(truncation="auto"),
42+
)
43+
result = await Runner.run(
44+
agent,
45+
input_items,
46+
max_turns=10000,
47+
)
48+
input_items = result.to_input_list()
3749

3850

3951
CUA_KEY_TO_PLAYWRIGHT_KEY = {
@@ -79,7 +91,7 @@ async def _get_browser_and_page(self) -> tuple[Browser, Page]:
7991
browser = await self.playwright.chromium.launch(headless=False, args=launch_args)
8092
page = await browser.new_page()
8193
await page.set_viewport_size({"width": width, "height": height})
82-
await page.goto("https://www.bing.com")
94+
await page.goto("https://en.wikipedia.org/wiki/Main_Page")
8395
return browser, page
8496

8597
async def __aenter__(self):

0 commit comments

Comments
 (0)