feat: Add Codex CLI provider with OAuth authentication (#1273)

Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
This commit is contained in:
Ben Vargas
2025-10-05 14:04:45 -06:00
committed by GitHub
parent 86027f1ee4
commit b43b7ce201
28 changed files with 2496 additions and 78 deletions

View File

@@ -28,6 +28,13 @@ export class BaseAIProvider {
* @type {boolean}
*/
this.needsExplicitJsonSchema = false;
/**
* Whether this provider supports temperature parameter
* Can be overridden by subclasses
* @type {boolean}
*/
this.supportsTemperature = true;
}
/**
@@ -168,7 +175,9 @@ export class BaseAIProvider {
model: client(params.modelId),
messages: params.messages,
...this.prepareTokenParam(params.modelId, params.maxTokens),
temperature: params.temperature
...(this.supportsTemperature && params.temperature !== undefined
? { temperature: params.temperature }
: {})
});
log(
@@ -211,7 +220,9 @@ export class BaseAIProvider {
model: client(params.modelId),
messages: params.messages,
...this.prepareTokenParam(params.modelId, params.maxTokens),
temperature: params.temperature
...(this.supportsTemperature && params.temperature !== undefined
? { temperature: params.temperature }
: {})
});
log(
@@ -249,7 +260,9 @@ export class BaseAIProvider {
schema: zodSchema(params.schema),
mode: params.mode || 'auto',
maxOutputTokens: params.maxTokens,
temperature: params.temperature
...(this.supportsTemperature && params.temperature !== undefined
? { temperature: params.temperature }
: {})
});
log(
@@ -295,7 +308,9 @@ export class BaseAIProvider {
schemaName: params.objectName,
schemaDescription: `Generate a valid JSON object for ${params.objectName}`,
maxTokens: params.maxTokens,
temperature: params.temperature
...(this.supportsTemperature && params.temperature !== undefined
? { temperature: params.temperature }
: {})
});
log(