def test_prepare_chat_with_tools_tool_not_required(bedrock_converse):
    """Test that tool_required=False is correctly passed to the API request."""
    result = bedrock_converse._prepare_chat_with_tools(
        tools=[search_tool], tool_required=False
    )

    assert "tools" in result
    assert "toolChoice" in result["tools"]
    assert result["tools"]["toolChoice"] == {"auto": {}}
Test that tool_required=False is correctly passed to the API request.
llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py