mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
Merge 4d93a55975 into 8ed0bcf5ca
This commit is contained in:
commit
9dc0611439
2 changed files with 10 additions and 3 deletions
|
|
@ -451,6 +451,7 @@ const initializeClient = async ({ req, res, signal, endpointOption }) => {
|
|||
endpointType: endpointOption.endpointType,
|
||||
resendFiles: primaryConfig.resendFiles ?? true,
|
||||
maxContextTokens: primaryConfig.maxContextTokens,
|
||||
modelLabel: endpointOption.model_parameters?.modelLabel,
|
||||
endpoint: isEphemeralAgentId(primaryConfig.id) ? primaryConfig.endpoint : EModelEndpoint.agents,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
import { useCallback } from 'react';
|
||||
import { getResponseSender } from 'librechat-data-provider';
|
||||
import type { TEndpointOption, TEndpointsConfig } from 'librechat-data-provider';
|
||||
import { useGetEndpointsQuery } from '~/data-provider';
|
||||
import { useGetEndpointsQuery, useGetStartupConfig } from '~/data-provider';
|
||||
|
||||
export default function useGetSender() {
|
||||
const { data: endpointsConfig = {} as TEndpointsConfig } = useGetEndpointsQuery();
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
return useCallback(
|
||||
(endpointOption: TEndpointOption) => {
|
||||
const { modelDisplayLabel } = endpointsConfig?.[endpointOption.endpoint ?? ''] ?? {};
|
||||
return getResponseSender({ ...endpointOption, modelDisplayLabel });
|
||||
let { modelLabel } = endpointOption;
|
||||
if (!modelLabel && endpointOption.spec) {
|
||||
const spec = startupConfig?.modelSpecs?.list?.find((s) => s.name === endpointOption.spec);
|
||||
modelLabel = spec?.preset?.modelLabel ?? spec?.label ?? null;
|
||||
}
|
||||
return getResponseSender({ ...endpointOption, modelLabel, modelDisplayLabel });
|
||||
},
|
||||
[endpointsConfig],
|
||||
[endpointsConfig, startupConfig],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue