Metadata-Version: 2.4
Name: respan-instrumentation-together
Version: 0.1.0
Summary: Respan instrumentation plugin for the Together AI Python SDK
License: Apache 2.0
Author: Respan
Author-email: team@respan.ai
Requires-Python: >=3.11,<3.14
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: opentelemetry-semantic-conventions-ai (>=0.5.1)
Requires-Dist: respan-sdk (>=2.6.1)
Requires-Dist: respan-tracing (>=2.17.0)
Requires-Dist: together (>=2.0.0)
Description-Content-Type: text/markdown

# respan-instrumentation-together

Respan instrumentation plugin for the official
[Together AI Python SDK](https://github.com/togethercomputer/together-py).

The package patches the generated Together SDK resources and emits canonical
Respan spans through the active OTEL pipeline. It captures sync calls, async
calls, streaming chat and text completions, chat tool definitions, model tool
calls, text completions, embeddings, rerank requests, image generations, and
token usage when Together returns it.

## Installation

```bash
pip install respan-ai respan-instrumentation-together together
```

## Usage

```python
from together import Together
from respan import Respan
from respan_instrumentation_together import TogetherInstrumentor

respan = Respan(instrumentations=[TogetherInstrumentor()])
client = Together()

response = client.chat.completions.create(
    model="openai/gpt-oss-20b",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content)
respan.flush()
```

