async def test_bedrock_converse_agent_workflow_empty_text_error(
    bedrock_converse_integration,
):
    """
    Test that reproduces the empty text field error when BedrockConverse
    calls tools without outputting any text in AgentWorkflow.

    This test reproduces the issue described in:
    https://github.com/run-llama/llama_index/issues/18449
    """
    get_temperature_tool = FunctionTool.from_defaults(
        name="get_temperature",
        description="A tool that returns the temperature of a given location.",
        fn=get_temperature,
    )
    agent = FunctionAgent(
        name="weather_agent",
        tools=[get_temperature_tool],
        llm=bedrock_converse_integration,
        system_prompt="You are a helpful assistant that helps users with their queries about the weather.",
    )
    workflow = AgentWorkflow(agents=[agent])

    try:
        response = await workflow.run(
            user_msg="Sort the temperatures of the following locations: Paris, London, Lisbon, Madrid, and Rome."
        )
        assert response is not None

    except Exception as e:
        error_msg = str(e)
        if (
            "The text field in the ContentBlock object" in error_msg
            and "is blank" in error_msg
        ):
            pytest.fail(f"Empty text field error occurred: {error_msg}")
        else:
            raise

    Test that reproduces the empty text field error when BedrockConverse
    calls tools without outputting any text in AgentWorkflow.

    This test reproduces the issue described in:
    https://github.com/run-llama/llama_index/issues/18449
    
llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py