@@ -123,7 +123,6 @@ def test_agents_rag_agent(
123123 Based on "Build a RAG Agent" example available at
124124 https://llamastack.github.io/docs/getting_started/detailed_tutorial
125125
126- # TODO: update this example to use the vector_store API
127126 """
128127
129128 # Create the RAG agent connected to the vector database
@@ -143,11 +142,12 @@ def test_agents_rag_agent(
143142 turns_with_expectations = get_torchtune_test_expectations ()
144143
145144 # Ask the agent about the inserted documents and validate responses
145+ enable_streaming = False
146146 validation_result = validate_rag_agent_responses (
147147 rag_agent = rag_agent ,
148148 session_id = session_id ,
149149 turns_with_expectations = turns_with_expectations ,
150- stream = True ,
150+ stream = enable_streaming ,
151151 verbose = True ,
152152 min_keywords_required = 1 ,
153153 print_events = False ,
@@ -158,8 +158,9 @@ def test_agents_rag_agent(
158158
159159 # Additional assertions for specific requirements
160160 for result in validation_result ["results" ]:
161- assert result ["event_count" ] > 0 , f"No events generated for question: { result ['question' ]} "
162161 assert result ["response_length" ] > 0 , f"No response content for question: { result ['question' ]} "
163162 assert len (result ["found_keywords" ]) > 0 , (
164163 f"No expected keywords found in response for: { result ['question' ]} "
165164 )
165+ if enable_streaming :
166+ assert result ["event_count" ] > 0 , f"No events generated for question: { result ['question' ]} "
0 commit comments