LangSmithOptions

从 @ai-i18n/openai 导入:

import type { LangSmithOptions } from '@ai-i18n/openai';

定义

interface LangSmithOptions {
  apiKey: string;
  project?: string;
  endpoint?: string;
  workspaceId?: string;
}

字段

字段类型必填默认值约束作用
apiKeystring是无非空LangSmith API key。
projectstring否LangSmith 默认项目无写入的项目名。
endpointstring否LangSmith 默认地址无自托管或代理地址。
workspaceIdstring否无无目标 workspace。

只有传入 OpenAIOptions.langSmith 时,Provider 才会创建 tracing callback。

openAI({
  baseURL,
  model,
  langSmith: {
    apiKey: process.env.LANGSMITH_API_KEY!,
    project: 'ai-i18n',
  },
});