Skip to content

Commit

Permalink
fix: anthropic tool calls playground (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Sep 20, 2024
1 parent a02861e commit 2ee2eb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/utils/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ function getOpenAIMessage(message: Anthropic.Messages.Message): ChatCompletion {
.map((block) => (block as { text: string }).text)
.join(""),
tool_calls:
message.content[1]?.type === "function"
message.content[1]?.type === "tool_use"
? [
{
id: message.content[1].id,
type: "function",
function: {
name: message.content[1].name,
arguments: message.content[1].input,
arguments: JSON.stringify(message.content[1].input),
},
},
]
Expand Down

0 comments on commit 2ee2eb0

Please sign in to comment.