import { trace, models } from "@fallom/trace";
import Anthropic from "@anthropic-ai/sdk";
// Initialize both trace and models
await trace.init({ apiKey: "your-fallom-api-key" });
models.init({ apiKey: "your-fallom-api-key" });
const anthropic = trace.wrapAnthropic(new Anthropic());
// Get assigned model
const modelId = await models.get("my-experiment", "session-123", {
fallback: "claude-sonnet-4-20250514",
});
trace.setSession("my-experiment", "session-123");
const response = await anthropic.messages.create({
model: modelId,
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});