feat: Known Endpoint, xAI (#4632)

* feat: Known Endpoint, xAI

* chore: update librechat-data-provider version to 0.7.53

* ci: name property removal

* feat: add XAI_API_KEY to example environment variables
This commit is contained in:
Danny Avila 2024-11-04 16:27:54 -05:00 committed by GitHub
parent fc41032923
commit 3428c3c647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 22 additions and 12 deletions

View file

@ -1,6 +1,7 @@
import { EModelEndpoint, KnownEndpoints } from 'librechat-data-provider';
import { CustomMinimalIcon } from '~/components/svg';
import { IconContext } from '~/common';
import { cn } from '~/utils';
const knownEndpointAssets = {
[KnownEndpoints.anyscale]: '/assets/anyscale.png',
@ -18,12 +19,19 @@ const knownEndpointAssets = {
[KnownEndpoints.shuttleai]: '/assets/shuttleai.png',
[KnownEndpoints['together.ai']]: '/assets/together.png',
[KnownEndpoints.unify]: '/assets/unify.webp',
[KnownEndpoints.xai]: '/assets/xai.svg',
};
const knownEndpointClasses = {
[KnownEndpoints.cohere]: {
[IconContext.landing]: 'p-2',
},
[KnownEndpoints.xai]: {
[IconContext.landing]: 'p-2',
[IconContext.menuItem]: 'bg-white',
[IconContext.message]: 'bg-white',
[IconContext.nav]: 'bg-white',
},
};
const getKnownClass = ({
@ -39,10 +47,10 @@ const getKnownClass = ({
return className;
}
const match = knownEndpointClasses[currentEndpoint]?.[context];
const match = knownEndpointClasses[currentEndpoint]?.[context] ?? '';
const defaultClass = context === IconContext.landing ? '' : className;
return match ?? defaultClass;
return cn(match, defaultClass);
};
export default function UnknownIcon({
@ -61,7 +69,6 @@ export default function UnknownIcon({
return <CustomMinimalIcon className={className} />;
}
console.log('UnknownIcon', endpoint);
const currentEndpoint = endpoint.toLowerCase();
if (iconURL) {