const require_logger = require('./logger-B3t6CmTC.cjs');

//#region src/providers/openai/index.ts
var OpenAiGenericProvider = class {
	modelName;
	config;
	env;
	constructor(modelName, options = {}) {
		const { config, id, env } = options;
		this.env = env;
		this.modelName = modelName;
		this.config = config || {};
		this.id = id ? () => id : this.id;
	}
	id() {
		return this.config.apiHost || this.config.apiBaseUrl ? this.modelName : `openai:${this.modelName}`;
	}
	toString() {
		return `[OpenAI Provider ${this.modelName}]`;
	}
	getOrganization() {
		return this.config.organization || this.env?.OPENAI_ORGANIZATION || require_logger.getEnvString("OPENAI_ORGANIZATION");
	}
	getApiUrlDefault() {
		return "https://api.openai.com/v1";
	}
	getApiUrl() {
		const apiHost = this.config.apiHost || this.env?.OPENAI_API_HOST || require_logger.getEnvString("OPENAI_API_HOST");
		if (apiHost) return `https://${apiHost}/v1`;
		return this.config.apiBaseUrl || this.env?.OPENAI_API_BASE_URL || this.env?.OPENAI_BASE_URL || require_logger.getEnvString("OPENAI_API_BASE_URL") || require_logger.getEnvString("OPENAI_BASE_URL") || this.getApiUrlDefault();
	}
	getApiKey() {
		return this.config.apiKey || (this.config?.apiKeyEnvar ? require_logger.getEnvString(this.config.apiKeyEnvar) || this.env?.[this.config.apiKeyEnvar] : void 0) || this.env?.OPENAI_API_KEY || require_logger.getEnvString("OPENAI_API_KEY");
	}
	requiresApiKey() {
		return this.config.apiKeyRequired ?? true;
	}
	async callApi(_prompt, _context, _callApiOptions) {
		throw new Error("Not implemented");
	}
};

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