> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pandaprobe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Framework integrations

> Callbacks, adapters, and native agent tracing hooks

These APIs enable tracing. They do not enable reflection by themselves. Use the same explicit client for tracing and Reflect when combining them.

LangChain, LangGraph, and DeepAgents use callback handlers passed to native invocation configuration. Their inherited callback methods are framework hooks; applications normally construct a handler once and let the framework call it. The callback contracts below include those inherited SDK methods.

Other integrations use the framework's adapter, processor, query wrapper, or agent wrapper. Register instrumentation once at application startup. See [Reflect integrations](https://docs.pandaprobe.com/reflect/integrations/overview.md) for memory tooling and reflection continuation.

Await OpenAI Agents `instrument()` or use its processor factory with the native SDK. Claude integration wraps the query function because ESM modules cannot be patched like Python modules. Vercel model middleware instruments LLM calls; `wrapVercelAgent` adds the agent/step/tool hierarchy. Google ADK and CrewAI are not TypeScript exports.

## On this page

[AdapterOptions](#adapteroptions), [ClaudeAgentSDKAdapter](#claudeagentsdkadapter), [DeepAgentsCallbackHandler](#deepagentscallbackhandler), [LangChainCallbackHandler](#langchaincallbackhandler), [LangGraphCallbackHandler](#langgraphcallbackhandler), [OpenAIAgentsAdapter](#openaiagentsadapter), [TraceProcessor](#traceprocessor), [VercelAgentOptions](#vercelagentoptions), [VercelMiddlewareOptions](#vercelmiddlewareoptions), [pandaProbeMiddleware](#pandaprobemiddleware), [wrapClaudeAgentQuery](#wrapclaudeagentquery), [wrapVercelAgent](#wrapvercelagent).

## Example

```ts theme={null}
import { Client } from "pandaprobe";
import { LangChainCallbackHandler } from "pandaprobe/integrations/langchain";

const client = new Client();
const handler = new LangChainCallbackHandler({ client });
const invocationConfig = { callbacks: [handler] };
// Pass invocationConfig to your native agent invocation.
// Keep client alive for the agent's lifetime, then await client.shutdown().
```

Full native setup examples are in the [tracing integrations](https://docs.pandaprobe.com/tracing/integrations/overview.md) and [Reflect integrations](https://docs.pandaprobe.com/reflect/integrations/overview.md).

## `AdapterOptions`

```ts theme={null}
import type { AdapterOptions } from "pandaprobe/integrations/langchain";
```

Also exported from `pandaprobe/integrations/langgraph`, `pandaprobe/integrations/deepagents`, `pandaprobe/integrations/claude-agent-sdk`, `pandaprobe/integrations/openai-agents`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/base.ts#L59)

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `client` | `Client \| null \| undefined` | Optional |
| `sessionId` | `string \| null \| undefined` | Optional |
| `userId` | `string \| null \| undefined` | Optional |
| `tags` | `string[] \| undefined` | Optional |
| `metadata` | `Record<string, unknown> \| undefined` | Optional |

## `ClaudeAgentSDKAdapter`

```ts theme={null}
import { ClaudeAgentSDKAdapter } from "pandaprobe/integrations/claude-agent-sdk";
```

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/claude-agent-sdk/adapter.ts#L58)

### Constructor

```text theme={null}
new ClaudeAgentSDKAdapter(options?: AdapterOptions): ClaudeAgentSDKAdapter
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `AdapterOptions` | `{}` |

### Methods

> [accordion] wrapQuery
>
> Wrap the SDK `query` function so each call is traced.
>
> ```text theme={null}
> wrapQuery(query: QueryFn): QueryFn
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `query` | `QueryFn` | Required |

## `DeepAgentsCallbackHandler`

```ts theme={null}
import { DeepAgentsCallbackHandler } from "pandaprobe/integrations/deepagents";
```

DeepAgents callback handler. A deep agent is a LangGraph compiled graph under
the hood, so the standard LangChain callback interface captures the full
trace tree (including sub-agent invocations). Pass via
`config: &#123; callbacks: [handler] &#125;`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/deepagents/callback.ts#L13)

### Constructor

```text theme={null}
new DeepAgentsCallbackHandler(options?: AdapterOptions): DeepAgentsCallbackHandler
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `AdapterOptions` | `{}` |

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `name` | `"PandaProbeDeepAgentsCallbackHandler"` | `"PandaProbeDeepAgentsCallbackHandler"`; read-only; Required by LangChain's CallbackHandlerMethods. |

### Methods

> [accordion] handleChainStart
>
> ```text theme={null}
> handleChainStart(
>   chain: Any,
>   inputs: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   _runType?: string,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `chain` | `Any` | Required |
> | `inputs` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `_runType` | `string` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChainEnd
>
> ```text theme={null}
> handleChainEnd(outputs: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `outputs` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleChainError
>
> ```text theme={null}
> handleChainError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMStart
>
> ```text theme={null}
> handleLLMStart(
>   llm: Any,
>   prompts: string[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `prompts` | `string[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChatModelStart
>
> ```text theme={null}
> handleChatModelStart(
>   llm: Any,
>   messages: Any[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `messages` | `Any[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleLLMEnd
>
> ```text theme={null}
> handleLLMEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMError
>
> ```text theme={null}
> handleLLMError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolStart
>
> ```text theme={null}
> handleToolStart(
>   tool: Any,
>   input: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `tool` | `Any` | Required |
> | `input` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleToolEnd
>
> ```text theme={null}
> handleToolEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolError
>
> ```text theme={null}
> handleToolError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleRetrieverStart
>
> ```text theme={null}
> handleRetrieverStart(
>   retriever: Any,
>   query: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `retriever` | `Any` | Required |
> | `query` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleRetrieverEnd
>
> ```text theme={null}
> handleRetrieverEnd(documents: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `documents` | `Any` | Required |
> | `runId` | `string` | Required |

## `LangChainCallbackHandler`

```ts theme={null}
import { LangChainCallbackHandler } from "pandaprobe/integrations/langchain";
```

LangChain callback handler for `create_agent`, LCEL chains, and custom
Runnables. Pass via `config: &#123; callbacks: [handler] &#125;`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/langchain/callback.ts#L11)

### Constructor

```text theme={null}
new LangChainCallbackHandler(options?: AdapterOptions): LangChainCallbackHandler
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `AdapterOptions` | `{}` |

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `name` | `"PandaProbeLangChainCallbackHandler"` | `"PandaProbeLangChainCallbackHandler"`; read-only; Required by LangChain's CallbackHandlerMethods. |

### Methods

> [accordion] handleChainStart
>
> ```text theme={null}
> handleChainStart(
>   chain: Any,
>   inputs: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   _runType?: string,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `chain` | `Any` | Required |
> | `inputs` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `_runType` | `string` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChainEnd
>
> ```text theme={null}
> handleChainEnd(outputs: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `outputs` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleChainError
>
> ```text theme={null}
> handleChainError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMStart
>
> ```text theme={null}
> handleLLMStart(
>   llm: Any,
>   prompts: string[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `prompts` | `string[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChatModelStart
>
> ```text theme={null}
> handleChatModelStart(
>   llm: Any,
>   messages: Any[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `messages` | `Any[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleLLMEnd
>
> ```text theme={null}
> handleLLMEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMError
>
> ```text theme={null}
> handleLLMError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolStart
>
> ```text theme={null}
> handleToolStart(
>   tool: Any,
>   input: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `tool` | `Any` | Required |
> | `input` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleToolEnd
>
> ```text theme={null}
> handleToolEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolError
>
> ```text theme={null}
> handleToolError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleRetrieverStart
>
> ```text theme={null}
> handleRetrieverStart(
>   retriever: Any,
>   query: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `retriever` | `Any` | Required |
> | `query` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleRetrieverEnd
>
> ```text theme={null}
> handleRetrieverEnd(documents: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `documents` | `Any` | Required |
> | `runId` | `string` | Required |

## `LangGraphCallbackHandler`

```ts theme={null}
import { LangGraphCallbackHandler } from "pandaprobe/integrations/langgraph";
```

LangGraph callback handler that maps graph events to PandaProbe traces.
Pass via `config: &#123; callbacks: [handler] &#125;`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/langgraph/callback.ts#L9)

### Constructor

```text theme={null}
new LangGraphCallbackHandler(options?: AdapterOptions): LangGraphCallbackHandler
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `AdapterOptions` | `{}` |

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `name` | `"PandaProbeLangGraphCallbackHandler"` | `"PandaProbeLangGraphCallbackHandler"`; read-only; Required by LangChain's CallbackHandlerMethods. |

### Methods

> [accordion] handleChainStart
>
> ```text theme={null}
> handleChainStart(
>   chain: Any,
>   inputs: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   _runType?: string,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `chain` | `Any` | Required |
> | `inputs` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `_runType` | `string` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChainEnd
>
> ```text theme={null}
> handleChainEnd(outputs: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `outputs` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleChainError
>
> ```text theme={null}
> handleChainError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMStart
>
> ```text theme={null}
> handleLLMStart(
>   llm: Any,
>   prompts: string[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `prompts` | `string[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleChatModelStart
>
> ```text theme={null}
> handleChatModelStart(
>   llm: Any,
>   messages: Any[],
>   runId: string,
>   parentRunId?: string,
>   extraParams?: Any,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `llm` | `Any` | Required |
> | `messages` | `Any[]` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `extraParams` | `Any` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleLLMEnd
>
> ```text theme={null}
> handleLLMEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleLLMError
>
> ```text theme={null}
> handleLLMError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolStart
>
> ```text theme={null}
> handleToolStart(
>   tool: Any,
>   input: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `tool` | `Any` | Required |
> | `input` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleToolEnd
>
> ```text theme={null}
> handleToolEnd(output: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `output` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleToolError
>
> ```text theme={null}
> handleToolError(error: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `error` | `Any` | Required |
> | `runId` | `string` | Required |

> [accordion] handleRetrieverStart
>
> ```text theme={null}
> handleRetrieverStart(
>   retriever: Any,
>   query: Any,
>   runId: string,
>   parentRunId?: string,
>   _tags?: string[],
>   _metadata?: Any,
>   runName?: string,
> ): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `retriever` | `Any` | Required |
> | `query` | `Any` | Required |
> | `runId` | `string` | Required |
> | `parentRunId` | `string` | Optional |
> | `_tags` | `string[]` | Optional |
> | `_metadata` | `Any` | Optional |
> | `runName` | `string` | Optional |

> [accordion] handleRetrieverEnd
>
> ```text theme={null}
> handleRetrieverEnd(documents: Any, runId: string): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `documents` | `Any` | Required |
> | `runId` | `string` | Required |

## `OpenAIAgentsAdapter`

```ts theme={null}
import { OpenAIAgentsAdapter } from "pandaprobe/integrations/openai-agents";
```

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/openai-agents/adapter.ts#L64)

### Constructor

```text theme={null}
new OpenAIAgentsAdapter(options?: AdapterOptions): OpenAIAgentsAdapter
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `AdapterOptions` | `{}` |

### Methods

> [accordion] createTraceProcessor
>
> Build the tracing processor object (register it with the Agents SDK).
>
> ```text theme={null}
> createTraceProcessor(): TraceProcessor
> ```

> [accordion] instrument
>
> Register the processor with the `@openai/agents` SDK. Returns true on
> success, false if the SDK is unavailable or exposes no known hook.
>
> ```text theme={null}
> instrument(): Promise<boolean>
> ```

## `TraceProcessor`

```ts theme={null}
import type { TraceProcessor } from "pandaprobe/integrations/openai-agents";
```

The TracingProcessor object shape expected by `@openai/agents`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/openai-agents/adapter.ts#L48)

### Methods

> [accordion] onTraceStart
>
> ```text theme={null}
> onTraceStart(trace: Any): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `trace` | `Any` | Required |

> [accordion] onTraceEnd
>
> ```text theme={null}
> onTraceEnd(trace: Any): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `trace` | `Any` | Required |

> [accordion] onSpanStart
>
> ```text theme={null}
> onSpanStart(span: Any): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `span` | `Any` | Required |

> [accordion] onSpanEnd
>
> ```text theme={null}
> onSpanEnd(span: Any): void
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `span` | `Any` | Required |

> [accordion] forceFlush

> [accordion] shutdown

## `VercelAgentOptions`

```ts theme={null}
import type { VercelAgentOptions } from "pandaprobe/integrations/vercel-ai";
```

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/vercel-ai/adapter.ts#L6)

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `name` | `string \| undefined` | Optional |
| `client` | `Client \| null \| undefined` | Optional |
| `sessionId` | `string \| null \| undefined` | Optional |
| `userId` | `string \| null \| undefined` | Optional |
| `tags` | `string[] \| undefined` | Optional |
| `metadata` | `Record<string, unknown> \| undefined` | Optional |

## `VercelMiddlewareOptions`

```ts theme={null}
import type { VercelMiddlewareOptions } from "pandaprobe/integrations/vercel-ai";
```

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/vercel-ai/middleware.ts#L21)

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `name` | `string \| undefined` | Optional; Span/trace name (default "vercel-ai-generate"). |

## `pandaProbeMiddleware`

```ts theme={null}
import { pandaProbeMiddleware } from "pandaprobe/integrations/vercel-ai";
```

Build a PandaProbe middleware object for the AI SDK's `wrapLanguageModel`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/vercel-ai/middleware.ts#L58)

```text theme={null}
pandaProbeMiddleware(
  options?: VercelMiddlewareOptions,
): { wrapGenerate: ({ doGenerate, params, model }: Any) => Promise<Any>; wrapStream: ({ doStream, params, model }: Any) => Promise<Any>; }
```

| Parameter | Type | Default / passing |
| - | - | - |
| `options` | `VercelMiddlewareOptions` | `{}` |

## `wrapClaudeAgentQuery`

```ts theme={null}
import { wrapClaudeAgentQuery } from "pandaprobe/integrations/claude-agent-sdk";
```

Wrap the Claude Agent SDK `query` function so each call is traced.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/claude-agent-sdk/adapter.ts#L287)

```text theme={null}
wrapClaudeAgentQuery(query: QueryFn, options?: AdapterOptions): QueryFn
```

| Parameter | Type | Default / passing |
| - | - | - |
| `query` | `QueryFn` | Required |
| `options` | `AdapterOptions` | `{}` |

## `wrapVercelAgent`

```ts theme={null}
import { wrapVercelAgent } from "pandaprobe/integrations/vercel-ai";
```

Instrument a native ToolLoopAgent instance or constructor without changing its public types.

Type parameters: `T extends object`.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript/src/integrations/vercel-ai/adapter.ts#L12)

```text theme={null}
wrapVercelAgent<T extends object>(agent: T, options?: VercelAgentOptions): T
```

| Parameter | Type | Default / passing |
| - | - | - |
| `agent` | `T` | Required |
| `options` | `VercelAgentOptions` | `{}` |

***

Signatures and fields are generated from the [SDK source](https://github.com/chirpz-ai/pandaprobe-sdk/tree/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/typescript). See the [import index](https://docs.pandaprobe.com/reference/typescript/overview.md#public-import-index) for available entry points.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.