Skip to content

Commit

Permalink
feat: 📝 add filter for empty user text and new aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Dec 21, 2024
1 parent c5d16bf commit 7c5d691
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/llms.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -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"
}
Expand Down

0 comments on commit 7c5d691

Please sign in to comment.