From fe49cc5fa11b6f9eb8099de0a51555361889fb19 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 12 Aug 2025 11:10:35 +0800 Subject: [PATCH] Update collection tests to reflect new embedding provider configuration - Modified test cases for CreateCollection, RemoveCollection, and CollectionIntegration to use the new embedding provider and option values. - Removed outdated fields related to the previous embedding model and added locale support for provider reading. - Ensured consistency in the configuration structure across all relevant tests. --- openapi/tests/kb/collection_test.go | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/openapi/tests/kb/collection_test.go b/openapi/tests/kb/collection_test.go index a8980239..5d0055b2 100644 --- a/openapi/tests/kb/collection_test.go +++ b/openapi/tests/kb/collection_test.go @@ -45,13 +45,11 @@ func TestCreateCollection(t *testing.T) { "created_by": "test_user", }, "config": map[string]interface{}{ - "collection_name": testCollectionID + "_vector", // Required: collection name - "embedding_model": "text-embedding-ada-002", - "chunk_size": 1000, - "chunk_overlap": 200, - "index_type": "hnsw", // Required: valid index type - "distance": "cosine", // Required: distance metric - "dimension": 1536, // Required: embedding dimensions (note: singular not plural) + "embedding_provider": "__yao.openai", // Required: embedding provider ID + "embedding_option": "text-embedding-3-small", // Required: embedding option value + "locale": "en", // Optional: locale for provider reading + "index_type": "hnsw", // Required: valid index type + "distance": "cosine", // Required: distance metric }, } @@ -171,11 +169,11 @@ func TestRemoveCollection(t *testing.T) { "category": "test_remove", }, "config": map[string]interface{}{ - "collection_name": testCollectionID + "_vector", - "embedding_model": "text-embedding-ada-002", - "index_type": "hnsw", - "distance": "cosine", - "dimension": 1536, + "embedding_provider": "__yao.openai", // Required: embedding provider ID + "embedding_option": "text-embedding-3-small", // Required: embedding option value + "locale": "en", // Optional: locale for provider reading + "index_type": "hnsw", // Required: valid index type + "distance": "cosine", // Required: distance metric }, } @@ -503,13 +501,11 @@ func TestCollectionIntegration(t *testing.T) { "purpose": "full_lifecycle_test", }, "config": map[string]interface{}{ - "collection_name": testCollectionID + "_vector", - "embedding_model": "text-embedding-ada-002", - "chunk_size": 1000, - "chunk_overlap": 200, - "index_type": "hnsw", - "distance": "cosine", - "dimension": 1536, + "embedding_provider": "__yao.openai", // Required: embedding provider ID + "embedding_option": "text-embedding-3-small", // Required: embedding option value + "locale": "en", // Optional: locale for provider reading + "index_type": "hnsw", // Required: valid index type + "distance": "cosine", // Required: distance metric }, }