diff options
| author | Aiden Cline <[email protected]> | 2025-08-02 09:11:38 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-02 09:11:38 -0500 |
| commit | 0b132c032aae15a99907a5979f471c3b5bb2e3dc (patch) | |
| tree | 18df1db6a8eba1a15f9b898ce315d4a070a9a8f0 | |
| parent | 44d7103a42ddd75798fed815734ead937fef9364 (diff) | |
| download | opencode-0b132c032aae15a99907a5979f471c3b5bb2e3dc.tar.gz opencode-0b132c032aae15a99907a5979f471c3b5bb2e3dc.zip | |
ignore: fix dev branch (#1529)
| -rw-r--r-- | packages/opencode/src/provider/transform.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index 36535e11f..3264dd05d 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -1,7 +1,6 @@ import type { ModelMessage } from "ai" import { unique } from "remeda" - export namespace ProviderTransform { function normalizeToolCallIds(msgs: ModelMessage[]): ModelMessage[] { return msgs.map((msg) => { @@ -10,7 +9,7 @@ export namespace ProviderTransform { if ((part.type === "tool-call" || part.type === "tool-result") && "toolCallId" in part) { return { ...part, - toolCallId: part.toolCallId.replace(/[^a-zA-Z0-9_-]/g, '_') + toolCallId: part.toolCallId.replace(/[^a-zA-Z0-9_-]/g, "_"), } } return part @@ -40,8 +39,7 @@ export namespace ProviderTransform { } for (const msg of unique([...system, ...final])) { - const shouldUseContentOptions = - providerID !== "anthropic" && Array.isArray(msg.content) && msg.content.length > 0 + const shouldUseContentOptions = providerID !== "anthropic" && Array.isArray(msg.content) && msg.content.length > 0 if (shouldUseContentOptions) { const lastContent = msg.content[msg.content.length - 1] @@ -70,7 +68,7 @@ export namespace ProviderTransform { if (providerID === "anthropic" || modelID.includes("anthropic") || modelID.includes("claude")) { msgs = applyCaching(msgs, providerID) } - + return msgs } @@ -78,4 +76,9 @@ export namespace ProviderTransform { if (modelID.toLowerCase().includes("qwen")) return 0.55 return 0 } + + export function topP(_providerID: string, modelID: string) { + if (modelID.toLowerCase().includes("qwen")) return 1 + return undefined + } } |
