"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wrapOpenAI = void 0;
const traceable_js_1 = require("./traceable.cjs");
const wrapOpenAI = (openai, options) => {
    // @ts-expect-error Promise<APIPromise<...>> != APIPromise<...>
    openai.chat.completions.create = (0, traceable_js_1.traceable)(openai.chat.completions.create.bind(openai.chat.completions), Object.assign({ name: "ChatOpenAI", run_type: "llm" }, options?.client));
    // @ts-expect-error Promise<APIPromise<...>> != APIPromise<...>
    openai.completions.create = (0, traceable_js_1.traceable)(openai.completions.create.bind(openai.completions), Object.assign({ name: "OpenAI", run_type: "llm" }, options?.client));
    return openai;
};
exports.wrapOpenAI = wrapOpenAI;
