Skip to content

docs(examples): add OpenAI Agents SDK travel agent example - #280

Draft
etserend wants to merge 2 commits into
mainfrom
feat/openai-agents-travel-agent-example
Draft

etserend wants to merge 2 commits into
mainfrom
feat/openai-agents-travel-agent-example

Conversation

@etserend

Copy link
Copy Markdown
Contributor

Summary

Adds examples/agent/openai-agents-sdk/, a small travel agent built on the OpenAI Agents SDK and instrumented with Splunk AO. The agent has two mock tools (flight search and activity search), so each run produces a tool-calling turn followed by a final answer.

The example shows two ways to send the same agent's telemetry to Splunk AO, selected with INSTRUMENTATION:

  • sdk (default): SplunkAOTracingProcessor, registered with the Agents SDK's set_trace_processors() hook.
  • otel: the community OpenTelemetry instrumentation for the Agents SDK, with Splunk AO attached through add_splunk_ao_span_processor(). This mode disables the Agents SDK's default export to OpenAI's tracing backend, so telemetry goes only to Splunk AO.

The model client is the standard AsyncOpenAI, so the example works with OpenAI or any OpenAI-compatible endpoint (set OPENAI_BASE_URL).

What is included

  • main.py
  • .env.example with placeholder values only
  • requirements.txt (splunk-ao[openai]>=0.5.0, python-dotenv, and the OTel package as an optional line)
  • README.md

No credentials, .env, uv.lock, or uv.toml are included.

Test plan

  • Staged diff scanned for secrets and long tokens: clean
  • requirements.txt resolves from public PyPI in a clean virtual environment
  • main.py compiles
  • End-to-end run of INSTRUMENTATION=sdk against a Splunk AO backend
  • End-to-end run of INSTRUMENTATION=otel, including confirming no request reaches api.openai.com
  • ruff check on main.py

Opened as a draft until the end-to-end runs are done.

🤖 Generated with Claude Code

etserend and others added 2 commits October 20, 2026 15:25
A small travel agent with two mock tools, built on the OpenAI Agents SDK and
instrumented with Splunk AO. It shows two ways to send telemetry: the
SplunkAOTracingProcessor registered through set_trace_processors(), and the
community OpenTelemetry instrumentation with a Splunk AO span processor.

Includes a placeholder-only .env.example, requirements.txt and a README.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Replace the Azure-specific client with AsyncOpenAI, which reads OPENAI_API_KEY
and an optional OPENAI_BASE_URL, so the example runs against OpenAI or any
OpenAI-compatible endpoint. In otel mode, disable the Agents SDK's default
export to OpenAI's tracing backend so telemetry goes only to Splunk AO.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant