15
15
from __future__ import annotations
16
16
17
17
import logging
18
+ import warnings
18
19
from typing import Any , Optional
19
20
20
21
from pydantic import ValidationError
@@ -84,12 +85,18 @@ def search(
84
85
query_text : str = "" ,
85
86
examples : str = "" ,
86
87
retriever_config : Optional [dict [str , Any ]] = None ,
87
- return_context : bool = False ,
88
+ return_context : bool | None = None ,
88
89
) -> 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
+
93
100
94
101
Args:
95
102
query_text (str): The user question
@@ -102,6 +109,12 @@ def search(
102
109
RagResultModel: The LLM-generated answer
103
110
104
111
"""
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
105
118
try :
106
119
validated_data = RagSearchModel (
107
120
query_text = query_text ,
0 commit comments