Skip to content

Commit 68b5d61

Browse files
authored
to object (#5102)
1 parent 87798b1 commit 68b5d61

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/cost/models/providers/helicone.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@ export class HeliconeProvider extends BaseProvider {
4040
if (isAnthropicModel) {
4141
// Use Anthropic message format (converted from OpenAI format if needed)
4242
if (context.bodyMapping === "NO_MAPPING") {
43+
const body = { ...context.parsedBody };
44+
45+
// Ensure system message is in object format if it's a string
46+
if (typeof body.system === "string") {
47+
body.system = [{ type: "text", text: body.system }];
48+
}
49+
4350
return JSON.stringify({
44-
...context.parsedBody,
51+
...body,
4552
model: endpoint.providerModelId,
4653
});
4754
}

0 commit comments

Comments
 (0)