θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion server/utils/AiProviders/openAi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class OpenAiLLM {
// we don't want to hit the OpenAI api every chat because it will get spammed
// and introduce latency for no reason.
async isValidChatCompletionModel(modelName = "") {
const isPreset = modelName.toLowerCase().includes("gpt");
const isPreset =
modelName.toLowerCase().includes("gpt") ||
modelName.toLowerCase().includes("o1");
if (isPreset) return true;

const model = await this.openai.models
Expand Down
12 changes: 10 additions & 2 deletions server/utils/helpers/customModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,17 @@ async function openAiModels(apiKey = null) {
});

const gpts = allModels
.filter((model) => model.id.startsWith("gpt") || model.id.startsWith("o1"))
.filter(
(model) => !model.id.includes("vision") && !model.id.includes("instruct")
(model) =>
(model.id.includes("gpt") && !model.id.startsWith("ft:")) ||
model.id.includes("o1")
)
.filter(
(model) =>
!model.id.includes("vision") &&
!model.id.includes("instruct") &&
!model.id.includes("audio") &&
!model.id.includes("realtime")
)
.map((model) => {
return {
Expand Down