Our docs got a refresh! Check out the new content and improved navigation. For detailed API reference see our Python SDK docs and TypeScript SDK.
Description
PercivalIntegrations

Custom Integration

How to trace your custom agentic framework with OpenInference + Patronus using OpenAI or Anthropic models.

If you have an internal agent framework that calls OpenAI or Anthropic models directly, you can attach Percival/Patronus tracing with a few lines of code.

OpenAI Instrumentation

pip install patronus
pip install openai
pip install openinference-instrumentation-openai
pip install opentelemetry-instrumentation-threading
pip install opentelemetry-instrumentation-asyncio

Once installed, you can import the following instrumentors:

from openinference.instrumentation.openai import OpenAIInstrumentor
from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
 
import patronus
patronus.init(integrations=[OpenAIInstrumentor(), ThreadingInstrumentor(), AsyncioInstrumentor()])

Anthropic Instrumentation

pip install patronus
pip install anthropic
pip install openinference-instrumentation-anthropic
pip install opentelemetry-instrumentation-threading
pip install opentelemetry-instrumentation-asyncio

Once installed, you can import the following instrumentors:

from openinference.instrumentation.anthropic import AnthropicInstrumentor
from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
 
import patronus
patronus.init(integrations=[AnthropicInstrumentor(), ThreadingInstrumentor(), AsyncioInstrumentor()])

On this page