mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
🔧 fix(useMentions): handle empty assistant lists (#2966)
The useMentions hook in the client/src/hooks/Input/useMentions.ts file has been updated to handle cases where the assistant lists for the endpoints 'assistants' and 'azureAssistants' are empty. This change ensures that the hook does not throw an error when attempting to access assistantListMap[EModelEndpoint.assistants] or assistantListMap[EModelEndpoint.azureAssistants]. Instead, it defaults to an empty array for these cases.
This commit is contained in:
parent
4469ba72fc
commit
f69b317171
1 changed files with 2 additions and 2 deletions
|
|
@ -121,10 +121,10 @@ export default function useMentions({ assistantMap }: { assistantMap: TAssistant
|
|||
}),
|
||||
})),
|
||||
...(endpointsConfig?.[EModelEndpoint.assistants]
|
||||
? assistantListMap[EModelEndpoint.assistants]
|
||||
? assistantListMap[EModelEndpoint.assistants] || []
|
||||
: []),
|
||||
...(endpointsConfig?.[EModelEndpoint.azureAssistants]
|
||||
? assistantListMap[EModelEndpoint.azureAssistants]
|
||||
? assistantListMap[EModelEndpoint.azureAssistants] || []
|
||||
: []),
|
||||
...((interfaceConfig.presets ? presets : [])?.map((preset, index) => ({
|
||||
value: preset.presetId ?? `preset-${index}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue