is OPENAI_API_KEY required for tracing openai-agents-sdk with https://arize.com/docs/phoenix/tracing/integrations-tracing/openai-agents-sdk? I wonder what's the relationship between the tracing provided by the agents sdk and the tracing in phoenix?
馃挕聽Hint: Mention RunLLM in the thread for followups.
Thanks. I'm trying to disable the tracing to openai sdk using set_tracing_disabled(disabled=True), will this affect tracing to phoenix? more context: I'm using azure api with agents sdk, e.g.
client = AsyncAzureOpenAI(
api_key=API_KEY,
api_version="2024-10-21",
azure_endpoint=BASE_URL,
azure_deployment=MODEL_NAME,
)
_MODEL = OpenAIChatCompletionsModel(model=MODEL_NAME, openai_client=client)
math_tutor_agent = Agent(
name="Math Tutor",
handoff_description="Specialist agent for math questions",
instructions="You provide help with math problems. Explain your reasoning at each step and include examples",
model=_MODEL,
)following https://github.com/openai/openai-agents-python/blob/main/examples/model_providers/custom_example_agent.py, so I'm not querying openai directly.
set_tracing_disabled will not affect Phoenix tracing.
thank you!
when I manually instrument with with tracer.start_as_current_span("hello_world"):, the trace shows up. But the auto instrumented traces aren't ....
is there version requirement for openai-agents? I'm using 0.0.19
or could it because I'm using AsyncAzureOpenAI
Thank you! After adding openinference-instrumentation-openai, I do see traces, but I'm trying to learn what traces openinference-instrumentation-openai-agent can add.
do you have a screenshot of what the traces look like?
btw, shouldn't the endpoint include the path v1/traces?
it doesn't work without /v1/traces in my experience. I'm following the doc at https://arize.com/docs/phoenix/tracing/llm-traces-1/quickstart-tracing-python
ah, I used register.
hmm, I adopted your code, just replacing api key and base for azure client, no traces show up
looks like has to be some version issue, just adding uv add openinference-instrumentation-openai would make some traces show up
my deps are
dependencies = [
"arize-phoenix-otel>=0.11.0",
"dotenv>=0.9.9",
"openai>=1.90.0",
"openai-agents==0.0.8",
"openinference-instrumentation-openai-agents>=0.1.14",
"streamlit>=1.46.0",
]upgrading "openai-agents==0.0.8", to 0.0.19 doesn't help
hmm, I looked at https://github.com/Arize-ai/openinference/blob/main/python/instrumentation/openinf[鈥nts/src/openinference/instrumentation/openai_agents/__init__.py, surprised your example still works after
set_tracing_disabled(disabled=True)I commented out this line and tried setting the process manually, basically
# set_tracing_disabled(disabled=True)
...
set_trace_processors([OpenInferenceTracingProcessor(cast(Tracer, tracer))])then the traces show up
