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

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="currentColor" class="bg-white"><path d="m3.005 8.858 8.783 12.544h3.904L6.908 8.858zM6.905 15.825 3 21.402h3.907l1.951-2.788zM16.585 2l-6.75 9.64 1.953 2.79L20.492 2zM17.292 7.965v13.437h3.2V3.395z"></path></svg>

After

Width:  |  Height:  |  Size: 315 B

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) {