2024-08-26 15:34:46 -04:00
const {
SystemRoles ,
Permissions ,
2025-08-14 02:15:33 -04:00
roleDefaults ,
2024-08-26 15:34:46 -04:00
PermissionTypes ,
removeNullishValues ,
} = require ( 'librechat-data-provider' ) ;
2025-08-10 14:46:16 -04:00
const { logger } = require ( '@librechat/data-schemas' ) ;
const { isMemoryEnabled } = require ( '@librechat/api' ) ;
2025-08-10 21:42:54 -04:00
const { updateAccessPermissions , getRoleByName } = require ( '~/models/Role' ) ;
/ * *
* Checks if a permission type has explicit configuration
* /
function hasExplicitConfig ( interfaceConfig , permissionType ) {
switch ( permissionType ) {
case PermissionTypes . PROMPTS :
return interfaceConfig . prompts !== undefined ;
case PermissionTypes . BOOKMARKS :
return interfaceConfig . bookmarks !== undefined ;
case PermissionTypes . MEMORIES :
return interfaceConfig . memories !== undefined ;
case PermissionTypes . MULTI _CONVO :
return interfaceConfig . multiConvo !== undefined ;
case PermissionTypes . AGENTS :
return interfaceConfig . agents !== undefined ;
case PermissionTypes . TEMPORARY _CHAT :
return interfaceConfig . temporaryChat !== undefined ;
case PermissionTypes . RUN _CODE :
return interfaceConfig . runCode !== undefined ;
case PermissionTypes . WEB _SEARCH :
return interfaceConfig . webSearch !== undefined ;
case PermissionTypes . PEOPLE _PICKER :
return interfaceConfig . peoplePicker !== undefined ;
case PermissionTypes . MARKETPLACE :
return interfaceConfig . marketplace !== undefined ;
case PermissionTypes . FILE _SEARCH :
return interfaceConfig . fileSearch !== undefined ;
case PermissionTypes . FILE _CITATIONS :
return interfaceConfig . fileCitations !== undefined ;
default :
return false ;
}
}
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
/ * *
* Loads the default interface object .
* @ param { TCustomConfig | undefined } config - The loaded custom configuration .
* @ param { TConfigDefaults } configDefaults - The custom configuration default values .
2024-08-21 19:57:34 -04:00
* @ returns { Promise < TCustomConfig [ 'interface' ] > } The default interface object .
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
* /
2025-08-10 21:42:54 -04:00
async function loadDefaultInterface ( config , configDefaults ) {
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
const { interface : interfaceConfig } = config ? ? { } ;
const { interface : defaults } = configDefaults ;
const hasModelSpecs = config ? . modelSpecs ? . list ? . length > 0 ;
2025-04-01 03:50:32 -04:00
const includesAddedEndpoints = config ? . modelSpecs ? . addedEndpoints ? . length > 0 ;
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
🧠 feat: User Memories for Conversational Context (#7760)
* 🧠 feat: User Memories for Conversational Context
chore: mcp typing, use `t`
WIP: first pass, Memories UI
- Added MemoryViewer component for displaying, editing, and deleting user memories.
- Integrated data provider hooks for fetching, updating, and deleting memories.
- Implemented pagination and loading states for better user experience.
- Created unit tests for MemoryViewer to ensure functionality and interaction with data provider.
- Updated translation files to include new UI strings related to memories.
chore: move mcp-related files to own directory
chore: rename librechat-mcp to librechat-api
WIP: first pass, memory processing and data schemas
chore: linting in fileSearch.js query description
chore: rename librechat-api to @librechat/api across the project
WIP: first pass, functional memory agent
feat: add MemoryEditDialog and MemoryViewer components for managing user memories
- Introduced MemoryEditDialog for editing memory entries with validation and toast notifications.
- Updated MemoryViewer to support editing and deleting memories, including pagination and loading states.
- Enhanced data provider to handle memory updates with optional original key for better management.
- Added new localization strings for memory-related UI elements.
feat: add memory permissions management
- Implemented memory permissions in the backend, allowing roles to have specific permissions for using, creating, updating, and reading memories.
- Added new API endpoints for updating memory permissions associated with roles.
- Created a new AdminSettings component for managing memory permissions in the frontend.
- Integrated memory permissions into the existing roles and permissions schemas.
- Updated the interface to include memory settings and permissions.
- Enhanced the MemoryViewer component to conditionally render admin settings based on user roles.
- Added localization support for memory permissions in the translation files.
feat: move AdminSettings component to a new position in MemoryViewer for better visibility
refactor: clean up commented code in MemoryViewer component
feat: enhance MemoryViewer with search functionality and improve MemoryEditDialog integration
- Added a search input to filter memories in the MemoryViewer component.
- Refactored MemoryEditDialog to accept children for better customization.
- Updated MemoryViewer to utilize the new EditMemoryButton and DeleteMemoryButton components for editing and deleting memories.
- Improved localization support by adding new strings for memory filtering and deletion confirmation.
refactor: optimize memory filtering in MemoryViewer using match-sorter
- Replaced manual filtering logic with match-sorter for improved search functionality.
- Enhanced performance and readability of the filteredMemories computation.
feat: enhance MemoryEditDialog with triggerRef and improve updateMemory mutation handling
feat: implement access control for MemoryEditDialog and MemoryViewer components
refactor: remove commented out code and create runMemory method
refactor: rename role based files
feat: implement access control for memory usage in AgentClient
refactor: simplify checkVisionRequest method in AgentClient by removing commented-out code
refactor: make `agents` dir in api package
refactor: migrate Azure utilities to TypeScript and consolidate imports
refactor: move sanitizeFilename function to a new file and update imports, add related tests
refactor: update LLM configuration types and consolidate Azure options in the API package
chore: linting
chore: import order
refactor: replace getLLMConfig with getOpenAIConfig and remove unused LLM configuration file
chore: update winston-daily-rotate-file to version 5.0.0 and add object-hash dependency in package-lock.json
refactor: move primeResources and optionalChainWithEmptyCheck functions to resources.ts and update imports
refactor: move createRun function to a new run.ts file and update related imports
fix: ensure safeAttachments is correctly typed as an array of TFile
chore: add node-fetch dependency and refactor fetch-related functions into packages/api/utils, removing the old generators file
refactor: enhance TEndpointOption type by using Pick to streamline endpoint fields and add new properties for model parameters and client options
feat: implement initializeOpenAIOptions function and update OpenAI types for enhanced configuration handling
fix: update types due to new TEndpointOption typing
fix: ensure safe access to group parameters in initializeOpenAIOptions function
fix: remove redundant API key validation comment in initializeOpenAIOptions function
refactor: rename initializeOpenAIOptions to initializeOpenAI for consistency and update related documentation
refactor: decouple req.body fields and tool loading from initializeAgentOptions
chore: linting
refactor: adjust column widths in MemoryViewer for improved layout
refactor: simplify agent initialization by creating loadAgent function and removing unused code
feat: add memory configuration loading and validation functions
WIP: first pass, memory processing with config
feat: implement memory callback and artifact handling
feat: implement memory artifacts display and processing updates
feat: add memory configuration options and schema validation for validKeys
fix: update MemoryEditDialog and MemoryViewer to handle memory state and display improvements
refactor: remove padding from BookmarkTable and MemoryViewer headers for consistent styling
WIP: initial tokenLimit config and move Tokenizer to @librechat/api
refactor: update mongoMeili plugin methods to use callback for better error handling
feat: enhance memory management with token tracking and usage metrics
- Added token counting for memory entries to enforce limits and provide usage statistics.
- Updated memory retrieval and update routes to include total token usage and limit.
- Enhanced MemoryEditDialog and MemoryViewer components to display memory usage and token information.
- Refactored memory processing functions to handle token limits and provide feedback on memory capacity.
feat: implement memory artifact handling in attachment handler
- Enhanced useAttachmentHandler to process memory artifacts when receiving updates.
- Introduced handleMemoryArtifact utility to manage memory updates and deletions.
- Updated query client to reflect changes in memory state based on incoming data.
refactor: restructure web search key extraction logic
- Moved the logic for extracting API keys from the webSearchAuth configuration into a dedicated function, getWebSearchKeys.
- Updated webSearchKeys to utilize the new function for improved clarity and maintainability.
- Prevents build time errors
feat: add personalization settings and memory preferences management
- Introduced a new Personalization tab in settings to manage user memory preferences.
- Implemented API endpoints and client-side logic for updating memory preferences.
- Enhanced user interface components to reflect personalization options and memory usage.
- Updated permissions to allow users to opt out of memory features.
- Added localization support for new settings and messages related to personalization.
style: personalization switch class
feat: add PersonalizationIcon and align Side Panel UI
feat: implement memory creation functionality
- Added a new API endpoint for creating memory entries, including validation for key and value.
- Introduced MemoryCreateDialog component for user interface to facilitate memory creation.
- Integrated token limit checks to prevent exceeding user memory capacity.
- Updated MemoryViewer to include a button for opening the memory creation dialog.
- Enhanced localization support for new messages related to memory creation.
feat: enhance message processing with configurable window size
- Updated AgentClient to use a configurable message window size for processing messages.
- Introduced messageWindowSize option in memory configuration schema with a default value of 5.
- Improved logic for selecting messages to process based on the configured window size.
chore: update librechat-data-provider version to 0.7.87 in package.json and package-lock.json
chore: remove OpenAPIPlugin and its associated tests
chore: remove MIGRATION_README.md as migration tasks are completed
ci: fix backend tests
chore: remove unused translation keys from localization file
chore: remove problematic test file and unused var in AgentClient
chore: remove unused import and import directly for JSDoc
* feat: add api package build stage in Dockerfile for improved modularity
* docs: reorder build steps in contributing guide for clarity
2025-06-07 18:52:22 -04:00
const memoryConfig = config ? . memory ;
const memoryEnabled = isMemoryEnabled ( memoryConfig ) ;
/** Only disable memories if memory config is present but disabled/invalid */
const shouldDisableMemories = memoryConfig && ! memoryEnabled ;
/** Check if personalization is enabled (defaults to true if memory is configured and enabled) */
const isPersonalizationEnabled =
memoryConfig && memoryEnabled && memoryConfig . personalize !== false ;
2024-08-21 19:57:34 -04:00
/** @type {TCustomConfig['interface']} */
const loadedInterface = removeNullishValues ( {
2025-08-14 02:15:33 -04:00
// UI elements - use schema defaults
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
endpointsMenu :
interfaceConfig ? . endpointsMenu ? ? ( hasModelSpecs ? false : defaults . endpointsMenu ) ,
2025-04-01 03:50:32 -04:00
modelSelect :
interfaceConfig ? . modelSelect ? ?
( hasModelSpecs ? includesAddedEndpoints : defaults . modelSelect ) ,
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
parameters : interfaceConfig ? . parameters ? ? ( hasModelSpecs ? false : defaults . parameters ) ,
presets : interfaceConfig ? . presets ? ? ( hasModelSpecs ? false : defaults . presets ) ,
sidePanel : interfaceConfig ? . sidePanel ? ? defaults . sidePanel ,
privacyPolicy : interfaceConfig ? . privacyPolicy ? ? defaults . privacyPolicy ,
termsOfService : interfaceConfig ? . termsOfService ? ? defaults . termsOfService ,
2025-06-23 10:21:01 -07:00
mcpServers : interfaceConfig ? . mcpServers ? ? defaults . mcpServers ,
2025-02-22 23:43:00 +01:00
customWelcome : interfaceConfig ? . customWelcome ? ? defaults . customWelcome ,
2025-08-14 02:15:33 -04:00
// Permissions - only include if explicitly configured
bookmarks : interfaceConfig ? . bookmarks ,
memories : shouldDisableMemories ? false : interfaceConfig ? . memories ,
prompts : interfaceConfig ? . prompts ,
multiConvo : interfaceConfig ? . multiConvo ,
agents : interfaceConfig ? . agents ,
temporaryChat : interfaceConfig ? . temporaryChat ,
runCode : interfaceConfig ? . runCode ,
webSearch : interfaceConfig ? . webSearch ,
fileSearch : interfaceConfig ? . fileSearch ,
fileCitations : interfaceConfig ? . fileCitations ,
peoplePicker : interfaceConfig ? . peoplePicker ,
marketplace : interfaceConfig ? . marketplace ,
2024-08-21 19:57:34 -04:00
} ) ;
2025-08-14 02:15:33 -04:00
// Helper to get permission value with proper precedence
const getPermissionValue = ( configValue , roleDefault , schemaDefault ) => {
if ( configValue !== undefined ) return configValue ;
if ( roleDefault !== undefined ) return roleDefault ;
return schemaDefault ;
} ;
// Permission precedence order:
// 1. Explicit user configuration (from librechat.yaml)
// 2. Role-specific defaults (from roleDefaults)
// 3. Interface schema defaults (from interfaceSchema.default())
2025-08-10 21:42:54 -04:00
for ( const roleName of [ SystemRoles . USER , SystemRoles . ADMIN ] ) {
2025-08-14 02:15:33 -04:00
const defaultPerms = roleDefaults [ roleName ] . permissions ;
const existingRole = await getRoleByName ( roleName ) ;
const existingPermissions = existingRole ? . permissions || { } ;
const permissionsToUpdate = { } ;
// Helper to add permission if it should be updated
const addPermissionIfNeeded = ( permType , permissions ) => {
const permTypeExists = existingPermissions [ permType ] ;
const isExplicitlyConfigured =
interfaceConfig && hasExplicitConfig ( interfaceConfig , permType ) ;
// Only update if: doesn't exist OR explicitly configured
if ( ! permTypeExists || isExplicitlyConfigured ) {
permissionsToUpdate [ permType ] = permissions ;
if ( ! permTypeExists ) {
logger . debug ( ` Role ' ${ roleName } ': Setting up default permissions for ' ${ permType } ' ` ) ;
} else if ( isExplicitlyConfigured ) {
logger . debug ( ` Role ' ${ roleName } ': Applying explicit config for ' ${ permType } ' ` ) ;
}
} else {
logger . debug ( ` Role ' ${ roleName } ': Preserving existing permissions for ' ${ permType } ' ` ) ;
}
} ;
// Build permissions for each type
const allPermissions = {
[ PermissionTypes . PROMPTS ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . prompts ,
defaultPerms [ PermissionTypes . PROMPTS ] ? . [ Permissions . USE ] ,
defaults . prompts ,
) ,
[ Permissions . SHARED _GLOBAL ] :
defaultPerms [ PermissionTypes . PROMPTS ] ? . [ Permissions . SHARED _GLOBAL ] ,
[ Permissions . CREATE ] : defaultPerms [ PermissionTypes . PROMPTS ] ? . [ Permissions . CREATE ] ,
} ,
[ PermissionTypes . BOOKMARKS ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . bookmarks ,
defaultPerms [ PermissionTypes . BOOKMARKS ] ? . [ Permissions . USE ] ,
defaults . bookmarks ,
) ,
} ,
[ PermissionTypes . MEMORIES ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . memories ,
defaultPerms [ PermissionTypes . MEMORIES ] ? . [ Permissions . USE ] ,
defaults . memories ,
) ,
[ Permissions . CREATE ] : defaultPerms [ PermissionTypes . MEMORIES ] ? . [ Permissions . CREATE ] ,
[ Permissions . UPDATE ] : defaultPerms [ PermissionTypes . MEMORIES ] ? . [ Permissions . UPDATE ] ,
[ Permissions . READ ] : defaultPerms [ PermissionTypes . MEMORIES ] ? . [ Permissions . READ ] ,
[ Permissions . OPT _OUT ] : isPersonalizationEnabled ,
} ,
[ PermissionTypes . MULTI _CONVO ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . multiConvo ,
defaultPerms [ PermissionTypes . MULTI _CONVO ] ? . [ Permissions . USE ] ,
defaults . multiConvo ,
) ,
} ,
[ PermissionTypes . AGENTS ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . agents ,
defaultPerms [ PermissionTypes . AGENTS ] ? . [ Permissions . USE ] ,
defaults . agents ,
) ,
[ Permissions . SHARED _GLOBAL ] :
defaultPerms [ PermissionTypes . AGENTS ] ? . [ Permissions . SHARED _GLOBAL ] ,
[ Permissions . CREATE ] : defaultPerms [ PermissionTypes . AGENTS ] ? . [ Permissions . CREATE ] ,
} ,
[ PermissionTypes . TEMPORARY _CHAT ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . temporaryChat ,
defaultPerms [ PermissionTypes . TEMPORARY _CHAT ] ? . [ Permissions . USE ] ,
defaults . temporaryChat ,
) ,
} ,
[ PermissionTypes . RUN _CODE ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . runCode ,
defaultPerms [ PermissionTypes . RUN _CODE ] ? . [ Permissions . USE ] ,
defaults . runCode ,
) ,
} ,
[ PermissionTypes . WEB _SEARCH ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . webSearch ,
defaultPerms [ PermissionTypes . WEB _SEARCH ] ? . [ Permissions . USE ] ,
defaults . webSearch ,
) ,
2025-08-10 21:42:54 -04:00
} ,
2025-08-14 02:15:33 -04:00
[ PermissionTypes . PEOPLE _PICKER ] : {
[ Permissions . VIEW _USERS ] : getPermissionValue (
loadedInterface . peoplePicker ? . users ,
defaultPerms [ PermissionTypes . PEOPLE _PICKER ] ? . [ Permissions . VIEW _USERS ] ,
defaults . peoplePicker ? . users ,
) ,
[ Permissions . VIEW _GROUPS ] : getPermissionValue (
loadedInterface . peoplePicker ? . groups ,
defaultPerms [ PermissionTypes . PEOPLE _PICKER ] ? . [ Permissions . VIEW _GROUPS ] ,
defaults . peoplePicker ? . groups ,
) ,
[ Permissions . VIEW _ROLES ] : getPermissionValue (
loadedInterface . peoplePicker ? . roles ,
defaultPerms [ PermissionTypes . PEOPLE _PICKER ] ? . [ Permissions . VIEW _ROLES ] ,
defaults . peoplePicker ? . roles ,
) ,
} ,
[ PermissionTypes . MARKETPLACE ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . marketplace ? . use ,
defaultPerms [ PermissionTypes . MARKETPLACE ] ? . [ Permissions . USE ] ,
defaults . marketplace ? . use ,
) ,
} ,
[ PermissionTypes . FILE _SEARCH ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . fileSearch ,
defaultPerms [ PermissionTypes . FILE _SEARCH ] ? . [ Permissions . USE ] ,
defaults . fileSearch ,
) ,
} ,
[ PermissionTypes . FILE _CITATIONS ] : {
[ Permissions . USE ] : getPermissionValue (
loadedInterface . fileCitations ,
defaultPerms [ PermissionTypes . FILE _CITATIONS ] ? . [ Permissions . USE ] ,
defaults . fileCitations ,
) ,
} ,
} ;
// Check and add each permission type if needed
for ( const [ permType , permissions ] of Object . entries ( allPermissions ) ) {
addPermissionIfNeeded ( permType , permissions ) ;
}
// Update permissions if any need updating
if ( Object . keys ( permissionsToUpdate ) . length > 0 ) {
await updateAccessPermissions ( roleName , permissionsToUpdate , existingRole ) ;
}
2025-08-10 21:42:54 -04:00
}
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
let i = 0 ;
const logSettings = ( ) => {
// log interface object and model specs object (without list) for reference
logger . warn ( ` \` interface \` settings: \n ${ JSON . stringify ( loadedInterface , null , 2 ) } ` ) ;
logger . warn (
` \` modelSpecs \` settings: \n ${ JSON . stringify (
{ ... ( config ? . modelSpecs ? ? { } ) , list : undefined } ,
null ,
2 ,
) } ` ,
) ;
} ;
// warn about config.modelSpecs.prioritize if true and presets are enabled, that default presets will conflict with prioritizing model specs.
if ( config ? . modelSpecs ? . prioritize && loadedInterface . presets ) {
logger . warn (
🔎 feat: Native Web Search with Citation References (#7516)
* WIP: search tool integration
* WIP: Add web search capabilities and API key management to agent actions
* WIP: web search capability to agent configuration and selection
* WIP: Add web search capability to backend agent configuration
* WIP: add web search option to default agent form values
* WIP: add attachments for web search
* feat: add plugin for processing web search citations
* WIP: first pass, Citation UI
* chore: remove console.log
* feat: Add AnimatedTabs component for tabbed UI functionality
* refactor: AnimatedTabs component with CSS animations and stable ID generation
* WIP example content
* feat: SearchContext for managing search results apart from MessageContext
* feat: Enhance AnimatedTabs with underline animation and state management
* WIP: first pass, Implement dynamic tab functionality in Sources component with search results integration
* fix: Update class names for improved styling in Sources and AnimatedTabs components
* feat: Improve styling and layout in Sources component with enhanced button and item designs
* feat: Refactor Sources component to integrate OGDialog for source display and improve layout
* style: Update background color in SourceItem and SourcesGroup components for improved visibility
* refactor: Sources component to enhance SourceItem structure and improve favicon handling
* style: Adjust font size of domain text in SourceItem for better readability
* feat: Add localization for citation source and details in CompositeCitation component
* style: add theming to Citation components
* feat: Enhance SourceItem component with dialog support and improved hovercard functionality
* feat: Add localization for sources tab and image alt text in Sources component
* style: Replace divs with spans for better semantic structure in CompositeCitation and Citation components
* refactor: Sources component to use useMemo for tab generation and improve performance
* chore: bump @librechat/agents to v2.4.318
* chore: update search result types
* fix: search results retrieval in ContentParts component, re-render attachments when expected
* feat: update sources style/types to use latest search result structure
* style: enhance Dialog (expanded) SourceItem component with link wrapping and improved styling
* style: update ImageItem component styling for improved title visibility
* refactor: remove SourceItemBase component and adjust SourceItem layout for improved styling
* chore: linting twcss order
* fix: prevent FileAttachment from rendering search attachments
* fix: append underscore to responseMessageId for unique identification to prevent mapping of previous latest message's attachments
* chore: remove unused parameter 'useSpecs' from loadTools function
* chore: twcss order
* WIP: WebSearch Tool UI
* refactor: add limit parameter to StackedFavicons for customizable source display
* refactor: optimize search results memoization by making more granular and separate conerns
* refactor: integrated StackedFavicons to WebSearch mid-run
* chore: bump @librechat/agents to expose handleToolCallChunks
* chore: use typedefs from dedicated file instead of defining them in AgentClient module
* WIP: first pass, search progress results
* refactor: move createOnSearchResults function to a dedicated search module
* chore: bump @librechat/agents to v2.4.320
* WIP: first pass, search results processed UX
* refactor: consolidate context variables in createOnSearchResults function
* chore: bump @librechat/agents to v2.4.321
* feat: add guidelines for web search tool response formatting in loadTools function
* feat: add isLast prop to Part component and update WebSearch logic for improved state handling
* style: update Hovercard styles for improved UI consistency
* feat: export FaviconImage component for improved accessibility in other modules
* refactor: export getCleanDomain function and use FaviconImage in Citation component for improved source representation
* refactor: implement SourceHovercard component for consistency and DRY compliance
* fix: replace <p> with <span> for snippet and title in SourceItem and SourceHovercard for consistency
* style: `not-prose`
* style: remove 'not-prose' class for consistency in SourceItem, Citation, and SourceHovercard components, adjust style classes
* refactor: `imageUrl` on hover and prevent duplicate sources
* refactor: enhance SourcesGroup dialog layout and improve source item presentation
* refactor: reorganize Web Components, save in same directory
* feat: add 'news' refType to refTypeMap for citation sources
* style: adjust Hovercard width for improved layout
* refactor: update tool usage guidelines for improved clarity and execution
* chore: linting
* feat: add Web Search badge with initial permissions and local storage logic
* feat: add webSearch support to interface and permissions schemas
* feat: implement Web Search API key management and localization updates
* feat: refactor Web Search API key handling and integrate new search API key form
* fix: remove unnecessary visibility state from FileAttachment component
* feat: update WebSearch component to use Globe icon and localized search label
* feat: enhance ApiKeyDialog with dropdown for reranker selection and update translations
* feat: implement dropdown menus for engine, scraper, and reranker selection in ApiKeyDialog
* chore: linting and add unknown instead of `any` type
* feat: refactor ApiKeyDialog and useAuthSearchTool for improved API key management
* refactor: update ocrSchema to use template literals for default apiKey and baseURL
* feat: add web search configuration and utility functions for environment variable extraction
* fix: ensure filepath is defined before checking its prefix in useAttachmentHandler
* feat: enhance web search functionality with improved configuration and environment variable extraction for authFields
* fix: update auth type in TPluginAction and TUpdateUserPlugins to use Partial<Record<string, string>>
* feat: implement web search authentication verification and enhance webSearchAuth structure
* feat: enhance ephemeral agent handling with new web search capability and type definition
* feat: enhance isEphemeralAgent function to include web search selection
* feat: refactor verifyWebSearchAuth to improve key handling and authentication checks
* feat: implement loadWebSearchAuth function for improved web search authentication handling
* feat: enhance web search authentication with new configuration options and refactor related types
* refactor: rename search engine to search provider and update related localization keys
* feat: update verifyWebSearchAuth to handle multiple authentication types and improve error handling
* feat: update ApiKeyDialog to accept authTypes prop and remove isUserProvided check
* feat: add tests for extractWebSearchEnvVars and loadWebSearchAuth functions
* feat: enhance loadWebSearchAuth to support specific service checks for providers, scrapers, and rerankers
* fix: update web search configuration key and adjust auth result handling in loadTools function
* feat: add new progress key for repeated web searching and update localization
* chore: bump @librechat/agents to 2.4.322
* feat: enhance loadTools function to include ISO time and improve search tool logging
* feat: update StackedFavicons to handle negative start index and improve citation attribution styling and text
* chore: update .gitignore to categorize AI-related files
* fix: mobile responsiveness of sources/citations hovercards
* feat: enhance source display with improved line clamping for better readability
* chore: bump @librechat/agents to v2.4.33
* feat: add handling for image sources in references mapping
* chore: bump librechat-data-provider version to 0.7.84
* chore: bump @librechat/agents version to 2.4.34
* fix: update auth handling to support multiple auth types in tools and allow key configuration in agent panel
* chore: remove redundant agent attribution text from search form
* fix: web search auth uninstall
* refactor: convert CheckboxButton to a forwardRef component and update setValue callback signature
* feat: add triggerRef prop to ApiKeyDialog components for improved dialog control
* feat: integrate triggerRef in CodeInterpreter and WebSearch components for enhanced dialog management
* feat: enhance ApiKeyDialog with additional links for Firecrawl and Jina API key guidance
* feat: implement web search configuration handling in ApiKeyDialog and add tests for dropdown visibility
* fix: update webSearchConfig reference in config route for correct payload assignment
* feat: update ApiKeyDialog to conditionally render sections based on authTypes and modify loadWebSearchAuth to correctly categorize authentication types
* feat: refactor ApiKeyDialog and related tests to use SearchCategories and RerankerTypes enums and remove nested ternaries
* refactor: move ThinkingButton rendering to improve layout consistency in ContentParts
* feat: integrate search context into Markdown component to conditionally include unicodeCitation plugin
* chore: bump @librechat/agents to v2.4.35
* chore: remove unused 18n key
* ci: add WEB_SEARCH permission testing and update AppService tests for new webSearch configuration
* ci: add more comprehensive tests for loadWebSearchAuth to validate authentication handling and authTypes structure
* chore: remove debugging console log from web.spec.ts to clean up test output
2025-05-23 00:14:04 -04:00
"Note: Prioritizing model specs can conflict with default presets if a default preset is set. It's recommended to disable presets from the interface or disable use of a default preset." ,
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
) ;
i === 0 && i ++ ;
}
// warn about config.modelSpecs.enforce if true and if any of these, endpointsMenu, modelSelect, presets, or parameters are enabled, that enforcing model specs can conflict with these options.
if (
config ? . modelSpecs ? . enforce &&
( loadedInterface . endpointsMenu ||
loadedInterface . modelSelect ||
loadedInterface . presets ||
loadedInterface . parameters )
) {
logger . warn (
🔎 feat: Native Web Search with Citation References (#7516)
* WIP: search tool integration
* WIP: Add web search capabilities and API key management to agent actions
* WIP: web search capability to agent configuration and selection
* WIP: Add web search capability to backend agent configuration
* WIP: add web search option to default agent form values
* WIP: add attachments for web search
* feat: add plugin for processing web search citations
* WIP: first pass, Citation UI
* chore: remove console.log
* feat: Add AnimatedTabs component for tabbed UI functionality
* refactor: AnimatedTabs component with CSS animations and stable ID generation
* WIP example content
* feat: SearchContext for managing search results apart from MessageContext
* feat: Enhance AnimatedTabs with underline animation and state management
* WIP: first pass, Implement dynamic tab functionality in Sources component with search results integration
* fix: Update class names for improved styling in Sources and AnimatedTabs components
* feat: Improve styling and layout in Sources component with enhanced button and item designs
* feat: Refactor Sources component to integrate OGDialog for source display and improve layout
* style: Update background color in SourceItem and SourcesGroup components for improved visibility
* refactor: Sources component to enhance SourceItem structure and improve favicon handling
* style: Adjust font size of domain text in SourceItem for better readability
* feat: Add localization for citation source and details in CompositeCitation component
* style: add theming to Citation components
* feat: Enhance SourceItem component with dialog support and improved hovercard functionality
* feat: Add localization for sources tab and image alt text in Sources component
* style: Replace divs with spans for better semantic structure in CompositeCitation and Citation components
* refactor: Sources component to use useMemo for tab generation and improve performance
* chore: bump @librechat/agents to v2.4.318
* chore: update search result types
* fix: search results retrieval in ContentParts component, re-render attachments when expected
* feat: update sources style/types to use latest search result structure
* style: enhance Dialog (expanded) SourceItem component with link wrapping and improved styling
* style: update ImageItem component styling for improved title visibility
* refactor: remove SourceItemBase component and adjust SourceItem layout for improved styling
* chore: linting twcss order
* fix: prevent FileAttachment from rendering search attachments
* fix: append underscore to responseMessageId for unique identification to prevent mapping of previous latest message's attachments
* chore: remove unused parameter 'useSpecs' from loadTools function
* chore: twcss order
* WIP: WebSearch Tool UI
* refactor: add limit parameter to StackedFavicons for customizable source display
* refactor: optimize search results memoization by making more granular and separate conerns
* refactor: integrated StackedFavicons to WebSearch mid-run
* chore: bump @librechat/agents to expose handleToolCallChunks
* chore: use typedefs from dedicated file instead of defining them in AgentClient module
* WIP: first pass, search progress results
* refactor: move createOnSearchResults function to a dedicated search module
* chore: bump @librechat/agents to v2.4.320
* WIP: first pass, search results processed UX
* refactor: consolidate context variables in createOnSearchResults function
* chore: bump @librechat/agents to v2.4.321
* feat: add guidelines for web search tool response formatting in loadTools function
* feat: add isLast prop to Part component and update WebSearch logic for improved state handling
* style: update Hovercard styles for improved UI consistency
* feat: export FaviconImage component for improved accessibility in other modules
* refactor: export getCleanDomain function and use FaviconImage in Citation component for improved source representation
* refactor: implement SourceHovercard component for consistency and DRY compliance
* fix: replace <p> with <span> for snippet and title in SourceItem and SourceHovercard for consistency
* style: `not-prose`
* style: remove 'not-prose' class for consistency in SourceItem, Citation, and SourceHovercard components, adjust style classes
* refactor: `imageUrl` on hover and prevent duplicate sources
* refactor: enhance SourcesGroup dialog layout and improve source item presentation
* refactor: reorganize Web Components, save in same directory
* feat: add 'news' refType to refTypeMap for citation sources
* style: adjust Hovercard width for improved layout
* refactor: update tool usage guidelines for improved clarity and execution
* chore: linting
* feat: add Web Search badge with initial permissions and local storage logic
* feat: add webSearch support to interface and permissions schemas
* feat: implement Web Search API key management and localization updates
* feat: refactor Web Search API key handling and integrate new search API key form
* fix: remove unnecessary visibility state from FileAttachment component
* feat: update WebSearch component to use Globe icon and localized search label
* feat: enhance ApiKeyDialog with dropdown for reranker selection and update translations
* feat: implement dropdown menus for engine, scraper, and reranker selection in ApiKeyDialog
* chore: linting and add unknown instead of `any` type
* feat: refactor ApiKeyDialog and useAuthSearchTool for improved API key management
* refactor: update ocrSchema to use template literals for default apiKey and baseURL
* feat: add web search configuration and utility functions for environment variable extraction
* fix: ensure filepath is defined before checking its prefix in useAttachmentHandler
* feat: enhance web search functionality with improved configuration and environment variable extraction for authFields
* fix: update auth type in TPluginAction and TUpdateUserPlugins to use Partial<Record<string, string>>
* feat: implement web search authentication verification and enhance webSearchAuth structure
* feat: enhance ephemeral agent handling with new web search capability and type definition
* feat: enhance isEphemeralAgent function to include web search selection
* feat: refactor verifyWebSearchAuth to improve key handling and authentication checks
* feat: implement loadWebSearchAuth function for improved web search authentication handling
* feat: enhance web search authentication with new configuration options and refactor related types
* refactor: rename search engine to search provider and update related localization keys
* feat: update verifyWebSearchAuth to handle multiple authentication types and improve error handling
* feat: update ApiKeyDialog to accept authTypes prop and remove isUserProvided check
* feat: add tests for extractWebSearchEnvVars and loadWebSearchAuth functions
* feat: enhance loadWebSearchAuth to support specific service checks for providers, scrapers, and rerankers
* fix: update web search configuration key and adjust auth result handling in loadTools function
* feat: add new progress key for repeated web searching and update localization
* chore: bump @librechat/agents to 2.4.322
* feat: enhance loadTools function to include ISO time and improve search tool logging
* feat: update StackedFavicons to handle negative start index and improve citation attribution styling and text
* chore: update .gitignore to categorize AI-related files
* fix: mobile responsiveness of sources/citations hovercards
* feat: enhance source display with improved line clamping for better readability
* chore: bump @librechat/agents to v2.4.33
* feat: add handling for image sources in references mapping
* chore: bump librechat-data-provider version to 0.7.84
* chore: bump @librechat/agents version to 2.4.34
* fix: update auth handling to support multiple auth types in tools and allow key configuration in agent panel
* chore: remove redundant agent attribution text from search form
* fix: web search auth uninstall
* refactor: convert CheckboxButton to a forwardRef component and update setValue callback signature
* feat: add triggerRef prop to ApiKeyDialog components for improved dialog control
* feat: integrate triggerRef in CodeInterpreter and WebSearch components for enhanced dialog management
* feat: enhance ApiKeyDialog with additional links for Firecrawl and Jina API key guidance
* feat: implement web search configuration handling in ApiKeyDialog and add tests for dropdown visibility
* fix: update webSearchConfig reference in config route for correct payload assignment
* feat: update ApiKeyDialog to conditionally render sections based on authTypes and modify loadWebSearchAuth to correctly categorize authentication types
* feat: refactor ApiKeyDialog and related tests to use SearchCategories and RerankerTypes enums and remove nested ternaries
* refactor: move ThinkingButton rendering to improve layout consistency in ContentParts
* feat: integrate search context into Markdown component to conditionally include unicodeCitation plugin
* chore: bump @librechat/agents to v2.4.35
* chore: remove unused 18n key
* ci: add WEB_SEARCH permission testing and update AppService tests for new webSearch configuration
* ci: add more comprehensive tests for loadWebSearchAuth to validate authentication handling and authTypes structure
* chore: remove debugging console log from web.spec.ts to clean up test output
2025-05-23 00:14:04 -04:00
"Note: Enforcing model specs can conflict with the interface options: endpointsMenu, modelSelect, presets, and parameters. It's recommended to disable these options from the interface or disable enforcing model specs." ,
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
) ;
i === 0 && i ++ ;
}
// warn if enforce is true and prioritize is not, that enforcing model specs without prioritizing them can lead to unexpected behavior.
if ( config ? . modelSpecs ? . enforce && ! config ? . modelSpecs ? . prioritize ) {
logger . warn (
🔎 feat: Native Web Search with Citation References (#7516)
* WIP: search tool integration
* WIP: Add web search capabilities and API key management to agent actions
* WIP: web search capability to agent configuration and selection
* WIP: Add web search capability to backend agent configuration
* WIP: add web search option to default agent form values
* WIP: add attachments for web search
* feat: add plugin for processing web search citations
* WIP: first pass, Citation UI
* chore: remove console.log
* feat: Add AnimatedTabs component for tabbed UI functionality
* refactor: AnimatedTabs component with CSS animations and stable ID generation
* WIP example content
* feat: SearchContext for managing search results apart from MessageContext
* feat: Enhance AnimatedTabs with underline animation and state management
* WIP: first pass, Implement dynamic tab functionality in Sources component with search results integration
* fix: Update class names for improved styling in Sources and AnimatedTabs components
* feat: Improve styling and layout in Sources component with enhanced button and item designs
* feat: Refactor Sources component to integrate OGDialog for source display and improve layout
* style: Update background color in SourceItem and SourcesGroup components for improved visibility
* refactor: Sources component to enhance SourceItem structure and improve favicon handling
* style: Adjust font size of domain text in SourceItem for better readability
* feat: Add localization for citation source and details in CompositeCitation component
* style: add theming to Citation components
* feat: Enhance SourceItem component with dialog support and improved hovercard functionality
* feat: Add localization for sources tab and image alt text in Sources component
* style: Replace divs with spans for better semantic structure in CompositeCitation and Citation components
* refactor: Sources component to use useMemo for tab generation and improve performance
* chore: bump @librechat/agents to v2.4.318
* chore: update search result types
* fix: search results retrieval in ContentParts component, re-render attachments when expected
* feat: update sources style/types to use latest search result structure
* style: enhance Dialog (expanded) SourceItem component with link wrapping and improved styling
* style: update ImageItem component styling for improved title visibility
* refactor: remove SourceItemBase component and adjust SourceItem layout for improved styling
* chore: linting twcss order
* fix: prevent FileAttachment from rendering search attachments
* fix: append underscore to responseMessageId for unique identification to prevent mapping of previous latest message's attachments
* chore: remove unused parameter 'useSpecs' from loadTools function
* chore: twcss order
* WIP: WebSearch Tool UI
* refactor: add limit parameter to StackedFavicons for customizable source display
* refactor: optimize search results memoization by making more granular and separate conerns
* refactor: integrated StackedFavicons to WebSearch mid-run
* chore: bump @librechat/agents to expose handleToolCallChunks
* chore: use typedefs from dedicated file instead of defining them in AgentClient module
* WIP: first pass, search progress results
* refactor: move createOnSearchResults function to a dedicated search module
* chore: bump @librechat/agents to v2.4.320
* WIP: first pass, search results processed UX
* refactor: consolidate context variables in createOnSearchResults function
* chore: bump @librechat/agents to v2.4.321
* feat: add guidelines for web search tool response formatting in loadTools function
* feat: add isLast prop to Part component and update WebSearch logic for improved state handling
* style: update Hovercard styles for improved UI consistency
* feat: export FaviconImage component for improved accessibility in other modules
* refactor: export getCleanDomain function and use FaviconImage in Citation component for improved source representation
* refactor: implement SourceHovercard component for consistency and DRY compliance
* fix: replace <p> with <span> for snippet and title in SourceItem and SourceHovercard for consistency
* style: `not-prose`
* style: remove 'not-prose' class for consistency in SourceItem, Citation, and SourceHovercard components, adjust style classes
* refactor: `imageUrl` on hover and prevent duplicate sources
* refactor: enhance SourcesGroup dialog layout and improve source item presentation
* refactor: reorganize Web Components, save in same directory
* feat: add 'news' refType to refTypeMap for citation sources
* style: adjust Hovercard width for improved layout
* refactor: update tool usage guidelines for improved clarity and execution
* chore: linting
* feat: add Web Search badge with initial permissions and local storage logic
* feat: add webSearch support to interface and permissions schemas
* feat: implement Web Search API key management and localization updates
* feat: refactor Web Search API key handling and integrate new search API key form
* fix: remove unnecessary visibility state from FileAttachment component
* feat: update WebSearch component to use Globe icon and localized search label
* feat: enhance ApiKeyDialog with dropdown for reranker selection and update translations
* feat: implement dropdown menus for engine, scraper, and reranker selection in ApiKeyDialog
* chore: linting and add unknown instead of `any` type
* feat: refactor ApiKeyDialog and useAuthSearchTool for improved API key management
* refactor: update ocrSchema to use template literals for default apiKey and baseURL
* feat: add web search configuration and utility functions for environment variable extraction
* fix: ensure filepath is defined before checking its prefix in useAttachmentHandler
* feat: enhance web search functionality with improved configuration and environment variable extraction for authFields
* fix: update auth type in TPluginAction and TUpdateUserPlugins to use Partial<Record<string, string>>
* feat: implement web search authentication verification and enhance webSearchAuth structure
* feat: enhance ephemeral agent handling with new web search capability and type definition
* feat: enhance isEphemeralAgent function to include web search selection
* feat: refactor verifyWebSearchAuth to improve key handling and authentication checks
* feat: implement loadWebSearchAuth function for improved web search authentication handling
* feat: enhance web search authentication with new configuration options and refactor related types
* refactor: rename search engine to search provider and update related localization keys
* feat: update verifyWebSearchAuth to handle multiple authentication types and improve error handling
* feat: update ApiKeyDialog to accept authTypes prop and remove isUserProvided check
* feat: add tests for extractWebSearchEnvVars and loadWebSearchAuth functions
* feat: enhance loadWebSearchAuth to support specific service checks for providers, scrapers, and rerankers
* fix: update web search configuration key and adjust auth result handling in loadTools function
* feat: add new progress key for repeated web searching and update localization
* chore: bump @librechat/agents to 2.4.322
* feat: enhance loadTools function to include ISO time and improve search tool logging
* feat: update StackedFavicons to handle negative start index and improve citation attribution styling and text
* chore: update .gitignore to categorize AI-related files
* fix: mobile responsiveness of sources/citations hovercards
* feat: enhance source display with improved line clamping for better readability
* chore: bump @librechat/agents to v2.4.33
* feat: add handling for image sources in references mapping
* chore: bump librechat-data-provider version to 0.7.84
* chore: bump @librechat/agents version to 2.4.34
* fix: update auth handling to support multiple auth types in tools and allow key configuration in agent panel
* chore: remove redundant agent attribution text from search form
* fix: web search auth uninstall
* refactor: convert CheckboxButton to a forwardRef component and update setValue callback signature
* feat: add triggerRef prop to ApiKeyDialog components for improved dialog control
* feat: integrate triggerRef in CodeInterpreter and WebSearch components for enhanced dialog management
* feat: enhance ApiKeyDialog with additional links for Firecrawl and Jina API key guidance
* feat: implement web search configuration handling in ApiKeyDialog and add tests for dropdown visibility
* fix: update webSearchConfig reference in config route for correct payload assignment
* feat: update ApiKeyDialog to conditionally render sections based on authTypes and modify loadWebSearchAuth to correctly categorize authentication types
* feat: refactor ApiKeyDialog and related tests to use SearchCategories and RerankerTypes enums and remove nested ternaries
* refactor: move ThinkingButton rendering to improve layout consistency in ContentParts
* feat: integrate search context into Markdown component to conditionally include unicodeCitation plugin
* chore: bump @librechat/agents to v2.4.35
* chore: remove unused 18n key
* ci: add WEB_SEARCH permission testing and update AppService tests for new webSearch configuration
* ci: add more comprehensive tests for loadWebSearchAuth to validate authentication handling and authTypes structure
* chore: remove debugging console log from web.spec.ts to clean up test output
2025-05-23 00:14:04 -04:00
"Note: Enforcing model specs without prioritizing them can lead to unexpected behavior. It's recommended to enable prioritizing model specs if enforcing them." ,
🤖 feat: Model Specs & Save Tools per Convo/Preset (#2578)
* WIP: first pass ModelSpecs
* refactor(onSelectEndpoint): use `getConvoSwitchLogic`
* feat: introduce iconURL, greeting, frontend fields for conversations/presets/messages
* feat: conversation.iconURL & greeting in Landing
* feat: conversation.iconURL & greeting in New Chat button
* feat: message.iconURL
* refactor: ConversationIcon -> ConvoIconURL
* WIP: add spec as a conversation field
* refactor: useAppStartup, set spec on initial load for new chat, allow undefined spec, add localStorage keys enum, additional type fields for spec
* feat: handle `showIconInMenu`, `showIconInHeader`, undefined `iconURL` and no specs on initial load
* chore: handle undefined or empty modelSpecs
* WIP: first pass, modelSpec schema for custom config
* refactor: move default filtered tools definition to ToolService
* feat: pass modelSpecs from backend via startupConfig
* refactor: modelSpecs config, return and define list
* fix: react error and include iconURL in responseMessage
* refactor: add iconURL to responseMessage only
* refactor: getIconEndpoint
* refactor: pass TSpecsConfig
* fix(assistants): differentiate compactAssistantSchema, correctly resets shared conversation state with other endpoints
* refactor: assistant id prefix localStorage key
* refactor: add more LocalStorageKeys and replace hardcoded values
* feat: prioritize spec on new chat behavior: last selected modelSpec behavior (localStorage)
* feat: first pass, interface config
* chore: WIP, todo: add warnings based on config.modelSpecs settings.
* feat: enforce modelSpecs if configured
* feat: show config file yaml errors
* chore: delete unused legacy Plugins component
* refactor: set tools to localStorage from recoil store
* chore: add stable recoil setter to useEffect deps
* refactor: save tools to conversation documents
* style(MultiSelectPop): dynamic height, remove unused import
* refactor(react-query): use localstorage keys and pass config to useAvailablePluginsQuery
* feat(utils): add mapPlugins
* refactor(Convo): use conversation.tools if defined, lastSelectedTools if not
* refactor: remove unused legacy code using `useSetOptions`, remove conditional flag `isMultiChat` for using legacy settings
* refactor(PluginStoreDialog): add exhaustive-deps which are stable react state setters
* fix(HeaderOptions): pass `popover` as true
* refactor(useSetStorage): use project enums
* refactor: use LocalStorageKeys enum
* fix: prevent setConversation from setting falsy values in lastSelectedTools
* refactor: use map for availableTools state and available Plugins query
* refactor(updateLastSelectedModel): organize logic better and add note on purpose
* fix(setAgentOption): prevent reseting last model to secondary model for gptPlugins
* refactor(buildDefaultConvo): use enum
* refactor: remove `useSetStorage` and consolidate areas where conversation state is saved to localStorage
* fix: conversations retain tools on refresh
* fix(gptPlugins): prevent nullish tools from being saved
* chore: delete useServerStream
* refactor: move initial plugins logic to useAppStartup
* refactor(MultiSelectDropDown): add more pass-in className props
* feat: use tools in presets
* chore: delete unused usePresetOptions
* refactor: new agentOptions default handling
* chore: note
* feat: add label and custom instructions to agents
* chore: remove 'disabled with tools' message
* style: move plugins to 2nd column in parameters
* fix: TPreset type for agentOptions
* fix: interface controls
* refactor: add interfaceConfig, use Separator within Switcher
* refactor: hide Assistants panel if interface.parameters are disabled
* fix(Header): only modelSpecs if list is greater than 0
* refactor: separate MessageIcon logic from useMessageHelpers for better react rule-following
* fix(AppService): don't use reserved keyword 'interface'
* feat: set existing Icon for custom endpoints through iconURL
* fix(ci): tests passing for App Service
* docs: refactor custom_config.md for readability and better organization, also include missing values
* docs: interface section and re-organize docs
* docs: update modelSpecs info
* chore: remove unused files
* chore: remove unused files
* chore: move useSetIndexOptions
* chore: remove unused file
* chore: move useConversation(s)
* chore: move useDefaultConvo
* chore: move useNavigateToConvo
* refactor: use plugin install hook so it can be used elsewhere
* chore: import order
* update docs
* refactor(OpenAI/Plugins): allow modelLabel as an initial value for chatGptLabel
* chore: remove unused EndpointOptionsPopover and hide 'Save as Preset' button if preset UI visibility disabled
* feat(loadDefaultInterface): issue warnings based on values
* feat: changelog for custom config file
* docs: add additional changelog note
* fix: prevent unavailable tool selection from preset and update availableTools on Plugin installations
* feat: add `filteredTools` option in custom config
* chore: changelog
* fix(MessageIcon): always overwrite conversation.iconURL in messageSettings
* fix(ModelSpecsMenu): icon edge cases
* fix(NewChat): dynamic icon
* fix(PluginsClient): always include endpoint in responseMessage
* fix: always include endpoint and iconURL in responseMessage across different response methods
* feat: interchangeable keys for modelSpec enforcing
2024-04-30 22:11:48 -04:00
) ;
i === 0 && i ++ ;
}
if ( i > 0 ) {
logSettings ( ) ;
}
return loadedInterface ;
}
module . exports = { loadDefaultInterface } ;