Skip to content

@sqlrooms/ai-core / extractModelsFromSettings

Function: extractModelsFromSettings()

extractModelsFromSettings(config): object[]

Extract models from aiSettings in the format expected by ModelSelector

Parameters

ParameterTypeDescription
config{ providers: z.ZodRecord<z.ZodString, z.ZodObject<{ baseUrl: z.ZodString; apiKey: z.ZodString; models: z.ZodArray<z.ZodObject<{ modelName: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>>; customModels: object[]; modelParameters: { maxSteps: number; additionalInstruction: string; }; }The AI model configuration
config.providersz.ZodRecord<z.ZodString, z.ZodObject<{ baseUrl: z.ZodString; apiKey: z.ZodString; models: z.ZodArray<z.ZodObject<{ modelName: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>>-
config.customModelsobject[]-
config.modelParameters{ maxSteps: number; additionalInstruction: string; }-
config.modelParameters.maxStepsnumber-
config.modelParameters.additionalInstructionstring-

Returns

object[]

Array of models with provider, label, and value properties