Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/providers/anthropic/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface AnthropicTool extends PromptCache {
}
>;
required: string[];
$defs: Record<string, any>;
};
type?: string;
display_width_px?: number;
Expand Down Expand Up @@ -134,7 +135,9 @@ const transformAssistantMessage = (msg: Message): AnthropicMessage => {
type: 'tool_use',
name: toolCall.function.name,
id: toolCall.id,
input: JSON.parse(toolCall.function.arguments),
input: toolCall.function.arguments?.length
Comment thread
narengogi marked this conversation as resolved.
? JSON.parse(toolCall.function.arguments)
: {},
});
});
}
Expand Down Expand Up @@ -340,6 +343,7 @@ export const AnthropicChatCompleteConfig: ProviderConfig = {
type: tool.function.parameters?.type || 'object',
properties: tool.function.parameters?.properties || {},
required: tool.function.parameters?.required || [],
$defs: tool.function.parameters?.['$defs'] || {},
},
...(tool.cache_control && {
cache_control: { type: 'ephemeral' },
Expand Down