Skip to content

Commit 03e23b3

Browse files
committed
Simplify basic_agents_example.py
Remove unused trace wrapper, disable tracing, and inline model name.
1 parent 0442a1c commit 03e23b3

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

examples/agenthub/agents/basic_agents_example.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,19 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44

5-
"""Demonstrates running an OpenAI Agents workflow against the AgentHub endpoint."""
5+
"""Demonstrates using OpenAI Agents SDK against the AgentHub endpoint."""
66

77
import asyncio
8-
9-
from agents import Agent, Runner, set_default_openai_client, trace
10-
8+
from agents import Agent, Runner, set_default_openai_client, set_tracing_disabled
119
from examples.agenthub import common
1210

13-
MODEL = "xai.grok-4-1-fast-reasoning"
14-
15-
# Set the OCI OpenAI Client as the default client to use with OpenAI Agents
1611
set_default_openai_client(common.build_agenthub_async_client())
17-
12+
set_tracing_disabled(True)
1813

1914
async def main():
20-
agent = Agent(name="Assistant", instructions="You are a helpful assistant", model=MODEL)
21-
# https://openai.github.io/openai-agents-python/models/#tracing-client-error-401
22-
with trace("Trace workflow"):
23-
result = await Runner.run(agent, "Write a haiku about recursion in programming.")
24-
print(result.final_output)
25-
15+
agent = Agent(name="Assistant", instructions="You are a helpful assistant", model="xai.grok-4-1-fast-reasoning")
16+
result = await Runner.run(agent, "Write a haiku about recursion in programming.")
17+
print(result.final_output)
2618

2719
if __name__ == "__main__":
2820
asyncio.run(main())

0 commit comments

Comments
 (0)