1930
}
1931
1932
>
const silentAgent = sendOptions.agentIdSilent ? this.chatAgentService.getAgent(sendOptions.agentIdSilent) : undefined;
chatServiceImpl.ts
1933
>
const agent = silentAgent ?? parsedRequest.parts.find((r): r is ChatRequestAgentPart => r instanceof ChatRequestAgentPart)?.agent ?? defaultAgent;
1934
>
const agentSlashCommandPart = parsedRequest.parts.find((r): r is ChatRequestAgentSubcommandPart => r instanceof ChatRequestAgentSubcommandPart);
1935
>
1936
>
const responseState = this._sendRequestAsync(model, model.sessionResource, parsedRequest, firstRequest.request.attempt, !sendOptions.noCommandDetection, silentAgent ?? defaultAgent, location, sendOptions);
1937
>
1938
>
const result: ChatSendResultSent = {
1939
>
kind: 'sent',
1940
>
data: {
1941
>
...responseState,
1942
>
agent,
1943
>
slashCommand: agentSlashCommandPart?.command,
1944
>
},
1945
>
};
1946
>
for (const deferred of deferreds) {
1947
deferred.complete(result);
1948
}
1950
1951
private generateInitialChatTitleIfNeeded(model: ChatModel, request: IChatAgentRequest, defaultAgent: IChatAgentData, token: CancellationToken): void {