mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
AIX: XAI: model validation
This commit is contained in:
@@ -217,7 +217,12 @@ const _knownXAIChatModels: ManualMappings = [
|
||||
];
|
||||
|
||||
|
||||
// xAI Model Descriptions
|
||||
function xaiValidateModelDefs_DEV(availableModels: z.infer<typeof wireXAIModelsListSchema>['models']): void {
|
||||
if (DEV_DEBUG_XAI_MODELS) {
|
||||
llmDevCheckModels_DEV('xAI', availableModels.map(m => m.id), _knownXAIChatModels.map(m => m.idPrefix));
|
||||
}
|
||||
}
|
||||
|
||||
export async function xaiFetchModelDescriptions(access: OpenAIAccessSchema): Promise<ModelDescriptionSchema[]> {
|
||||
|
||||
// List models
|
||||
@@ -226,6 +231,9 @@ export async function xaiFetchModelDescriptions(access: OpenAIAccessSchema): Pro
|
||||
|
||||
const xaiModels = wireXAIModelsListSchema.parse(modelsResponse);
|
||||
|
||||
// DEV: validate model definitions
|
||||
xaiValidateModelDefs_DEV(xaiModels.models);
|
||||
|
||||
return xaiModels.models.reduce((acc, xm) => {
|
||||
|
||||
// Fallback for unknown models
|
||||
|
||||
Reference in New Issue
Block a user