@gensx/openai
Version:
A wrapper around the OpenAI SDK for GenSX.
27 lines • 878 B
TypeScript
import type { WrapOptions } from "@gensx/core";
import { OpenAI as OriginalOpenAI } from "openai";
/**
* A pre-wrapped version of the OpenAI SDK that makes all methods available as GenSX components.
*
* @example
* ```ts
* import { openai } from "@gensx/openai";
*
* // Use chat completions
* const completion = await openai.chat.completions.create({
* model: "gpt-4.1-mini",
* messages: [{ role: "user", content: "Hello!" }]
* });
*
* // Use embeddings
* const embedding = await openai.embeddings.create({
* model: "text-embedding-3-small",
* input: "Hello world!"
* });
* ```
*/
export declare class OpenAI extends OriginalOpenAI {
constructor(config?: ConstructorParameters<typeof OriginalOpenAI>[0]);
}
export declare const wrapOpenAI: (openAiInstance: OriginalOpenAI, opts?: WrapOptions) => OriginalOpenAI;
//# sourceMappingURL=openai.d.ts.map