822
): Promise<Response> {
823
const capiClient = await this._getClientForToken(githubToken);
825
>
826
>
this._logService.debug('[CopilotApiService] POST messages', `model=${request.model} stream=${stream} requestId=${requestId}`);
827
>
828
>
const { system, ...rest } = request;
829
>
const body = JSON.stringify({
830
>
...rest,
831
>
stream,
832
>
// CAPI requires system as a text-block array, not a raw string
833
>
...(system !== undefined
834
? { system: typeof system === 'string' ? [{ type: 'text', text: system }] : system }
835
: {}),