ai
ai copied to clipboard
Model Registry non-standard parameters
Feature Description
The current implementation of experimental model registry doesn't allow any parameters except a model id. There is no way to pass optional non-standard parameters to a model, like topK. The change should be simple enough (just for illustration):
languageModel(id: string, options: any): LanguageModel {
const [providerId, modelId] = this.splitId(id);
const model = this.getProvider(providerId).languageModel?.(modelId, options);
if (model == null) {
throw new NoSuchModelError({ modelId: id, modelType: 'language model' });
}
return model;
}
Use Case
No response
Additional context
No response