feat: abort agent requests

This commit is contained in:
Danny Avila 2024-09-02 14:06:39 -04:00
parent 757f544a9b
commit 7d54f7147f
No known key found for this signature in database
GPG key ID: 2DD9CC89B9B50364
4 changed files with 26 additions and 5 deletions

View file

@ -46,6 +46,7 @@ const AgentController = async (req, res, next, initializeClient, addTitle) => {
};
try {
/** @type {{ client: TAgentClient }} */
const { client } = await initializeClient({ req, res, endpointOption });
const getAbortData = () => ({
@ -54,8 +55,8 @@ const AgentController = async (req, res, next, initializeClient, addTitle) => {
promptTokens,
conversationId,
userMessagePromise,
// text: getPartialText(),
messageId: responseMessageId,
content: client.getContentParts(),
parentMessageId: overrideParentMessageId ?? userMessageId,
});