From 7a4c71f23b96626f16daf3c41df4002591ad2dbe Mon Sep 17 00:00:00 2001 From: Dmitry Pimenov Date: Thu, 20 Mar 2025 15:51:02 -0700 Subject: [PATCH 1/4] include reference to new audio span related concepts --- examples/basic/hello_world.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/basic/hello_world.py b/examples/basic/hello_world.py index 169290d6..e972e37b 100644 --- a/examples/basic/hello_world.py +++ b/examples/basic/hello_world.py @@ -1,12 +1,18 @@ import asyncio -from agents import Agent, Runner +from agents import Agent, Runner, ModelSettings, OpenAIResponsesModel async def main(): agent = Agent( - name="Assistant", - instructions="You only respond in haikus.", + name="English agent", + instructions="You only speak English", + model=OpenAIResponsesModel( + model="gpt-4o", + model_settings=ModelSettings( + store=False, + ) + ) ) result = await Runner.run(agent, "Tell me about recursion in programming.") From 21634f31d5056f09981a6144631c7a1c9ce1adf2 Mon Sep 17 00:00:00 2001 From: Dmitry Pimenov Date: Thu, 20 Mar 2025 15:53:41 -0700 Subject: [PATCH 2/4] removing erroneous changes --- docs/tracing.md | 9 ++++++++- examples/basic/hello_world.py | 14 ++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/tracing.md b/docs/tracing.md index 98574d3f..a1f83ec7 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -35,6 +35,9 @@ By default, the SDK traces the following: - Function tool calls are each wrapped in `function_span()` - Guardrails are wrapped in `guardrail_span()` - Handoffs are wrapped in `handoff_span()` +- Audio inputs (speech-to-text) are wrapped in a `transcription_span()` +- Audio outputs (text-to-speech) are wrapped in a `speech_span()` +- Related audio spans may be parented under a `speech_group_span()` By default, the trace is named "Agent trace". You can set this name if you use `trace`, or you can can configure the name and other properties with the [`RunConfig`][agents.run.RunConfig]. @@ -76,7 +79,11 @@ Spans are automatically part of the current trace, and are nested under the near ## Sensitive data -Some spans track potentially sensitive data. For example, the `generation_span()` stores the inputs/outputs of the LLM generation, and `function_span()` stores the inputs/outputs of function calls. These may contain sensitive data, so you can disable capturing that data via [`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]. +Certain spans may capture potentially sensitive data. + +The `generation_span()` stores the inputs/outputs of the LLM generation, and `function_span()` stores the inputs/outputs of function calls. These may contain sensitive data, so you can disable capturing that data via [`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]. + +Similarly, Audio spans include base64-encoded PCM data for input and output audio by default. You can disable capturing this audio data by configuring [`RunConfig.trace_include_sensitive_audio_data`][agents.run.RunConfig.trace_include_sensitive_audio_data]. ## Custom tracing processors diff --git a/examples/basic/hello_world.py b/examples/basic/hello_world.py index e972e37b..a9514f38 100644 --- a/examples/basic/hello_world.py +++ b/examples/basic/hello_world.py @@ -1,18 +1,12 @@ import asyncio -from agents import Agent, Runner, ModelSettings, OpenAIResponsesModel +from agents import Agent, Runner async def main(): agent = Agent( - name="English agent", - instructions="You only speak English", - model=OpenAIResponsesModel( - model="gpt-4o", - model_settings=ModelSettings( - store=False, - ) - ) + name="Assistant", + instructions="You only respond in haikus.", ) result = await Runner.run(agent, "Tell me about recursion in programming.") @@ -23,4 +17,4 @@ async def main(): if __name__ == "__main__": - asyncio.run(main()) + asyncio.run(main()) \ No newline at end of file From 1f348b837086b320a1c4394bcd13bbdaedcf9d8a Mon Sep 17 00:00:00 2001 From: Dmitry Pimenov Date: Thu, 20 Mar 2025 16:05:54 -0700 Subject: [PATCH 3/4] fixing whitespace --- examples/basic/hello_world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic/hello_world.py b/examples/basic/hello_world.py index a9514f38..169290d6 100644 --- a/examples/basic/hello_world.py +++ b/examples/basic/hello_world.py @@ -17,4 +17,4 @@ async def main(): if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) From 1b12fce95d01c23ece9f98f0e2f6204a69af0397 Mon Sep 17 00:00:00 2001 From: Dmitry Pimenov Date: Thu, 20 Mar 2025 17:03:52 -0700 Subject: [PATCH 4/4] fixing object path --- docs/tracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tracing.md b/docs/tracing.md index a1f83ec7..72c4da41 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -83,7 +83,7 @@ Certain spans may capture potentially sensitive data. The `generation_span()` stores the inputs/outputs of the LLM generation, and `function_span()` stores the inputs/outputs of function calls. These may contain sensitive data, so you can disable capturing that data via [`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]. -Similarly, Audio spans include base64-encoded PCM data for input and output audio by default. You can disable capturing this audio data by configuring [`RunConfig.trace_include_sensitive_audio_data`][agents.run.RunConfig.trace_include_sensitive_audio_data]. +Similarly, Audio spans include base64-encoded PCM data for input and output audio by default. You can disable capturing this audio data by configuring [`VoicePipelineConfig.trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data]. ## Custom tracing processors