🐛 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:
Danny Avila 2025-01-08 21:57:00 -05:00 committed by GitHub
parent 916faf6447
commit 69a9b8b911
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 201 additions and 148 deletions

View file

@ -862,6 +862,7 @@ class GoogleClient extends BaseClient {
getSaveOptions() { getSaveOptions() {
return { return {
endpointType: null,
artifacts: this.options.artifacts, artifacts: this.options.artifacts,
promptPrefix: this.options.promptPrefix, promptPrefix: this.options.promptPrefix,
modelLabel: this.options.modelLabel, modelLabel: this.options.modelLabel,

View file

@ -6,6 +6,7 @@ const loadCustomConfig = require('./Config/loadCustomConfig');
const handleRateLimits = require('./Config/handleRateLimits'); const handleRateLimits = require('./Config/handleRateLimits');
const { loadDefaultInterface } = require('./start/interface'); const { loadDefaultInterface } = require('./start/interface');
const { azureConfigSetup } = require('./start/azureOpenAI'); const { azureConfigSetup } = require('./start/azureOpenAI');
const { processModelSpecs } = require('./start/modelSpecs');
const { loadAndFormatTools } = require('./ToolService'); const { loadAndFormatTools } = require('./ToolService');
const { agentsConfigSetup } = require('./start/agents'); const { agentsConfigSetup } = require('./start/agents');
const { initializeRoles } = require('~/models/Role'); const { initializeRoles } = require('~/models/Role');
@ -122,9 +123,9 @@ const AppService = async (app) => {
app.locals = { app.locals = {
...defaultLocals, ...defaultLocals,
modelSpecs: config.modelSpecs,
fileConfig: config?.fileConfig, fileConfig: config?.fileConfig,
secureImageLinks: config?.secureImageLinks, secureImageLinks: config?.secureImageLinks,
modelSpecs: processModelSpecs(endpoints, config.modelSpecs),
...endpointLocals, ...endpointLocals,
}; };
}; };

View file

@ -0,0 +1,61 @@
const { EModelEndpoint } = require('librechat-data-provider');
const { normalizeEndpointName } = require('~/server/utils');
const { logger } = require('~/config');
/**
* Sets up Model Specs from the config (`librechat.yaml`) file.
* @param {TCustomConfig['endpoints']} endpoints - The loaded custom configuration for endpoints.
* @param {TCustomConfig['modelSpecs'] | undefined} [modelSpecs] - The loaded custom configuration for model specs.
* @returns {TCustomConfig['modelSpecs'] | undefined} The processed model specs, if any.
*/
function processModelSpecs(endpoints, _modelSpecs) {
if (!_modelSpecs) {
return undefined;
}
/** @type {TCustomConfig['modelSpecs']['list']} */
const modelSpecs = [];
/** @type {TCustomConfig['modelSpecs']['list']} */
const list = _modelSpecs.list;
const customEndpoints = endpoints[EModelEndpoint.custom] ?? [];
for (const spec of list) {
if (EModelEndpoint[spec.preset.endpoint] && spec.preset.endpoint !== EModelEndpoint.custom) {
modelSpecs.push(spec);
continue;
} else if (spec.preset.endpoint === EModelEndpoint.custom) {
logger.warn(
`Model Spec with endpoint "${spec.preset.endpoint}" is not supported. You must specify the name of the custom endpoint (case-sensitive, as defined in your config). Skipping model spec...`,
);
continue;
}
const normalizedName = normalizeEndpointName(spec.preset.endpoint);
const endpoint = customEndpoints.find(
(customEndpoint) => normalizedName === normalizeEndpointName(customEndpoint.name),
);
if (!endpoint) {
logger.warn(`Model spec with endpoint "${spec.preset.endpoint}" was skipped: Endpoint not found in configuration. The \`endpoint\` value must exactly match either a system-defined endpoint or a custom endpoint defined by the user.
For more information, see the documentation at https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/model_specs#endpoint`);
continue;
}
modelSpecs.push({
...spec,
preset: {
...spec.preset,
endpoint: normalizedName,
},
});
}
return {
..._modelSpecs,
list: modelSpecs,
};
}
module.exports = { processModelSpecs };

View file

@ -1,6 +1,5 @@
import { useRecoilState, useRecoilValue } from 'recoil';
import { EModelEndpoint } from 'librechat-data-provider';
import { useRef, useEffect, useCallback } from 'react'; import { useRef, useEffect, useCallback } from 'react';
import { useRecoilState, useRecoilValue } from 'recoil';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useUpdateMessageMutation } from 'librechat-data-provider/react-query'; import { useUpdateMessageMutation } from 'librechat-data-provider/react-query';
import type { TEditProps } from '~/common'; import type { TEditProps } from '~/common';
@ -31,8 +30,6 @@ const EditMessage = ({
const textAreaRef = useRef<HTMLTextAreaElement | null>(null); const textAreaRef = useRef<HTMLTextAreaElement | null>(null);
const { conversationId, parentMessageId, messageId } = message; const { conversationId, parentMessageId, messageId } = message;
const { endpoint: _endpoint, endpointType } = conversation ?? { endpoint: null };
const endpoint = endpointType ?? _endpoint;
const updateMessageMutation = useUpdateMessageMutation(conversationId ?? ''); const updateMessageMutation = useUpdateMessageMutation(conversationId ?? '');
const localize = useLocalize(); const localize = useLocalize();
@ -181,9 +178,7 @@ const EditMessage = ({
<button <button
ref={submitButtonRef} ref={submitButtonRef}
className="btn btn-primary relative mr-2" className="btn btn-primary relative mr-2"
disabled={ disabled={isSubmitting}
isSubmitting || (endpoint === EModelEndpoint.google && !message.isCreatedByUser)
}
onClick={handleSubmit(resubmitMessage)} onClick={handleSubmit(resubmitMessage)}
> >
{localize('com_ui_save_submit')} {localize('com_ui_save_submit')}

View file

@ -1,9 +1,9 @@
import { useRecoilValue } from 'recoil'; import { useRecoilValue } from 'recoil';
import { SettingsViews } from 'librechat-data-provider'; import { SettingsViews, TConversation } from 'librechat-data-provider';
import { useGetModelsQuery } from 'librechat-data-provider/react-query'; import { useGetModelsQuery, useGetEndpointsQuery } from 'librechat-data-provider/react-query';
import type { TSettingsProps } from '~/common'; import type { TSettingsProps } from '~/common';
import { getSettings } from './Settings'; import { getSettings } from './Settings';
import { cn } from '~/utils'; import { cn, getEndpointField } from '~/utils';
import store from '~/store'; import store from '~/store';
export default function Settings({ export default function Settings({
@ -13,15 +13,17 @@ export default function Settings({
className = '', className = '',
}: TSettingsProps) { }: TSettingsProps) {
const modelsQuery = useGetModelsQuery(); const modelsQuery = useGetModelsQuery();
const { data: endpointsConfig } = useGetEndpointsQuery();
const currentSettingsView = useRecoilValue(store.currentSettingsView); 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; return null;
} }
const { settings, multiViewSettings } = getSettings(); const { settings, multiViewSettings } = getSettings();
const { endpoint: _endpoint, endpointType } = conversation; const { endpoint: _endpoint } = conversation as TConversation;
const models = modelsQuery?.data?.[_endpoint] ?? []; const models = modelsQuery.data?.[_endpoint ?? ''] ?? [];
const endpoint = endpointType ?? _endpoint;
const OptionComponent = settings[endpoint]; const OptionComponent = settings[endpoint];
if (OptionComponent) { if (OptionComponent) {
@ -39,7 +41,7 @@ export default function Settings({
const MultiViewComponent = multiViewSettings[endpoint]; const MultiViewComponent = multiViewSettings[endpoint];
if (!MultiViewComponent) { if (MultiViewComponent == null) {
return null; return null;
} }

View file

@ -8,7 +8,7 @@ import BedrockSettings from './Bedrock';
import BingAISettings from './BingAI'; import BingAISettings from './BingAI';
import OpenAISettings from './OpenAI'; import OpenAISettings from './OpenAI';
const settings: { [key: string]: FC<TModelSelectProps> } = { const settings: { [key: string]: FC<TModelSelectProps> | undefined } = {
[EModelEndpoint.assistants]: AssistantsSettings, [EModelEndpoint.assistants]: AssistantsSettings,
[EModelEndpoint.azureAssistants]: AssistantsSettings, [EModelEndpoint.azureAssistants]: AssistantsSettings,
[EModelEndpoint.agents]: OpenAISettings, [EModelEndpoint.agents]: OpenAISettings,

View file

@ -4,7 +4,6 @@ import { useRecoilState, useSetRecoilState } from 'recoil';
import { LocalStorageKeys } from 'librechat-data-provider'; import { LocalStorageKeys } from 'librechat-data-provider';
import { useAvailablePluginsQuery } from 'librechat-data-provider/react-query'; import { useAvailablePluginsQuery } from 'librechat-data-provider/react-query';
import type { TStartupConfig, TPlugin, TUser } from 'librechat-data-provider'; import type { TStartupConfig, TPlugin, TUser } from 'librechat-data-provider';
import { data as modelSpecs } from '~/components/Chat/Menus/Models/fakeData';
import { mapPlugins, selectPlugins, processPlugins } from '~/utils'; import { mapPlugins, selectPlugins, processPlugins } from '~/utils';
import useConfigOverride from './useConfigOverride'; import useConfigOverride from './useConfigOverride';
import store from '~/store'; import store from '~/store';
@ -36,18 +35,22 @@ export default function useAppStartup({
/** Set the app title */ /** Set the app title */
useEffect(() => { useEffect(() => {
if (startupConfig?.appTitle) { const appTitle = startupConfig?.appTitle ?? '';
document.title = startupConfig.appTitle; if (!appTitle) {
localStorage.setItem(LocalStorageKeys.APP_TITLE, startupConfig.appTitle); return;
} }
document.title = appTitle;
localStorage.setItem(LocalStorageKeys.APP_TITLE, appTitle);
}, [startupConfig]); }, [startupConfig]);
/** Set the default spec's preset as default */ /** Set the default spec's preset as default */
useEffect(() => { useEffect(() => {
if (defaultPreset && defaultPreset.spec) { if (defaultPreset && defaultPreset.spec != null) {
return; return;
} }
const modelSpecs = startupConfig?.modelSpecs?.list;
if (!modelSpecs || !modelSpecs.length) { if (!modelSpecs || !modelSpecs.length) {
return; return;
} }
@ -63,7 +66,7 @@ export default function useAppStartup({
iconURL: defaultSpec.iconURL, iconURL: defaultSpec.iconURL,
spec: defaultSpec.name, spec: defaultSpec.name,
}); });
}, [defaultPreset, setDefaultPreset]); }, [defaultPreset, setDefaultPreset, startupConfig?.modelSpecs?.list]);
/** Set the available Plugins */ /** Set the available Plugins */
useEffect(() => { useEffect(() => {
@ -75,17 +78,20 @@ export default function useAppStartup({
return; return;
} }
if (!user.plugins || user.plugins.length === 0) { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const userPlugins = user.plugins ?? [];
if (userPlugins.length === 0) {
setAvailableTools({ pluginStore }); setAvailableTools({ pluginStore });
return; return;
} }
const tools = [...user.plugins] const tools = [...userPlugins]
.map((el) => allPlugins.map[el]) .map((el) => allPlugins.map[el])
.filter((el): el is TPlugin => el !== undefined); .filter((el: TPlugin | undefined): el is TPlugin => el !== undefined);
/* Filter Last Selected Tools */ /* Filter Last Selected Tools */
const localStorageItem = localStorage.getItem(LocalStorageKeys.LAST_TOOLS); const localStorageItem = localStorage.getItem(LocalStorageKeys.LAST_TOOLS) ?? '';
if (!localStorageItem) { if (!localStorageItem) {
return setAvailableTools({ pluginStore, ...mapPlugins(tools) }); return setAvailableTools({ pluginStore, ...mapPlugins(tools) });
} }
@ -94,7 +100,7 @@ export default function useAppStartup({
.filter((tool: TPlugin) => .filter((tool: TPlugin) =>
tools.some((existingTool) => existingTool.pluginKey === tool.pluginKey), tools.some((existingTool) => existingTool.pluginKey === tool.pluginKey),
) )
.filter((tool: TPlugin) => !!tool); .filter((tool: TPlugin | undefined) => !!tool);
localStorage.setItem(LocalStorageKeys.LAST_TOOLS, JSON.stringify(filteredTools)); localStorage.setItem(LocalStorageKeys.LAST_TOOLS, JSON.stringify(filteredTools));
setAvailableTools({ pluginStore, ...mapPlugins(tools) }); setAvailableTools({ pluginStore, ...mapPlugins(tools) });

2
package-lock.json generated
View file

@ -36286,7 +36286,7 @@
}, },
"packages/data-provider": { "packages/data-provider": {
"name": "librechat-data-provider", "name": "librechat-data-provider",
"version": "0.7.691", "version": "0.7.692",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^1.7.7", "axios": "^1.7.7",

View file

@ -1,6 +1,6 @@
{ {
"name": "librechat-data-provider", "name": "librechat-data-provider",
"version": "0.7.691", "version": "0.7.692",
"description": "data services for librechat apps", "description": "data services for librechat apps",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.es.js", "module": "dist/index.es.js",

View file

@ -4,7 +4,7 @@ import type { ZodError } from 'zod';
import type { TModelsConfig } from './types'; import type { TModelsConfig } from './types';
import { EModelEndpoint, eModelEndpointSchema } from './schemas'; import { EModelEndpoint, eModelEndpointSchema } from './schemas';
import { fileConfigSchema } from './file-config'; import { fileConfigSchema } from './file-config';
import { specsConfigSchema } from './models'; import { specsConfigSchema, TSpecsConfig } from './models';
import { FileSources } from './types/files'; import { FileSources } from './types/files';
import { MCPServersSchema } from './mcp'; import { MCPServersSchema } from './mcp';
@ -427,6 +427,82 @@ export enum EImageOutputType {
JPEG = 'jpeg', JPEG = 'jpeg',
} }
export const intefaceSchema = z
.object({
privacyPolicy: z
.object({
externalUrl: z.string().optional(),
openNewTab: z.boolean().optional(),
})
.optional(),
termsOfService: z
.object({
externalUrl: z.string().optional(),
openNewTab: z.boolean().optional(),
modalAcceptance: z.boolean().optional(),
modalTitle: z.string().optional(),
modalContent: z.string().or(z.array(z.string())).optional(),
})
.optional(),
endpointsMenu: z.boolean().optional(),
modelSelect: z.boolean().optional(),
parameters: z.boolean().optional(),
sidePanel: z.boolean().optional(),
multiConvo: z.boolean().optional(),
bookmarks: z.boolean().optional(),
presets: z.boolean().optional(),
prompts: z.boolean().optional(),
agents: z.boolean().optional(),
})
.default({
endpointsMenu: true,
modelSelect: true,
parameters: true,
sidePanel: true,
presets: true,
multiConvo: true,
bookmarks: true,
prompts: true,
agents: true,
});
export type TInterfaceConfig = z.infer<typeof intefaceSchema>;
export type TStartupConfig = {
appTitle: string;
socialLogins?: string[];
interface?: TInterfaceConfig;
discordLoginEnabled: boolean;
facebookLoginEnabled: boolean;
githubLoginEnabled: boolean;
googleLoginEnabled: boolean;
openidLoginEnabled: boolean;
openidLabel: string;
openidImageUrl: string;
/** LDAP Auth Configuration */
ldap?: {
/** LDAP enabled */
enabled: boolean;
/** Whether LDAP uses username vs. email */
username?: boolean;
};
serverDomain: string;
emailLoginEnabled: boolean;
registrationEnabled: boolean;
socialLoginEnabled: boolean;
passwordResetEnabled: boolean;
emailEnabled: boolean;
checkBalance: boolean;
showBirthdayIcon: boolean;
helpAndFaqURL: string;
customFooter?: string;
modelSpecs?: TSpecsConfig;
sharedLinksEnabled: boolean;
publicSharedLinksEnabled: boolean;
analyticsGtmId?: string;
instanceProjectId: string;
};
export const configSchema = z.object({ export const configSchema = z.object({
version: z.string(), version: z.string(),
cache: z.boolean().default(true), cache: z.boolean().default(true),
@ -435,44 +511,7 @@ export const configSchema = z.object({
includedTools: z.array(z.string()).optional(), includedTools: z.array(z.string()).optional(),
filteredTools: z.array(z.string()).optional(), filteredTools: z.array(z.string()).optional(),
mcpServers: MCPServersSchema.optional(), mcpServers: MCPServersSchema.optional(),
interface: z interface: intefaceSchema,
.object({
privacyPolicy: z
.object({
externalUrl: z.string().optional(),
openNewTab: z.boolean().optional(),
})
.optional(),
termsOfService: z
.object({
externalUrl: z.string().optional(),
openNewTab: z.boolean().optional(),
modalAcceptance: z.boolean().optional(),
modalTitle: z.string().optional(),
modalContent: z.string().or(z.array(z.string())).optional(),
})
.optional(),
endpointsMenu: z.boolean().optional(),
modelSelect: z.boolean().optional(),
parameters: z.boolean().optional(),
sidePanel: z.boolean().optional(),
multiConvo: z.boolean().optional(),
bookmarks: z.boolean().optional(),
presets: z.boolean().optional(),
prompts: z.boolean().optional(),
agents: z.boolean().optional(),
})
.default({
endpointsMenu: true,
modelSelect: true,
parameters: true,
sidePanel: true,
presets: true,
multiConvo: true,
bookmarks: true,
prompts: true,
agents: true,
}),
fileStrategy: fileSourceSchema.default(FileSources.local), fileStrategy: fileSourceSchema.default(FileSources.local),
actions: z actions: z
.object({ .object({

View file

@ -173,7 +173,7 @@ export const updateUserPlugins = (payload: t.TUpdateUserPlugins) => {
/* Config */ /* Config */
export const getStartupConfig = (): Promise<t.TStartupConfig> => { export const getStartupConfig = (): Promise<config.TStartupConfig> => {
return request.get(endpoints.config()); return request.get(endpoints.config());
}; };

View file

@ -37,7 +37,7 @@ export const tModelSpecSchema = z.object({
export const specsConfigSchema = z.object({ export const specsConfigSchema = z.object({
enforce: z.boolean().default(false), enforce: z.boolean().default(false),
prioritize: z.boolean().default(true), prioritize: z.boolean().default(true),
list: z.array(tModelSpecSchema).optional(), list: z.array(tModelSpecSchema).min(1),
}); });
export type TSpecsConfig = z.infer<typeof specsConfigSchema>; export type TSpecsConfig = z.infer<typeof specsConfigSchema>;

View file

@ -5,6 +5,7 @@ import type {
QueryObserverResult, QueryObserverResult,
} from '@tanstack/react-query'; } from '@tanstack/react-query';
import { initialModelsConfig, LocalStorageKeys } from '../config'; import { initialModelsConfig, LocalStorageKeys } from '../config';
import type { TStartupConfig } from '../config';
import { defaultOrderQuery } from '../types/assistants'; import { defaultOrderQuery } from '../types/assistants';
import * as dataService from '../data-service'; import * as dataService from '../data-service';
import * as m from '../types/mutations'; import * as m from '../types/mutations';
@ -423,18 +424,14 @@ export const useUpdateUserPluginsMutation = (
}; };
export const useGetStartupConfig = ( export const useGetStartupConfig = (
config?: UseQueryOptions<t.TStartupConfig>, config?: UseQueryOptions<TStartupConfig>,
): QueryObserverResult<t.TStartupConfig> => { ): QueryObserverResult<TStartupConfig> => {
return useQuery<t.TStartupConfig>( return useQuery<TStartupConfig>([QueryKeys.startupConfig], () => dataService.getStartupConfig(), {
[QueryKeys.startupConfig], refetchOnWindowFocus: false,
() => dataService.getStartupConfig(), refetchOnReconnect: false,
{ refetchOnMount: false,
refetchOnWindowFocus: false, ...config,
refetchOnReconnect: false, });
refetchOnMount: false,
...config,
},
);
}; };
export const useGetCustomConfigSpeechQuery = ( export const useGetCustomConfigSpeechQuery = (

View file

@ -526,7 +526,7 @@ const DocumentType: z.ZodType<DocumentTypeValue> = z.lazy(() =>
export const tConversationSchema = z.object({ export const tConversationSchema = z.object({
conversationId: z.string().nullable(), conversationId: z.string().nullable(),
endpoint: eModelEndpointSchema.nullable(), endpoint: eModelEndpointSchema.nullable(),
endpointType: eModelEndpointSchema.optional(), endpointType: eModelEndpointSchema.nullable().optional(),
isArchived: z.boolean().optional(), isArchived: z.boolean().optional(),
title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'), title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
user: z.string().optional(), user: z.string().optional(),
@ -559,9 +559,9 @@ export const tConversationSchema = z.object({
createdAt: z.string(), createdAt: z.string(),
updatedAt: z.string(), updatedAt: z.string(),
/* Files */ /* Files */
resendFiles: z.boolean().optional(),
file_ids: z.array(z.string()).optional(), file_ids: z.array(z.string()).optional(),
/* vision */ /* vision */
resendFiles: z.boolean().optional(),
imageDetail: eImageDetailSchema.optional(), imageDetail: eImageDetailSchema.optional(),
/* assistant */ /* assistant */
assistant_id: z.string().optional(), assistant_id: z.string().optional(),
@ -571,16 +571,17 @@ export const tConversationSchema = z.object({
region: z.string().optional(), region: z.string().optional(),
maxTokens: coerceNumber.optional(), maxTokens: coerceNumber.optional(),
additionalModelRequestFields: DocumentType.optional(), additionalModelRequestFields: DocumentType.optional(),
/* assistant + agents */ /* assistants */
instructions: z.string().optional(), instructions: z.string().optional(),
additional_instructions: z.string().optional(), additional_instructions: z.string().optional(),
append_current_datetime: z.boolean().optional(),
/** Used to overwrite active conversation settings when saving a Preset */ /** Used to overwrite active conversation settings when saving a Preset */
presetOverride: z.record(z.unknown()).optional(), presetOverride: z.record(z.unknown()).optional(),
stop: z.array(z.string()).optional(), stop: z.array(z.string()).optional(),
/* frontend components */ /* frontend components */
iconURL: z.string().optional(),
greeting: z.string().optional(), greeting: z.string().optional(),
spec: z.string().optional(), spec: z.string().nullable().optional(),
iconURL: z.string().nullable().optional(),
/* /*
Deprecated fields Deprecated fields
*/ */
@ -606,7 +607,6 @@ export const tConversationSchema = z.object({
agentOptions: tAgentOptionsSchema.nullable().optional(), agentOptions: tAgentOptionsSchema.nullable().optional(),
/** @deprecated Prefer `modelLabel` over `chatGptLabel` */ /** @deprecated Prefer `modelLabel` over `chatGptLabel` */
chatGptLabel: z.string().nullable().optional(), chatGptLabel: z.string().nullable().optional(),
append_current_datetime: z.boolean().optional(),
}); });
export const tPresetSchema = tConversationSchema export const tPresetSchema = tConversationSchema
@ -642,6 +642,13 @@ export const tQueryParamsSchema = tConversationSchema
* Whether or not to re-submit files from previous messages on subsequent messages * Whether or not to re-submit files from previous messages on subsequent messages
* */ * */
resendFiles: true, resendFiles: true,
/**
* @endpoints openAI, custom, azureOpenAI
*
* System parameter that only affects the above endpoints.
* Image detail for re-sizing according to OpenAI spec, defaults to `auto`
* */
imageDetail: true,
/** /**
* AKA Custom Instructions, dynamically added to chat history as a system message; * AKA Custom Instructions, dynamically added to chat history as a system message;
* for `bedrock` endpoint, this is used as the `system` model param if the provider uses it; * for `bedrock` endpoint, this is used as the `system` model param if the provider uses it;
@ -681,6 +688,8 @@ export const tQueryParamsSchema = tConversationSchema
agent_id: true, agent_id: true,
/** @endpoints assistants, azureAssistants */ /** @endpoints assistants, azureAssistants */
assistant_id: true, assistant_id: true,
/** @endpoints assistants, azureAssistants */
append_current_datetime: true,
/** /**
* @endpoints assistants, azureAssistants * @endpoints assistants, azureAssistants
* *

View file

@ -10,7 +10,6 @@ import type {
TConversationTag, TConversationTag,
TBanner, TBanner,
} from './schemas'; } from './schemas';
import type { TSpecsConfig } from './models';
export type TOpenAIMessage = OpenAI.Chat.ChatCompletionMessageParam; export type TOpenAIMessage = OpenAI.Chat.ChatCompletionMessageParam;
export * from './schemas'; export * from './schemas';
@ -108,7 +107,7 @@ export type TUser = {
avatar: string; avatar: string;
role: string; role: string;
provider: string; provider: string;
plugins: string[]; plugins?: string[];
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
}; };
@ -312,63 +311,6 @@ export type TVerifyEmail = {
export type TResendVerificationEmail = Omit<TVerifyEmail, 'token'>; export type TResendVerificationEmail = Omit<TVerifyEmail, 'token'>;
export type TInterfaceConfig = {
privacyPolicy?: {
externalUrl?: string;
openNewTab?: boolean;
};
termsOfService?: {
externalUrl?: string;
openNewTab?: boolean;
modalAcceptance?: boolean;
modalTitle?: string;
modalContent?: string;
};
endpointsMenu: boolean;
modelSelect: boolean;
parameters: boolean;
sidePanel: boolean;
presets: boolean;
multiConvo: boolean;
bookmarks: boolean;
prompts: boolean;
};
export type TStartupConfig = {
appTitle: string;
socialLogins?: string[];
interface?: TInterfaceConfig;
discordLoginEnabled: boolean;
facebookLoginEnabled: boolean;
githubLoginEnabled: boolean;
googleLoginEnabled: boolean;
openidLoginEnabled: boolean;
openidLabel: string;
openidImageUrl: string;
/** LDAP Auth Configuration */
ldap?: {
/** LDAP enabled */
enabled: boolean;
/** Whether LDAP uses username vs. email */
username?: boolean;
};
serverDomain: string;
emailLoginEnabled: boolean;
registrationEnabled: boolean;
socialLoginEnabled: boolean;
passwordResetEnabled: boolean;
emailEnabled: boolean;
checkBalance: boolean;
showBirthdayIcon: boolean;
helpAndFaqURL: string;
customFooter?: string;
modelSpecs?: TSpecsConfig;
sharedLinksEnabled: boolean;
publicSharedLinksEnabled: boolean;
analyticsGtmId?: string;
instanceProjectId: string;
};
export type TRefreshTokenResponse = { export type TRefreshTokenResponse = {
token: string; token: string;
user: TUser; user: TUser;