From 7c5d69193e5abfe9ca1121e45f3f9580b08fc891 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Sat, 21 Dec 2024 05:58:01 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=93=9D=20add=20filter=20for=20emp?= =?UTF-8?q?ty=20user=20text=20and=20new=20aliases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/chat.ts | 8 ++++++++ packages/core/src/llms.json | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/core/src/chat.ts b/packages/core/src/chat.ts index f39d7e7ed..9a5fec966 100644 --- a/packages/core/src/chat.ts +++ b/packages/core/src/chat.ts @@ -833,6 +833,14 @@ export function collapseChatMessages(messages: ChatCompletionMessageParam[]) { }) } } + + // remove emty text contents + messages + .filter((m) => m.role === "user") + .forEach((m) => { + if (typeof m.content !== "string") + m.content = m.content.filter((c) => c.type !== "text" || c.text) + }) } export async function executeChatSession( diff --git a/packages/core/src/llms.json b/packages/core/src/llms.json index 278551bd7..61ccebe37 100644 --- a/packages/core/src/llms.json +++ b/packages/core/src/llms.json @@ -45,7 +45,8 @@ "prediction": false, "aliases": { "large": "claude-3-5-sonnet-latest", - "small": "claude-3-5-haiku-latest" + "small": "claude-3-5-haiku-latest", + "vision": "claude-3-5-sonnet-latest" } }, { @@ -85,7 +86,7 @@ "large": "Qwen/Qwen2.5-72B-Instruct", "small": "Qwen/Qwen2.5-Coder-32B-Instruct", "vision": "Qwen/Qwen2-VL-7B-Instruct", - "embeddings": "nomic-ai/nomic-embed-text-v1.5", + "embeddings": "nomic-ai/nomic-embed-text-v1.5:", "reasoning": "Qwen/QwQ-32B-Preview", "reasoning_small": "Qwen/QwQ-32B-Preview" }