mirror of
https://github.com/openai/codex.git
synced 2026-05-01 09:56:37 +00:00
w (#8)
This commit is contained in:
committed by
GitHub
parent
8794df3c08
commit
1b40e19baf
@@ -1,6 +1,7 @@
|
||||
import { OPENAI_API_KEY } from "./config";
|
||||
import OpenAI from "openai";
|
||||
|
||||
const MODEL_LIST_TIMEOUT_MS = 2_000; // 2 seconds
|
||||
export const RECOMMENDED_MODELS: Array<string> = ["o4-mini", "o3"];
|
||||
|
||||
/**
|
||||
@@ -14,9 +15,9 @@ export const RECOMMENDED_MODELS: Array<string> = ["o4-mini", "o3"];
|
||||
let modelsPromise: Promise<Array<string>> | null = null;
|
||||
|
||||
async function fetchModels(): Promise<Array<string>> {
|
||||
// If the user has not configured an API key we cannot hit the network
|
||||
// If the user has not configured an API key we cannot hit the network.
|
||||
if (!OPENAI_API_KEY) {
|
||||
return ["o4-mini"];
|
||||
return RECOMMENDED_MODELS;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -67,8 +68,6 @@ export async function isModelSupportedForResponses(
|
||||
return true;
|
||||
}
|
||||
|
||||
const MODEL_LIST_TIMEOUT_MS = 2_000;
|
||||
|
||||
try {
|
||||
const models = await Promise.race<Array<string>>([
|
||||
getAvailableModels(),
|
||||
|
||||
Reference in New Issue
Block a user