const require_chunk = require('./chunk-DWy1uDak.cjs');
const __ai_sdk_openai = require_chunk.__toESM(require("@ai-sdk/openai"));

//#region src/internal/agents/openai-provider.ts
let customFactory = null;
let defaultModel = "gpt-5";
/**
* Configure the OpenAI provider factory.
*
* When a base URL is provided, the factory will use that endpoint for all
* subsequent model requests. Passing undefined resets to the default
* configuration bundled with the SDK.
*
* When a default model is provided, it will be used as the default for all
* subsequent getOpenAIModel() calls. Passing undefined resets to "gpt-5".
*/
function configureOpenAIProvider({ baseUrl, defaultModel: model }) {
	if (baseUrl) customFactory = (0, __ai_sdk_openai.createOpenAI)({ baseURL: baseUrl });
	else customFactory = null;
	if (model !== void 0) defaultModel = model;
}
/**
* Retrieve a configured OpenAI language model.
* If no model is specified, uses the configured default model (gpt-5).
*/
function getOpenAIModel(model) {
	const factory = customFactory ?? __ai_sdk_openai.openai;
	return factory(model ?? defaultModel);
}

//#endregion
Object.defineProperty(exports, 'configureOpenAIProvider', {
  enumerable: true,
  get: function () {
    return configureOpenAIProvider;
  }
});
Object.defineProperty(exports, 'getOpenAIModel', {
  enumerable: true,
  get: function () {
    return getOpenAIModel;
  }
});
//# sourceMappingURL=openai-provider-DhSY7kTj.cjs.map