1325
1326
async sendChatRequest(modelId: string, from: ExtensionIdentifier | undefined, messages: IChatMessage[], options: ILanguageModelChatRequestOptions, token: CancellationToken): Promise<ILanguageModelChatResponse> {
1328
>
const provider = this._providers.get(metadata?.vendor || '');
1329
>
if (!provider) {
1330
throw new Error(`Chat provider for model ${modelId} is not registered.`);
1331
}
1333
>
this._logProviderUsageTelemetry(metadata);
1334
>
this._maybeShowProviderDeprecationNotice(metadata);
1335
>
}
1336
>
const configuration = this.getModelConfiguration(modelId);
1337
>
const mergedOptions = configuration ? { ...options, configuration: { ...configuration, ...options.configuration } } : options;
1338
>
return provider.sendChatRequest(modelId, messages, from, mergedOptions, token);
1339
>
}
1340
1341
/**