Metadata-Version: 2.5
Name: pytracer-openai-agents
Version: 0.1.3
Summary: pyTracer adapter for the OpenAI Agents SDK - auto-instrument agents via a tracing processor.
Project-URL: Homepage, https://pytracer.com
Project-URL: Documentation, https://pytracer.com/docs.html
Project-URL: Repository, https://github.com/vi6120/pyTracer
Project-URL: Issues, https://github.com/vi6120/pyTracer/issues
Author: Vikas Ramaswamy, Nagesha Sheshadri
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: openai-agents>=0.1
Requires-Dist: pytracer-sdk==0.1.3
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# pytracer-openai-agents

pyTracer adapter for the OpenAI Agents SDK. It auto-instruments an agent through
the SDK's built-in tracing, so you do not add `@op` by hand: agent runs, model
generations, tool (function) calls, and handoffs are captured as pyTracer spans.

```python
import pytracer_sdk as pytracer
from pytracer_openai_agents import install

pytracer.configure(
    pytracer.HTTPTransport("https://gateway.internal", api_key="YOUR_KEY"),
    service_name="my-agent", branch="main", commit="abc123",
)

install()   # now every agent run is captured, and only pyTracer receives traces
```

`install()` uses the SDK's `set_trace_processors` to make pyTracer the **only**
trace processor. Do not use `add_trace_processor`: it appends, leaving the SDK's
default processor in place, which uploads every trace to OpenAI when
`OPENAI_API_KEY` is set. If you deliberately want both destinations, add the
processor yourself with `add_trace_processor(PyTracerTracingProcessor())`.

Agent spans map to agent spans, generations and responses to LLM spans, function
calls to tool spans, and handoffs to handoff spans, all linked into one trace by
the SDK's own span tree.

## Replay

This adapter **captures** runs. Replaying a captured run currently requires `@op`
instrumentation, because the replay engine intercepts `@op` calls; replay through
the adapter itself is on the roadmap. Attempting to replay an adapter-only trace
is flagged (the run has recordings but hits no `@op` seam) rather than silently
running live. See the main README for the replay workflow.
