mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
refactor: update imports to use normalizeEndpointName from @librechat/api and remove redundant definitions
This commit is contained in:
parent
8df0ecd438
commit
5e70d518aa
6 changed files with 17 additions and 18 deletions
|
|
@ -1,3 +1,6 @@
|
|||
import { Providers } from '@librechat/agents';
|
||||
import { AuthType } from 'librechat-data-provider';
|
||||
|
||||
/**
|
||||
* Checks if the given value is truthy by being either the boolean `true` or a string
|
||||
* that case-insensitively matches 'true'.
|
||||
|
|
@ -31,7 +34,7 @@ export function isEnabled(value?: string | boolean | null | undefined): boolean
|
|||
* @param value - The value to check.
|
||||
* @returns - Returns true if the value is 'user_provided', otherwise false.
|
||||
*/
|
||||
export const isUserProvided = (value?: string): boolean => value === 'user_provided';
|
||||
export const isUserProvided = (value?: string): boolean => value === AuthType.USER_PROVIDED;
|
||||
|
||||
/**
|
||||
* @param values
|
||||
|
|
@ -46,3 +49,11 @@ export function optionalChainWithEmptyCheck(
|
|||
}
|
||||
return values[values.length - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the endpoint name to system-expected value.
|
||||
* @param name
|
||||
*/
|
||||
export function normalizeEndpointName(name = ''): string {
|
||||
return name.toLowerCase() === Providers.OLLAMA ? Providers.OLLAMA : name;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue