From 2de5971adcadc244e87a65c6916cb81d57e18caf Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:42:17 -0400 Subject: [PATCH] Add comment --- src/api/providers/openrouter.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/providers/openrouter.ts b/src/api/providers/openrouter.ts index 744d413..6e31055 100644 --- a/src/api/providers/openrouter.ts +++ b/src/api/providers/openrouter.ts @@ -58,6 +58,7 @@ export class OpenRouterHandler implements ApiHandler { msg.content = [{ type: "text", text: msg.content }] } if (Array.isArray(msg.content)) { + // NOTE: this is fine since env details will always be added at the end. but if it weren't there, and the user added a image_url type message, it would pop a text part before it and then move it after to the end. let lastTextPart = msg.content.filter((part) => part.type === "text").pop() if (!lastTextPart) {