@@ -1232,8 +1232,8 @@ async def test_embedding_config_required_model_missing(vector_io_adapter):
12321232 await vector_io_adapter .openai_create_vector_store (params )
12331233
12341234
1235- async def test_query_expansion_functionality (vector_io_adapter ):
1236- """Test query expansion with instance-based configuration approach."""
1235+ async def test_query_rewrite_functionality (vector_io_adapter ):
1236+ """Test query rewrite with instance-based configuration approach."""
12371237 from unittest .mock import MagicMock
12381238
12391239 from llama_stack .core .datatypes import QualifiedModel , RewriteQueryParams
@@ -1261,10 +1261,10 @@ async def mock_query_chunks(*args, **kwargs):
12611261
12621262 # Mock chat completion for query rewriting
12631263 vector_io_adapter .inference_api .openai_chat_completion = AsyncMock (
1264- return_value = MagicMock (choices = [MagicMock (message = MagicMock (content = "expanded test query" ))])
1264+ return_value = MagicMock (choices = [MagicMock (message = MagicMock (content = "rewritten test query" ))])
12651265 )
12661266
1267- # Test 1: Query expansion with default prompt (no custom prompt configured)
1267+ # Test 1: Query rewrite with default prompt (no custom prompt configured)
12681268 mock_vector_stores_config = MagicMock ()
12691269 mock_vector_stores_config .rewrite_query_params = RewriteQueryParams (
12701270 model = QualifiedModel (provider_id = "test" , model_id = "llama" ), max_tokens = 100 , temperature = 0.3
@@ -1295,7 +1295,7 @@ async def mock_query_chunks(*args, **kwargs):
12951295 # Verify the adapter's query_chunks was called with rewritten query
12961296 assert result is not None # Search should return a result
12971297
1298- # Test 1b: Query expansion with custom prompt override and inference parameters
1298+ # Test 1b: Query rewrite with custom prompt override and inference parameters
12991299
13001300 mock_vector_stores_config .rewrite_query_params = RewriteQueryParams (
13011301 model = QualifiedModel (provider_id = "test" , model_id = "llama" ),
@@ -1325,7 +1325,7 @@ async def mock_query_chunks(*args, **kwargs):
13251325 # Clear config on the adapter
13261326 vector_io_adapter .vector_stores_config = None
13271327
1328- with pytest .raises (ValueError , match = "Query rewriting requested but not configured " ):
1328+ with pytest .raises (ValueError , match = "Query rewriting is not available " ):
13291329 await vector_io_adapter .openai_search_vector_store (
13301330 vector_store_id = vector_store_id , query = "test query" , rewrite_query = True , max_num_results = 5
13311331 )
0 commit comments