Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

feat(Anthropic, Google, OpenAI): allow changing settings/presets conversations mid-convo (#636)

Danny Avila637bb6bc116b
diff --git a/api/app/clients/AnthropicClient.js b/api/app/clients/AnthropicClient.js
index cbaff39ee4..280318a241 100644
--- a/api/app/clients/AnthropicClient.js
+++ b/api/app/clients/AnthropicClient.js
@@ -287,6 +287,8 @@ class AnthropicClient extends BaseClient {
getSaveOptions() {
return {
+ promptPrefix: this.options.promptPrefix,
+ modelLabel: this.options.modelLabel,
...this.modelOptions
};
}
diff --git a/api/app/clients/GoogleClient.js b/api/app/clients/GoogleClient.js
index 8f0c415bba..932a031a64 100644
--- a/api/app/clients/GoogleClient.js
+++ b/api/app/clients/GoogleClient.js
@@ -216,6 +216,8 @@ class GoogleClient extends BaseClient {
getSaveOptions() {
return {
+ promptPrefix: this.options.promptPrefix,
+ modelLabel: this.options.modelLabel,
...this.modelOptions
};
}
diff --git a/client/src/components/Input/AnthropicOptions/index.jsx b/client/src/components/Input/AnthropicOptions/index.jsx
index cc05e717ef..5fe9884d1a 100644
--- a/client/src/components/Input/AnthropicOptions/index.jsx
+++ b/client/src/components/Input/AnthropicOptions/index.jsx
@@ -14,13 +14,14 @@ function AnthropicOptions() {
const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
const [conversation, setConversation] = useRecoilState(store.conversation) || {};
- const { endpoint, conversationId } = conversation;
+ const { endpoint } = conversation;
const { model, modelLabel, promptPrefix, temperature, topP, topK, maxOutputTokens } =
conversation;
const endpointsConfig = useRecoilValue(store.endpointsConfig);
- if (endpoint !== 'anthropic') return null;
- if (conversationId !== 'new') return null;
+ if (endpoint !== 'anthropic') {
+ return null;
+ }
const models = endpointsConfig?.['anthropic']?.['availableModels'] || [];
diff --git a/client/src/components/Input/GoogleOptions/index.jsx b/client/src/components/Input/GoogleOptions/index.jsx
index 4c9b41d884..44a350c419 100644
--- a/client/src/components/Input/GoogleOptions/index.jsx
+++ b/client/src/components/Input/GoogleOptions/index.jsx
@@ -16,14 +16,15 @@ function GoogleOptions() {
const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
const [conversation, setConversation] = useRecoilState(store.conversation) || {};
- const { endpoint, conversationId } = conversation;
+ const { endpoint } = conversation;
const { model, modelLabel, promptPrefix, examples, temperature, topP, topK, maxOutputTokens } =
conversation;
const endpointsConfig = useRecoilValue(store.endpointsConfig);
- if (endpoint !== 'google') return null;
- if (conversationId !== 'new') return null;
+ if (endpoint !== 'google') {
+ return null;
+ }
const models = endpointsConfig?.['google']?.['availableModels'] || [];
diff --git a/client/src/components/Input/NewConversationMenu/index.jsx b/client/src/components/Input/NewConversationMenu/index.jsx
index 7e827d4c0b..8667e49308 100644
--- a/client/src/components/Input/NewConversationMenu/index.jsx
+++ b/client/src/components/Input/NewConversationMenu/index.jsx
@@ -37,8 +37,8 @@ export default function NewConversationMenu() {
const availableEndpoints = useRecoilValue(store.availableEndpoints);
const endpointsConfig = useRecoilValue(store.endpointsConfig);
const [presets, setPresets] = useRecoilState(store.presets);
+ const modularEndpoints = new Set(['gptPlugins', 'anthropic', 'google', 'openAI']);
- // const conversation = useRecoilValue(store.conversation) || {};
const { endpoint, conversationId } = conversation;
const { newConversation } = store.useConversation();
@@ -108,7 +108,7 @@ export default function NewConversationMenu() {
const onSelectPreset = (newPreset) => {
setMenuOpen(false);
- if (endpoint === 'gptPlugins' && newPreset?.endpoint === 'gptPlugins') {
+ if (modularEndpoints.has(endpoint) && modularEndpoints.has(newPreset?.endpoint)) {
const currentConvo = getDefaultConversation({
conversation,
endpointsConfig,
diff --git a/client/src/components/Input/OpenAIOptions/index.jsx b/client/src/components/Input/OpenAIOptions/index.jsx
index b5e15e4fb6..aa74712f37 100644
--- a/client/src/components/Input/OpenAIOptions/index.jsx
+++ b/client/src/components/Input/OpenAIOptions/index.jsx
@@ -15,7 +15,7 @@ function OpenAIOptions() {
const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
const [conversation, setConversation] = useRecoilState(store.conversation) || {};
- const { endpoint, conversationId } = conversation;
+ const { endpoint } = conversation;
const {
model,
chatGptLabel,
@@ -28,8 +28,9 @@ function OpenAIOptions() {
const endpointsConfig = useRecoilValue(store.endpointsConfig);
const isOpenAI = endpoint === 'openAI' || endpoint === 'azureOpenAI';
- if (!isOpenAI) return null;
- if (conversationId !== 'new') return null;
+ if (!isOpenAI) {
+ return null;
+ }
const models = endpointsConfig?.[endpoint]?.['availableModels'] || [];