Add comment

This commit is contained in:
Saoud Rizwan
2024-10-01 15:42:17 -04:00
parent 6b5f33c7e8
commit 2de5971adc

View File

@@ -58,6 +58,7 @@ export class OpenRouterHandler implements ApiHandler {
msg.content = [{ type: "text", text: msg.content }] msg.content = [{ type: "text", text: msg.content }]
} }
if (Array.isArray(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() let lastTextPart = msg.content.filter((part) => part.type === "text").pop()
if (!lastTextPart) { if (!lastTextPart) {