diff --git a/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx b/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx index 08274927ea61d..7e4c158f108eb 100644 --- a/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx @@ -21,7 +21,7 @@ This integration is enabled by default when tracing The `typesafeIntegration` adds instrumentation for [`@typesafe-ai/sdk`](https://www.npmjs.com/package/@typesafe-ai/sdk) to capture agent tracing `gen_ai.evaluate` spans, recording model, token usage, latency, and (when enabled) evaluation inputs and answers. -If you call Jev through Vercel AI SDK's `experimental_evaluate()`, see the [Vercel AI integration](/platforms/javascript/guides/node/configuration/integrations/vercelai/#trace-jev-evaluations) instead. If you call Jev through Cloudflare Workers AI, see [Workers AI](/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai/#trace-jev-evaluations). If you call Jev through a Mastra `Classifier`, see [Mastra Classifier Evaluations](/platforms/javascript/guides/mastra/agent-tracing/classifier-evaluations/). +If you call Jev through Vercel AI SDK's `experimental_evaluate()`, see the [Vercel AI integration](/platforms/javascript/guides/node/configuration/integrations/vercelai/#trace-jev-evaluations) instead. If you call Jev through Cloudflare Workers AI, see [Workers AI](/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai/#trace-jev-and-clef-evaluations). If you call Jev through a Mastra `Classifier`, see [Mastra Classifier Evaluations](/platforms/javascript/guides/mastra/agent-tracing/classifier-evaluations/). ```javascript Sentry.init({ diff --git a/docs/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai.mdx b/docs/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai.mdx index 4c5a6b8d0ced5..636c5a6a2a693 100644 --- a/docs/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai.mdx +++ b/docs/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai.mdx @@ -30,7 +30,7 @@ Only `env.AI.run` is instrumented. Streaming spans end when the stream is fully You can browse the full list of available models in the [Cloudflare Workers AI models directory](https://developers.cloudflare.com/ai/models/). -## Trace Jev Evaluations +## Trace Jev and Clef Evaluations @@ -59,7 +59,19 @@ export default { } satisfies ExportedHandler; ``` -Each call creates a `gen_ai.evaluate` span named `evaluate `, with the response model (for example, `jev-1.13.0`), latency, and token usage. When recording is enabled, Sentry captures `state` and `questions` as input messages and `answers` as output messages, including probabilities and confidence values returned by Jev. These spans have the same attributes as spans from the [TypeSafe integration](/platforms/javascript/guides/node/configuration/integrations/typesafe/) on other runtimes. +The SDK traces calls to Cloudflare's [Clef model](https://developers.cloudflare.com/workers-ai/models/clef/) (`@cf/cloudflare/clef`) the same way. Clef takes the same `state` and `questions` input as Jev: + +```typescript +const result = await env.AI.run("@cf/cloudflare/clef", { + model: "clef", + state: "Checkout has been failing for every customer for the last hour.", + questions: { + urgent: { type: "noul", instructions: "Is this support request urgent?" }, + }, +}); +``` + +Each call creates a `gen_ai.evaluate` span named `evaluate `, with the response model (for example, `jev-1.13.0` or `clef`), latency, and token usage. When recording is enabled, Sentry captures `state` and `questions` as input messages and `answers` as output messages, including probabilities and confidence values returned by the model. These spans have the same attributes as spans from the [TypeSafe integration](/platforms/javascript/guides/node/configuration/integrations/typesafe/) on other runtimes. Evaluation state and answers can contain sensitive data. To stop recording them, set `genAI: { inputs: false, outputs: false }` in the `dataCollection` option.