You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -188,7 +196,7 @@ The following code snippet shows how to use ``OpenSearchVectorSearch`` with envi
188
196
.. admonition:: Deployment
189
197
:class: note
190
198
191
-
During deployment, it is very important that you remember to pass in those environment variables as well:
199
+
During deployment, it is very important that you remember to pass in those environment variables as well or retrieve them from the Vault in score.py which is recommended and more secure:
192
200
193
201
.. code-block:: python3
194
202
@@ -206,9 +214,13 @@ Here is an example code snippet for deployment of Retrieval QA using OpenSearch
206
214
207
215
.. code-block:: python3
208
216
209
-
from langchain.vectorstores import OpenSearchVectorSearch
210
217
from ads.llm import GenerativeAIEmbeddings, GenerativeAI
218
+
from ads.llm.deploy import ChainDeployment
219
+
from langchain.chains import RetrievalQA
220
+
from langchain.vectorstores import OpenSearchVectorSearch
221
+
211
222
import ads
223
+
import os
212
224
213
225
ads.set_auth("resource_principal")
214
226
@@ -221,8 +233,7 @@ Here is an example code snippet for deployment of Retrieval QA using OpenSearch
221
233
compartment_id="ocid1.compartment.####",
222
234
client_kwargs=dict(service_endpoint="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com") # this can be omitted after Generative AI service is GA.
223
235
)
224
-
225
-
import os
236
+
# Saving the credentials as environment variables is not recommended. You should save them in Vault instead in prod.
0 commit comments