1111from fastapi import HTTPException , Request , status
1212from litellm .exceptions import RateLimitError
1313from llama_stack_client import APIConnectionError
14- from llama_stack_client .types import UserMessage
15- from llama_stack_client .types .agents .turn import Turn
14+ from llama_stack_client .types import UserMessage # type: ignore
15+ from llama_stack_client .types .alpha . agents .turn import Turn
1616from llama_stack_client .types .shared .interleaved_content_item import TextContentItem
17- from llama_stack_client .types .tool_execution_step import ToolExecutionStep
18- from llama_stack_client .types .tool_response import ToolResponse
17+ from llama_stack_client .types .alpha . tool_execution_step import ToolExecutionStep
18+ from llama_stack_client .types .alpha . tool_response import ToolResponse
1919from pydantic import AnyUrl
2020from pytest_mock import MockerFixture
2121
@@ -1935,9 +1935,9 @@ async def test_get_topic_summary_successful_response(mocker: MockerFixture) -> N
19351935 # Mock the agent's create_turn method
19361936 mock_agent .create_turn .return_value = mock_response
19371937
1938- # Mock the interleaved_content_as_str function
1938+ # Mock the content_to_str function
19391939 mocker .patch (
1940- "app.endpoints.query.interleaved_content_as_str " ,
1940+ "app.endpoints.query.content_to_str " ,
19411941 return_value = "This is a topic summary about OpenStack" ,
19421942 )
19431943
@@ -2068,9 +2068,9 @@ async def test_get_topic_summary_with_interleaved_content(
20682068 # Mock the agent's create_turn method
20692069 mock_agent .create_turn .return_value = mock_response
20702070
2071- # Mock the interleaved_content_as_str function
2072- mock_interleaved_content_as_str = mocker .patch (
2073- "app.endpoints.query.interleaved_content_as_str " , return_value = "Topic summary"
2071+ # Mock the content_to_str function
2072+ mock_content_to_str = mocker .patch (
2073+ "app.endpoints.query.content_to_str " , return_value = "Topic summary"
20742074 )
20752075
20762076 # Mock the get_topic_summary_system_prompt function
@@ -2091,8 +2091,8 @@ async def test_get_topic_summary_with_interleaved_content(
20912091 # Assertions
20922092 assert result == "Topic summary"
20932093
2094- # Verify interleaved_content_as_str was called with the content
2095- mock_interleaved_content_as_str .assert_called_once_with (mock_content )
2094+ # Verify content_to_str was called with the content
2095+ mock_content_to_str .assert_called_once_with (mock_content )
20962096
20972097
20982098@pytest .mark .asyncio
@@ -2113,10 +2113,8 @@ async def test_get_topic_summary_system_prompt_retrieval(mocker: MockerFixture)
21132113 # Mock the agent's create_turn method
21142114 mock_agent .create_turn .return_value = mock_response
21152115
2116- # Mock the interleaved_content_as_str function
2117- mocker .patch (
2118- "app.endpoints.query.interleaved_content_as_str" , return_value = "Topic summary"
2119- )
2116+ # Mock the content_to_str function
2117+ mocker .patch ("app.endpoints.query.content_to_str" , return_value = "Topic summary" )
21202118
21212119 # Mock the get_topic_summary_system_prompt function
21222120 mock_get_topic_summary_system_prompt = mocker .patch (
@@ -2189,10 +2187,8 @@ async def test_get_topic_summary_agent_creation_parameters(
21892187 # Mock the agent's create_turn method
21902188 mock_agent .create_turn .return_value = mock_response
21912189
2192- # Mock the interleaved_content_as_str function
2193- mocker .patch (
2194- "app.endpoints.query.interleaved_content_as_str" , return_value = "Topic summary"
2195- )
2190+ # Mock the content_to_str function
2191+ mocker .patch ("app.endpoints.query.content_to_str" , return_value = "Topic summary" )
21962192
21972193 # Mock the get_topic_summary_system_prompt function
21982194 mocker .patch (
@@ -2236,10 +2232,8 @@ async def test_get_topic_summary_create_turn_parameters(mocker: MockerFixture) -
22362232 # Mock the agent's create_turn method
22372233 mock_agent .create_turn .return_value = mock_response
22382234
2239- # Mock the interleaved_content_as_str function
2240- mocker .patch (
2241- "app.endpoints.query.interleaved_content_as_str" , return_value = "Topic summary"
2242- )
2235+ # Mock the content_to_str function
2236+ mocker .patch ("app.endpoints.query.content_to_str" , return_value = "Topic summary" )
22432237
22442238 # Mock the get_topic_summary_system_prompt function
22452239 mocker .patch (
0 commit comments