mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 09:01:14 +00:00
parent
098f396cf3
commit
af813f9048
2 changed files with 4 additions and 4 deletions
|
|
@ -233,7 +233,7 @@ export const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicOpti
|
|||
name: isOAuthToken
|
||||
? fromClaudeCodeName(event.content_block.name, context.tools)
|
||||
: event.content_block.name,
|
||||
arguments: event.content_block.input as Record<string, any>,
|
||||
arguments: (event.content_block.input as Record<string, any>) ?? {},
|
||||
partialJson: "",
|
||||
index: event.index,
|
||||
};
|
||||
|
|
@ -619,7 +619,7 @@ function convertMessages(
|
|||
type: "tool_use",
|
||||
id: block.id,
|
||||
name: isOAuthToken ? toClaudeCodeName(block.name) : block.name,
|
||||
input: block.arguments,
|
||||
input: block.arguments ?? {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export function convertMessages<T extends GoogleApiType>(model: Model<T>, contex
|
|||
// We include a note telling the model this is historical context to prevent mimicry.
|
||||
const isGemini3 = model.id.toLowerCase().includes("gemini-3");
|
||||
if (isGemini3 && !thoughtSignature) {
|
||||
const argsStr = JSON.stringify(block.arguments, null, 2);
|
||||
const argsStr = JSON.stringify(block.arguments ?? {}, null, 2);
|
||||
parts.push({
|
||||
text: `[Historical context: a different model called tool "${block.name}" with arguments: ${argsStr}. Do not mimic this format - use proper function calling.]`,
|
||||
});
|
||||
|
|
@ -151,7 +151,7 @@ export function convertMessages<T extends GoogleApiType>(model: Model<T>, contex
|
|||
const part: Part = {
|
||||
functionCall: {
|
||||
name: block.name,
|
||||
args: block.arguments,
|
||||
args: block.arguments ?? {},
|
||||
...(requiresToolCallId(model.id) ? { id: block.id } : {}),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue