mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: feat(anthropic): Add response_format support for structured outputs (#3301)
* fix(anthropic): Add response_format support for structured outputs * only use from options * use native way of response format * ruff lint fix * address comment; handle dict
This commit is contained in:
@@ -495,7 +495,7 @@ def test_process_message_basic(mock_anthropic_client: MagicMock) -> None:
|
||||
mock_message.usage = BetaUsage(input_tokens=10, output_tokens=5)
|
||||
mock_message.stop_reason = "end_turn"
|
||||
|
||||
response = chat_client._process_message(mock_message)
|
||||
response = chat_client._process_message(mock_message, {})
|
||||
|
||||
assert response.response_id == "msg_123"
|
||||
assert response.model_id == "claude-3-5-sonnet-20241022"
|
||||
@@ -528,7 +528,7 @@ def test_process_message_with_tool_use(mock_anthropic_client: MagicMock) -> None
|
||||
mock_message.usage = BetaUsage(input_tokens=10, output_tokens=5)
|
||||
mock_message.stop_reason = "tool_use"
|
||||
|
||||
response = chat_client._process_message(mock_message)
|
||||
response = chat_client._process_message(mock_message, {})
|
||||
|
||||
assert len(response.messages[0].contents) == 1
|
||||
assert response.messages[0].contents[0].type == "function_call"
|
||||
|
||||
Reference in New Issue
Block a user