From d93f5c90619b36a1764bb7b40bb8872a823d4070 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 2 Feb 2025 09:04:10 -0500 Subject: [PATCH] =?UTF-8?q?=E2=98=81=EF=B8=8F=20feat:=20Additional=20AI=20?= =?UTF-8?q?Gateway=20Provider=20Support;=20fix:=20Reasoning=20Effort=20for?= =?UTF-8?q?=20Presets/Agents=20(#5600)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 fix: Prevent processing of non-artifact nodes in artifact plugin * refactor: remove deprecated fields, add `reasoning_effort` * refactor: move `reasoning_effort` to the second column in OpenAI settings * feat: add support for additional AI Gateway provider in extractBaseURL function * refactor: move `reasoning_effort` field to conversationPreset and remove from agentOptions --- api/models/schema/defaults.js | 10 ++++------ api/utils/extractBaseURL.js | 11 +++++++++++ client/src/components/Artifacts/Artifact.tsx | 3 +++ .../src/components/SidePanel/Parameters/settings.ts | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/api/models/schema/defaults.js b/api/models/schema/defaults.js index fb84ab99e3..73fef00b5a 100644 --- a/api/models/schema/defaults.js +++ b/api/models/schema/defaults.js @@ -117,6 +117,10 @@ const conversationPreset = { max_tokens: { type: Number, }, + /** omni models only */ + reasoning_effort: { + type: String, + }, }; const agentOptions = { @@ -166,12 +170,6 @@ const agentOptions = { type: Number, required: false, }, - context: { - type: String, - }, - systemMessage: { - type: String, - }, }; module.exports = { diff --git a/api/utils/extractBaseURL.js b/api/utils/extractBaseURL.js index 09bbb55056..e79a41e397 100644 --- a/api/utils/extractBaseURL.js +++ b/api/utils/extractBaseURL.js @@ -40,6 +40,17 @@ function extractBaseURL(url) { const suffixes = [ 'azure-openai', openai, + 'aws-bedrock', + 'anthropic', + 'cohere', + 'deepseek', + 'google-ai-studio', + 'google-vertex-ai', + 'grok', + 'groq', + 'mistral', + 'openrouter', + 'perplexity-ai', 'replicate', 'huggingface', 'workers-ai', diff --git a/client/src/components/Artifacts/Artifact.tsx b/client/src/components/Artifacts/Artifact.tsx index 1f89ca2b39..5081d9cc59 100644 --- a/client/src/components/Artifacts/Artifact.tsx +++ b/client/src/components/Artifacts/Artifact.tsx @@ -12,6 +12,9 @@ import ArtifactButton from './ArtifactButton'; export const artifactPlugin: Pluggable = () => { return (tree) => { visit(tree, ['textDirective', 'leafDirective', 'containerDirective'], (node) => { + if (node.name !== 'artifact') { + return; + } node.data = { hName: node.name, hProperties: node.attributes, diff --git a/client/src/components/SidePanel/Parameters/settings.ts b/client/src/components/SidePanel/Parameters/settings.ts index 9793673caa..81aa5345fe 100644 --- a/client/src/components/SidePanel/Parameters/settings.ts +++ b/client/src/components/SidePanel/Parameters/settings.ts @@ -468,7 +468,6 @@ const openAICol1: SettingsConfiguration = [ openAIParams.chatGptLabel, librechat.promptPrefix, librechat.maxContextTokens, - openAIParams.reasoning_effort, ]; const openAICol2: SettingsConfiguration = [ @@ -478,6 +477,7 @@ const openAICol2: SettingsConfiguration = [ openAIParams.frequency_penalty, openAIParams.presence_penalty, baseDefinitions.stop, + openAIParams.reasoning_effort, librechat.resendFiles, baseDefinitions.imageDetail, ];