SuperAPI AI 工具集

arize-instrumentation

智能体与模型

查看项目

更新于 10-15 21:52

技能介绍

用途:为 LLM 应用首次添加 Arize AX 追踪,按“分析—实施”两阶段智能体辅助流程执行。用户可先让智能体遵循 https://arize.com/docs/PROMPT.md 的说明并提问。

主要能力:阶段 0 做环境预检,确认仓库/服务范围、包管理器与启动命令、应用类型,不主动检查 ax 安装。阶段 1 只读分析:检查依赖清单(pyproject.toml、requirements.txt、package.json、pom.xml、go.mod 等)、扫描 import、识别已有 OTel/追踪配置、确定语言、包管理器、LLM 提供商、框架、工具调用等,并输出简洁摘要。阶段 2 实施:按匹配文档安装包并埋点,创建集中式 instrumentation 模块,在创建 LLM 客户端前初始化追踪;已有 TracerProvider 时仅追加 Arize 导出器。

用法要点:Python 用 pip install arize-otel 加 openinference-instrumentation-{name};TypeScript/JavaScript 用 @opentelemetry/sdk-trace-node 加相关 @arizeai/openinference-* 包;Java 用 OpenTelemetry SDK 加 openinference-instrumentation-*;Go 用 go get go.opentelemetry.io/otel 等,端点用 otlptracehttp.WithEndpoint("otlp.arize.com")(美国)或 otlptracehttp.WithEndpoint("otlp.eu-west-1a.arize.com")(欧盟),并传 space_id、api_key 头。凭据通过 ax profiles show/create 或环境变量设置,代码中只引用 os.environ["ARIZE_API_KEY"]、process.env.ARIZE_API_KEY、os.Getenv("ARIZE_API_KEY"),绝不写入明文。项目名必填,缺失会导致 HTTP 500。短生命周期进程退出前需 flush/shutdown。工具调用场景需手动添加 CHAIN 与 TOOL span,并设置 openinference.span.kind、input.value、output.value 等属性。

适用场景:Python、TypeScript/JavaScript、Java、Go 的 LLM 应用,覆盖 OpenAI、Anthropic、LangChain、LangGraph、LlamaIndex、Vercel AI SDK 等集成。

限制:Go 暂无一方自动埋点包,需手动设置 OpenInference 属性;不修改业务逻辑;不生成额外文档;具体收费、价格与效果资料暂未提供。