메인 콘텐츠로 건너뛰기

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

wrapOpenAI

wrapOpenAI<T>(openai): T OpenAI call에 대한 함수 추적을 활성화하기 위해 OpenAI API를 래핑합니다.

타입 매개변수

이름유형
Textends OpenAIAPI

매개변수

이름유형
openaiT

반환값

T 예시
const openai = wrapOpenAI(new OpenAI());
const result = await openai.chat.completions.create({
  model: 'gpt-3.5-turbo',
  messages: [{ role: 'user', content: 'Hello, world!' }]
});

정의 위치

integrations/openai.ts:505