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。
projectstringLangSmith 默认项目写入的项目名。
endpointstringLangSmith 默认地址自托管或代理地址。
workspaceIdstring目标 workspace。

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

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