diff --git a/src/main.ts b/src/main.ts index 26fbc51..b69d580 100644 --- a/src/main.ts +++ b/src/main.ts @@ -116,7 +116,8 @@ const generateOllamaRequest = async ( }); const ollamaResponse: OllamaResponse = await response.json(); await storePromptData(notification, ollamaResponse); - await postReplyToStatus(notification, ollamaResponse); + // await postReplyToStatus(notification, ollamaResponse); + return ollamaResponse; } } catch (error: any) { throw new Error(error.message); @@ -166,8 +167,11 @@ const postReplyToStatus = async ( if (notifications) { await Promise.all( - notifications.map((notification) => { - generateOllamaRequest(notification); + notifications.map(async (notification) => { + const ollamaResponse = await generateOllamaRequest(notification); + if (ollamaResponse) { + postReplyToStatus(notification, ollamaResponse); + } }) ); }