Skip to content

Commit

Permalink
catch new block.content string response type
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranMn committed Dec 16, 2024
1 parent eeef70b commit 5c27330
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ export const mapAnthropicMessageToLlmMessage = (params: {
} else if (block.type === "tool_use") {
throw new Error("Tool use content not supported");
} else if (block.type === "tool_result") {
if (typeof block.content === "string") {
throw new Error(
"Unexpected string content for tool result, expected object with type field",
);
}

/**
* Currently images are not supported in LLM messages,
* so we filter them out from the content.
Expand Down

0 comments on commit 5c27330

Please sign in to comment.