mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
🐛 fix: Ensure Default ModelSpecs Are Set Correctly (#5218)
* 🐛 fix: default modelSpecs not being set
* feat: Add imageDetail parameter for OpenAI endpoints in tQueryParamsSchema
* feat: Implement processModelSpecs function to enhance model specs processing from configuration
* feat: Refactor configuration schemas and types for improved structure and clarity
* feat: Add append_current_datetime parameter to tQueryParamsSchema for enhanced endpoint functionality
* fix: Add endpointType to getSaveOptions and enhance endpoint handling in Settings component
* fix: Change endpointType to be nullable and optional in tConversationSchema for improved flexibility
* fix: allow save & submit for google endpoint
This commit is contained in:
parent
916faf6447
commit
69a9b8b911
15 changed files with 201 additions and 148 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { SettingsViews } from 'librechat-data-provider';
|
||||
import { useGetModelsQuery } from 'librechat-data-provider/react-query';
|
||||
import { SettingsViews, TConversation } from 'librechat-data-provider';
|
||||
import { useGetModelsQuery, useGetEndpointsQuery } from 'librechat-data-provider/react-query';
|
||||
import type { TSettingsProps } from '~/common';
|
||||
import { getSettings } from './Settings';
|
||||
import { cn } from '~/utils';
|
||||
import { cn, getEndpointField } from '~/utils';
|
||||
import store from '~/store';
|
||||
|
||||
export default function Settings({
|
||||
|
|
@ -13,15 +13,17 @@ export default function Settings({
|
|||
className = '',
|
||||
}: TSettingsProps) {
|
||||
const modelsQuery = useGetModelsQuery();
|
||||
const { data: endpointsConfig } = useGetEndpointsQuery();
|
||||
const currentSettingsView = useRecoilValue(store.currentSettingsView);
|
||||
if (!conversation?.endpoint || currentSettingsView !== SettingsViews.default) {
|
||||
const endpointType = getEndpointField(endpointsConfig, conversation?.endpoint ?? '', 'type');
|
||||
const endpoint = endpointType ?? conversation?.endpoint ?? '';
|
||||
if (!endpoint || currentSettingsView !== SettingsViews.default) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { settings, multiViewSettings } = getSettings();
|
||||
const { endpoint: _endpoint, endpointType } = conversation;
|
||||
const models = modelsQuery?.data?.[_endpoint] ?? [];
|
||||
const endpoint = endpointType ?? _endpoint;
|
||||
const { endpoint: _endpoint } = conversation as TConversation;
|
||||
const models = modelsQuery.data?.[_endpoint ?? ''] ?? [];
|
||||
const OptionComponent = settings[endpoint];
|
||||
|
||||
if (OptionComponent) {
|
||||
|
|
@ -39,7 +41,7 @@ export default function Settings({
|
|||
|
||||
const MultiViewComponent = multiViewSettings[endpoint];
|
||||
|
||||
if (!MultiViewComponent) {
|
||||
if (MultiViewComponent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import BedrockSettings from './Bedrock';
|
|||
import BingAISettings from './BingAI';
|
||||
import OpenAISettings from './OpenAI';
|
||||
|
||||
const settings: { [key: string]: FC<TModelSelectProps> } = {
|
||||
const settings: { [key: string]: FC<TModelSelectProps> | undefined } = {
|
||||
[EModelEndpoint.assistants]: AssistantsSettings,
|
||||
[EModelEndpoint.azureAssistants]: AssistantsSettings,
|
||||
[EModelEndpoint.agents]: OpenAISettings,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue