wrapOpenAI
▸ wrapOpenAI<T>(openai): T
Wraps the OpenAI API to enable function tracing for OpenAI calls.
Type parameters
| Name | Type |
|---|---|
T | extends OpenAIAPI |
Parameters
| Name | Type |
|---|---|
openai | T |
Returns
T
Example
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Help us improve these docs. Take our quick survey.
TypeScript SDK reference
T>(openai): T
Wraps the OpenAI API to enable function tracing for OpenAI calls.
| Name | Type |
|---|---|
T | extends OpenAIAPI |
| Name | Type |
|---|---|
openai | T |
T
Example
const openai = wrapOpenAI(new OpenAI());
const result = await openai.chat.completions.create({
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: 'Hello, world!' }]
});
Was this page helpful?