@@ -87,6 +87,16 @@ def openai_gpt4_llm():
87
87
}
88
88
89
89
90
+ @pytest .fixture
91
+ def openai_gpt4o_llm ():
92
+ model = "gpt-4o"
93
+
94
+ return {
95
+ "llm" : _chat_openai (model = model , streaming = False ),
96
+ "nemo_config" : {"engine" : "openai" , "model" : model },
97
+ }
98
+
99
+
90
100
def _openai_embeddings (** kwargs ) -> callable :
91
101
return lambda : OpenAIEmbeddings (
92
102
openai_api_key = get_required_env ("OPENAI_API_KEY" ), ** kwargs
@@ -108,6 +118,22 @@ def openai_3large_embedding():
108
118
return _openai_embeddings (model = "text-embedding-3-large" )
109
119
110
120
121
+ @pytest .fixture
122
+ def astra_vectorize_openai_small ():
123
+ def call ():
124
+ from astrapy .info import CollectionVectorServiceOptions
125
+
126
+ return {
127
+ "collection_vector_service_options" : CollectionVectorServiceOptions (
128
+ provider = "openai" ,
129
+ model_name = "text-embedding-3-small" ,
130
+ ),
131
+ "collection_embedding_api_key" : get_required_env ("OPENAI_API_KEY" ),
132
+ }
133
+
134
+ return call
135
+
136
+
111
137
@pytest .fixture
112
138
def azure_openai_gpt35turbo_llm ():
113
139
# model is configurable because it can be different from the deployment
@@ -221,31 +247,30 @@ def huggingface_hub_flant5xxl_llm():
221
247
222
248
@pytest .fixture
223
249
def huggingface_hub_minilml6v2_embedding ():
224
-
225
250
return lambda : HuggingFaceInferenceAPIEmbeddings (
226
251
api_key = get_required_env ("HUGGINGFACE_HUB_KEY" ),
227
252
model_name = "sentence-transformers/all-MiniLM-l6-v2" ,
228
253
)
229
254
230
255
231
256
@pytest .fixture
232
- def nvidia_aifoundation_nvolveqa40k_embedding ():
257
+ def nvidia_aifoundation_embedqa4_embedding ():
233
258
def embedding ():
234
259
get_required_env ("NVIDIA_API_KEY" )
235
260
from langchain_nvidia_ai_endpoints .embeddings import NVIDIAEmbeddings
236
261
237
- return NVIDIAEmbeddings (model = "playground_nvolveqa_40k " )
262
+ return NVIDIAEmbeddings (model = "ai-embed-qa-4 " )
238
263
239
264
return embedding
240
265
241
266
242
267
@pytest .fixture
243
- def nvidia_aifoundation_mixtral8x7b_llm ():
268
+ def nvidia_aifoundation_mistral_llm ():
244
269
def llm ():
245
270
get_required_env ("NVIDIA_API_KEY" )
246
271
from langchain_nvidia_ai_endpoints import ChatNVIDIA
247
272
248
- return ChatNVIDIA (model = "playground_mixtral_8x7b " )
273
+ return ChatNVIDIA (model = "ai-mistral-large " )
249
274
250
275
return {"llm" : llm , "nemo_config" : None }
251
276
@@ -264,15 +289,16 @@ def llm():
264
289
("openai_ada002_embedding" , "openai_gpt35turbo_llm" ),
265
290
("openai_3large_embedding" , "openai_gpt35turbo_llm_streaming" ),
266
291
("openai_3small_embedding" , "openai_gpt4_llm" ),
292
+ ("astra_vectorize_openai_small" , "openai_gpt4o_llm" ),
267
293
("azure_openai_ada002_embedding" , "azure_openai_gpt35turbo_llm" ),
268
294
("vertex_gecko_embedding" , "vertex_bison_llm" ),
269
295
("bedrock_titan_embedding" , "bedrock_anthropic_claudev2_llm" ),
270
296
("bedrock_cohere_embedding" , "bedrock_mistral_mistral7b_llm" ),
271
297
("bedrock_cohere_embedding" , "bedrock_meta_llama2_llm" ),
272
298
# ("huggingface_hub_minilml6v2_embedding", "huggingface_hub_flant5xxl_llm"),
273
299
(
274
- "nvidia_aifoundation_nvolveqa40k_embedding " ,
275
- "nvidia_aifoundation_mixtral8x7b_llm " ,
300
+ "nvidia_aifoundation_embedqa4_embedding " ,
301
+ "nvidia_aifoundation_mistral_llm " ,
276
302
),
277
303
],
278
304
)
@@ -304,8 +330,15 @@ def _run_test(
304
330
if test_case == "nemo_guardrails" and not resolved_llm ["nemo_config" ]:
305
331
skip_test_due_to_implementation_not_supported ("nemo_guardrails" )
306
332
333
+ embedding = embedding_fn ()
334
+ vector_store_kwargs = {}
335
+ if isinstance (embedding , dict ):
336
+ vector_store_kwargs = embedding
337
+ else :
338
+ vector_store_kwargs ["embedding" ] = embedding
339
+
307
340
vector_store = vector_store_context .new_langchain_vector_store (
308
- embedding = embedding_fn ()
341
+ ** vector_store_kwargs
309
342
)
310
343
llm = resolved_llm ["llm" ]() # llm is a callable
311
344
0 commit comments