本页还没有译文
本页 10 段还没译成简体中文,下面显示的是英文原文。Traceloop
还没翻译译自英文(ai-sdk.dev)本页 10 段都还没译
Traceloop is a development platform for building reliable AI applications. After integrating with the AI SDK, you can use Traceloop to trace, monitor, and experiment with LLM providers, prompts and flows.
Setup
Traceloop supports AI SDK telemetry data through OpenTelemetry. You'll need to sign up at https://app.traceloop.com and get an API Key.
Next.js
To use the AI SDK to send telemetry data to Traceloop, set these environment variables in your Next.js app's .env file:
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.traceloop.com
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <Your API Key>"Install @ai-sdk/otel and register the LegacyOpenTelemetry in your instrumentation.ts file:
import { registerTelemetry } from 'ai';
import { LegacyOpenTelemetry } from '@ai-sdk/otel';
registerTelemetry(new LegacyOpenTelemetry());You can then use the telemetry option to enable telemetry on supported AI SDK function calls:
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
const result = await generateText({
model: openai('gpt-6-luna'),
prompt: 'What is 2 + 2?',
telemetry: {
metadata: {
query: 'weather',
location: 'San Francisco',
},
},
});Resources
AI 翻译查看英文原文