Skip to content

Commit a11655b

Browse files
adding tests for files api and vector stores
Signed-off-by: Francisco Javier Arceo <[email protected]>
1 parent dfac988 commit a11655b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/integration/tool_runtime/test_rag_tool.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_vector_db_insert_from_url_and_query(
183183
assert any("llama2" in chunk.content.lower() for chunk in response2.chunks)
184184

185185

186-
def test_rag_tool_openai_api_integration(client_with_empty_registry, embedding_model_id, embedding_dimension):
186+
def test_rag_tool_openai_apis(client_with_empty_registry, embedding_model_id, embedding_dimension):
187187
vector_db_id = "test_openai_vector_db"
188188

189189
client_with_empty_registry.vector_dbs.register(
@@ -221,6 +221,16 @@ def test_rag_tool_openai_api_integration(client_with_empty_registry, embedding_m
221221
chunk_size_in_tokens=256,
222222
)
223223

224+
files_list = client_with_empty_registry.files.list()
225+
assert len(files_list.data) >= len(documents), (
226+
f"Expected at least {len(documents)} files, got {len(files_list.data)}"
227+
)
228+
229+
vector_store_files = client_with_empty_registry.vector_io.openai_list_files_in_vector_store(
230+
vector_store_id=actual_vector_db_id
231+
)
232+
assert len(vector_store_files.data) >= len(documents), f"Expected at least {len(documents)} files in vector store"
233+
224234
response = client_with_empty_registry.tool_runtime.rag_tool.query(
225235
vector_db_ids=[actual_vector_db_id],
226236
content="Tell me about machine learning and deep learning",
@@ -231,8 +241,8 @@ def test_rag_tool_openai_api_integration(client_with_empty_registry, embedding_m
231241
assert "machine learning" in content_text or "deep learning" in content_text
232242

233243

234-
def test_rag_tool_error_resilience(client_with_empty_registry, embedding_model_id, embedding_dimension):
235-
vector_db_id = "test_error_resilience"
244+
def test_rag_tool_exception_handling(client_with_empty_registry, embedding_model_id, embedding_dimension):
245+
vector_db_id = "test_exception_handling"
236246

237247
client_with_empty_registry.vector_dbs.register(
238248
vector_db_id=vector_db_id,

0 commit comments

Comments
 (0)