mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 01:12:15 +00:00
tweak: transform
This commit is contained in:
parent
c285304acf
commit
06acd70670
1 changed files with 4 additions and 1 deletions
|
|
@ -22,7 +22,10 @@ export namespace ProviderTransform {
|
|||
if (model.api.npm === "@ai-sdk/anthropic") {
|
||||
msgs = msgs
|
||||
.map((msg) => {
|
||||
if (typeof msg.content === "string") return msg
|
||||
if (typeof msg.content === "string") {
|
||||
if (msg.content === "") return undefined
|
||||
return msg
|
||||
}
|
||||
if (!Array.isArray(msg.content)) return msg
|
||||
const filtered = msg.content.filter((part) => {
|
||||
if (part.type === "text" || part.type === "reasoning") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue