608
609
async models(githubToken: string, options?: ICopilotApiServiceRequestOptions): Promise<CCAModel[]> {
611
>
612
>
this._logService.debug('[CopilotApiService] GET models');
613
>
614
>
const response = await capiClient.makeRequest<Response>(
615
>
{
616
>
method: 'GET',
617
>
headers: {
618
>
...options?.headers,
619
>
'Authorization': `Bearer ${githubToken}`,
620
>
},
621
>
// Opt-in per request — see
622
>
// `ICopilotApiServiceRequestOptions.suppressIntegrationId`.
623
>
suppressIntegrationId: options?.suppressIntegrationId,
624
>
signal: options?.signal,
625
>
},
626
>
{ type: RequestType.Models },
627
>
);
628
>
629
>
if (!response.ok) {
630
if (response.status === 401 || response.status === 403) {
631
this._invalidateClientForToken(githubToken);