@agentinsights/openai
v0.1.0
Published
AgentInsight integration for OpenAI SDK
Downloads
37
Maintainers
Readme
@agentinsight/openai
AgentInsight OpenAI SDK 集成 / AgentInsight OpenAI SDK Integration
提供 observeOpenAI 包装器,自动追踪 OpenAI API 调用。
Provides observeOpenAI wrapper to automatically trace OpenAI API calls.
安装 / Installation
npm install @agentinsight/openai快速开始 / Quick Start
import { observeOpenAI } from "@agentinsight/openai";
import OpenAI from "openai";
const client = new OpenAI();
const result = await observeOpenAI(client, "my-chat", () =>
client.chat.completions.create({
model: "gpt-4",
messages: [{ role: "user", content: "Hello!" }],
}),
);