1515from __future__ import annotations
1616
1717import logging
18+ import warnings
1819from typing import Any , Optional
1920
2021from pydantic import ValidationError
@@ -84,12 +85,18 @@ def search(
8485 query_text : str = "" ,
8586 examples : str = "" ,
8687 retriever_config : Optional [dict [str , Any ]] = None ,
87- return_context : bool = False ,
88+ return_context : bool | None = None ,
8889 ) -> RagResultModel :
89- """This method performs a full RAG search:
90- 1. Retrieval: context retrieval
91- 2. Augmentation: prompt formatting
92- 3. Generation: answer generation with LLM
90+ """
91+ .. warning::
92+ The default value of 'return_context' will change from 'False' to 'True' in a future version.
93+
94+
95+ This method performs a full RAG search:
96+ 1. Retrieval: context retrieval
97+ 2. Augmentation: prompt formatting
98+ 3. Generation: answer generation with LLM
99+
93100
94101 Args:
95102 query_text (str): The user question
@@ -102,6 +109,12 @@ def search(
102109 RagResultModel: The LLM-generated answer
103110
104111 """
112+ if return_context is None :
113+ warnings .warn (
114+ "The default value of 'return_context' will change from 'False' to 'True' in a future version." ,
115+ DeprecationWarning ,
116+ )
117+ return_context = False
105118 try :
106119 validated_data = RagSearchModel (
107120 query_text = query_text ,
0 commit comments