Skip to main content
Wrap the provider client before using it. Calls retain their native arguments, results, exceptions, and streaming behavior. Instrumented calls attach to the active trace or create a standalone trace when needed. Finish or close streams so their trace can be finalized. Provider packages are optional. Install the provider you use alongside pandaprobe; the wrapper does not replace the provider’s own API reference. These functions instrument model calls, while the framework integrations also capture agent/tool structure. Provider helpers are available from pandaprobe.wrappers and their provider submodules. wrap_litellm() is the exception to instance wrapping: it instruments module-level completion functions. Bedrock async support depends on the supplied native client.

On this page

wrap_anthropic, wrap_bedrock, wrap_gemini, wrap_litellm, wrap_mistral, wrap_openai.

Example

Install the provider extra with pip install "pandaprobe[openai]" or uv add "pandaprobe[openai]". Set both PandaProbe and OpenAI credentials before making model calls.

wrap_anthropic

Also exported from pandaprobe.wrappers.anthropic. Instrument an anthropic.Anthropic or anthropic.AsyncAnthropic client. Source declaration

wrap_bedrock

Also exported from pandaprobe.wrappers.bedrock. Instrument a boto3 / aioboto3 bedrock-runtime client. Source declaration

wrap_gemini

Also exported from pandaprobe.wrappers.gemini. Instrument a google.genai.Client for automatic LLM span tracing. Source declaration

wrap_litellm

Also exported from pandaprobe.wrappers.litellm. Instrument the LiteLLM SDK for automatic LLM span tracing. Source declaration

wrap_mistral

Also exported from pandaprobe.wrappers.mistral. Instrument a mistralai.Mistral client for automatic LLM span tracing. Source declaration

wrap_openai

Also exported from pandaprobe.wrappers.openai. Instrument an openai.OpenAI or openai.AsyncOpenAI client. Source declaration

Signatures and fields are generated from the SDK source. See the import index for available entry points.