feat: support multiple providers via Responses-Completion transformation (#247)
https://github.com/user-attachments/assets/9ecb51be-fa65-4e99-8512-abb898dda569 Implemented it as a transformation between Responses API and Completion API so that it supports existing providers that implement the Completion API and minimizes the changes needed to the codex repo. --------- Co-authored-by: Thibault Sottiaux <tibo@openai.com> Co-authored-by: Fouad Matin <169186268+fouad-openai@users.noreply.github.com> Co-authored-by: Fouad Matin <fouad@openai.com>
This commit is contained in:
45
codex-cli/src/utils/providers.ts
Normal file
45
codex-cli/src/utils/providers.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export const providers: Record<
|
||||
string,
|
||||
{ name: string; baseURL: string; envKey: string }
|
||||
> = {
|
||||
openai: {
|
||||
name: "OpenAI",
|
||||
baseURL: "https://api.openai.com/v1",
|
||||
envKey: "OPENAI_API_KEY",
|
||||
},
|
||||
openrouter: {
|
||||
name: "OpenRouter",
|
||||
baseURL: "https://openrouter.ai/api/v1",
|
||||
envKey: "OPENROUTER_API_KEY",
|
||||
},
|
||||
gemini: {
|
||||
name: "Gemini",
|
||||
baseURL: "https://generativelanguage.googleapis.com/v1beta/openai",
|
||||
envKey: "GEMINI_API_KEY",
|
||||
},
|
||||
ollama: {
|
||||
name: "Ollama",
|
||||
baseURL: "http://localhost:11434/v1",
|
||||
envKey: "OLLAMA_API_KEY",
|
||||
},
|
||||
mistral: {
|
||||
name: "Mistral",
|
||||
baseURL: "https://api.mistral.ai/v1",
|
||||
envKey: "MISTRAL_API_KEY",
|
||||
},
|
||||
deepseek: {
|
||||
name: "DeepSeek",
|
||||
baseURL: "https://api.deepseek.com",
|
||||
envKey: "DEEPSEEK_API_KEY",
|
||||
},
|
||||
xai: {
|
||||
name: "xAI",
|
||||
baseURL: "https://api.x.ai/v1",
|
||||
envKey: "XAI_API_KEY",
|
||||
},
|
||||
groq: {
|
||||
name: "Groq",
|
||||
baseURL: "https://api.groq.com/openai/v1",
|
||||
envKey: "GROQ_API_KEY",
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user