fix: route fun codex through responses api (#815)
This commit is contained in:
@@ -9,7 +9,7 @@ export interface ProviderPreset {
|
|||||||
base_url: string
|
base_url: string
|
||||||
models: string[]
|
models: string[]
|
||||||
builtin: boolean
|
builtin: boolean
|
||||||
api_mode?: 'openai' | 'anthropic' | 'anthropic_messages'
|
api_mode?: 'chat_completions' | 'codex_responses' | 'anthropic_messages' | 'bedrock_converse' | 'codex_app_server'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PROVIDER_PRESETS: ProviderPreset[] = [
|
export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||||
@@ -18,6 +18,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
|||||||
value: 'fun-codex',
|
value: 'fun-codex',
|
||||||
builtin: true,
|
builtin: true,
|
||||||
base_url: 'https://api.apikey.fun/v1',
|
base_url: 'https://api.apikey.fun/v1',
|
||||||
|
api_mode: 'codex_responses',
|
||||||
models: [
|
models: [
|
||||||
'gpt-5.5',
|
'gpt-5.5',
|
||||||
'gpt-5.4',
|
'gpt-5.4',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
} from '../../packages/server/src/shared/providers'
|
} from '../../packages/server/src/shared/providers'
|
||||||
|
|
||||||
const OPENAI_CODEX_PROVIDER = 'openai-codex'
|
const OPENAI_CODEX_PROVIDER = 'openai-codex'
|
||||||
|
const FUN_CODEX_PROVIDER = 'fun-codex'
|
||||||
const GPT_5_5_MODEL = 'gpt-5.5'
|
const GPT_5_5_MODEL = 'gpt-5.5'
|
||||||
|
|
||||||
function modelsForProvider(providerPresets: Array<{ value: string; models: string[] }>, provider: string): string[] {
|
function modelsForProvider(providerPresets: Array<{ value: string; models: string[] }>, provider: string): string[] {
|
||||||
@@ -15,6 +16,11 @@ function modelsForProvider(providerPresets: Array<{ value: string; models: strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('provider presets', () => {
|
describe('provider presets', () => {
|
||||||
|
it('routes apikey.fun Codex through the Responses transport', () => {
|
||||||
|
const preset = SERVER_PROVIDER_PRESETS.find((candidate) => candidate.value === FUN_CODEX_PROVIDER)
|
||||||
|
expect(preset?.api_mode).toBe('codex_responses')
|
||||||
|
})
|
||||||
|
|
||||||
it('lists GPT-5.5 for OpenAI Codex', () => {
|
it('lists GPT-5.5 for OpenAI Codex', () => {
|
||||||
expect(modelsForProvider(SERVER_PROVIDER_PRESETS, OPENAI_CODEX_PROVIDER)).toContain(GPT_5_5_MODEL)
|
expect(modelsForProvider(SERVER_PROVIDER_PRESETS, OPENAI_CODEX_PROVIDER)).toContain(GPT_5_5_MODEL)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user