fix: send message tests (#2656)
This commit is contained in:
@@ -252,7 +252,7 @@ class AnthropicStreamingInterface:
|
||||
# Strip out the inner thoughts from the buffered tool call arguments before streaming
|
||||
tool_call_args = ""
|
||||
for buffered_msg in self.tool_call_buffer:
|
||||
tool_call_args += buffered_msg.tool_call.arguments
|
||||
tool_call_args += buffered_msg.tool_call.arguments if buffered_msg.tool_call.arguments else ""
|
||||
tool_call_args = tool_call_args.replace(f'"{INNER_THOUGHTS_KWARG}": "{current_inner_thoughts}"', "")
|
||||
|
||||
tool_call_msg = ToolCallMessage(
|
||||
|
||||
@@ -296,6 +296,8 @@ def unpack_inner_thoughts_from_kwargs(choice: Choice, inner_thoughts_key: str) -
|
||||
|
||||
except json.JSONDecodeError as e:
|
||||
warnings.warn(f"Failed to strip inner thoughts from kwargs: {e}")
|
||||
print(f"\nFailed to strip inner thoughts from kwargs: {e}")
|
||||
print(f"\nTool call arguments: {tool_call.function.arguments}")
|
||||
raise e
|
||||
else:
|
||||
warnings.warn(f"Did not find tool call in message: {str(message)}")
|
||||
|
||||
Reference in New Issue
Block a user