1616
1717from approaches .approach import (
1818 Approach ,
19- DataPoints ,
2019 ExtraInfo ,
2120 ThoughtStep ,
2221)
@@ -284,9 +283,11 @@ async def run_search_approach(
284283 minimum_reranker_score = overrides .get ("minimum_reranker_score" , 0.0 )
285284 search_index_filter = self .build_filter (overrides , auth_claims )
286285 send_text_sources = overrides .get ("send_text_sources" , True )
287- send_image_sources = overrides .get ("send_image_sources" , True )
286+ send_image_sources = overrides .get ("send_image_sources" , self . multimodal_enabled ) and self . multimodal_enabled
288287 search_text_embeddings = overrides .get ("search_text_embeddings" , True )
289- search_image_embeddings = overrides .get ("search_image_embeddings" , self .multimodal_enabled )
288+ search_image_embeddings = (
289+ overrides .get ("search_image_embeddings" , self .multimodal_enabled ) and self .multimodal_enabled
290+ )
290291
291292 original_user_query = messages [- 1 ]["content" ]
292293 if not isinstance (original_user_query , str ):
@@ -342,11 +343,12 @@ async def run_search_approach(
342343
343344 # STEP 3: Generate a contextual and content specific answer using the search results and chat history
344345 data_points = await self .get_sources_content (
345- results , use_semantic_captions , download_image_sources = send_image_sources , user_oid = auth_claims .get ("oid" )
346+ results ,
347+ use_semantic_captions ,
348+ include_text_sources = send_text_sources ,
349+ download_image_sources = send_image_sources ,
350+ user_oid = auth_claims .get ("oid" ),
346351 )
347- if not send_text_sources :
348- data_points = DataPoints (text = [], images = data_points .images , citations = data_points .citations )
349-
350352 extra_info = ExtraInfo (
351353 data_points ,
352354 thoughts = [
@@ -396,7 +398,7 @@ async def run_agentic_retrieval_approach(
396398 # 50 is the amount of documents that the reranker can process per query
397399 max_docs_for_reranker = max_subqueries * 50
398400 send_text_sources = overrides .get ("send_text_sources" , True )
399- send_image_sources = overrides .get ("send_image_sources" , True )
401+ send_image_sources = overrides .get ("send_image_sources" , self . multimodal_enabled ) and self . multimodal_enabled
400402
401403 response , results = await self .run_agentic_retrieval (
402404 messages = messages ,
@@ -412,12 +414,10 @@ async def run_agentic_retrieval_approach(
412414 data_points = await self .get_sources_content (
413415 results ,
414416 use_semantic_captions = False ,
417+ include_text_sources = send_text_sources ,
415418 download_image_sources = send_image_sources ,
416419 user_oid = auth_claims .get ("oid" ),
417420 )
418- if not send_text_sources :
419- data_points = DataPoints (text = [], images = data_points .images , citations = data_points .citations )
420-
421421 extra_info = ExtraInfo (
422422 data_points ,
423423 thoughts = [
0 commit comments