Skip to main content
You can only pass Respan params to traces with Respan tracing SDK. External integrations like OpenAI Agents SDK are not supported yet.

Example code

This is how to add Respan params to your workflow traces:
It’s the same way to add Respan params to a workflow or a task.
agent.py
@workflow(name="my_workflow")
def my_workflow():
    # Add Respan params to the current trace
    with respan_span_attributes(
        respan_params={
            "customer_params": {
                "customer_identifier": "123",
            },
            "metadata": {"some_key": "some_value"},
        }
    ):
        # Your LLM calls or other operations here
        client = OpenAI()
        response = client.chat.completions.create(
            model="gpt-4o",
            messages=[{"role": "user", "content": "Hello, world!"}],
        )
    return response