-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
feat: Add group field to modelSpecs for flexible grouping #9996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
import { ModelSelectorProvider, useModelSelectorContext } from './ModelSelectorContext'; | ||
import { ModelSelectorChatProvider } from './ModelSelectorChatContext'; | ||
import { renderModelSpecs, renderEndpoints, renderSearchResults } from './components'; | ||
import { renderModelSpecs, renderEndpoints, renderSearchResults, renderCustomGroups } from './components'; |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
@@ -0,0 +1,66 @@ | |||
import { useMemo } from 'react'; |
Check warning
Code scanning / ESLint
Disallow unused variables Warning
endpointRequiresUserKey, | ||
} = useModelSelectorContext(); | ||
const { model: selectedModel, endpoint: selectedEndpoint } = selectedValues; | ||
const { model: selectedModel, endpoint: selectedEndpoint, modelSpec: selectedSpec } = selectedValues; |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
className="flex w-full cursor-pointer items-center justify-between rounded-lg px-2 text-sm" | ||
> | ||
<div className="flex items-center gap-2"> | ||
<div className="flex w-full min-w-0 gap-2 px-1 py-1 items-center"> |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
) : (isAgentsEndpoint(endpoint.value) || isAssistantsEndpoint(endpoint.value)) && | ||
endpoint.icon ? ( | ||
<div className="flex h-5 w-5 items-center justify-center overflow-hidden rounded-full"> | ||
) : (isAgentsEndpoint(endpoint.value) || isAssistantsEndpoint(endpoint.value)) && endpoint.icon ? ( |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
) : null} | ||
<span>{modelName}</span> | ||
<span className="truncate text-left">{modelName}</span> | ||
{isGlobal && <EarthIcon className="ml-auto size-4 flex-shrink-0 self-center text-green-400" />} |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
}, [ | ||
filteredEndpoints, | ||
endpointsConfig, | ||
modelsQuery.data, | ||
agents, | ||
assistants, | ||
azureAssistants, | ||
]); |
Check failure
Code scanning / ESLint
Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error
Thanks for the PR. Please fix the ESLint issues. |
Summary
This Adds optional
group
field to modelSpecs configuration, so that you can group modelSpecs together in the top level endpoints selector. The goal here was to be able to add descriptions to models without losing the organization of the selector menu.Putting this in in responses to several conversations regarding descriptions to models without losing the UI organization of models.
#8444
https://discord.com/channels/1086345563026489514/1107675256782598195/threads/1387425830627442830
https://discord.com/channels/1086345563026489514/1349414162429775974/1349414162429775974
Change Type
Testing
Refer to the
librechat.example.yaml
for configuration options.Test Configuration:
Checklist
I recognize that this needs documentation updates, which I am happy to make if this looks good to get merged.