RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Refa: Test configs (#8220)
Liu An86a1411b07f0
diff --git a/test/testcases/test_http_api/common.py b/test/testcases/test_http_api/common.pyindex 4e7ec256f4..123fb76673 100644--- a/test/testcases/test_http_api/common.py+++ b/test/testcases/test_http_api/common.py@@ -14,15 +14,14 @@# limitations under the License.#-import osfrom pathlib import Pathimport requests+from configs import HOST_ADDRESSfrom requests_toolbelt import MultipartEncoderfrom utils.file_utils import create_txt_fileHEADERS = {"Content-Type": "application/json"}-HOST_ADDRESS = os.getenv("HOST_ADDRESS", "http://127.0.0.1:9380")DATASETS_API_URL = "/api/v1/datasets"FILE_API_URL = "/api/v1/datasets/{dataset_id}/documents"FILE_CHUNK_API_URL = "/api/v1/datasets/{dataset_id}/chunks"@@ -31,12 +30,6 @@ CHAT_ASSISTANT_API_URL = "/api/v1/chats"SESSION_WITH_CHAT_ASSISTANT_API_URL = "/api/v1/chats/{chat_id}/sessions"SESSION_WITH_AGENT_API_URL = "/api/v1/agents/{agent_id}/sessions"-INVALID_API_TOKEN = "invalid_key_123"-DATASET_NAME_LIMIT = 128-DOCUMENT_NAME_LIMIT = 128-CHAT_ASSISTANT_NAME_LIMIT = 255-SESSION_WITH_CHAT_NAME_LIMIT = 255-# DATASET MANAGEMENTdef create_dataset(auth, payload=None, *, headers=HEADERS, data=None):diff --git a/test/testcases/test_http_api/test_chat_assistant_management/test_create_chat_assistant.py b/test/testcases/test_http_api/test_chat_assistant_management/test_create_chat_assistant.pyindex 7a1b693086..7e7d9c1161 100644--- a/test/testcases/test_http_api/test_chat_assistant_management/test_create_chat_assistant.py+++ b/test/testcases/test_http_api/test_chat_assistant_management/test_create_chat_assistant.py@@ -15,7 +15,8 @@#import pytest-from common import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN, create_chat_assistant+from common import create_chat_assistant+from configs import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import encode_avatarfrom utils.file_utils import create_image_filediff --git a/test/testcases/test_http_api/test_chat_assistant_management/test_delete_chat_assistants.py b/test/testcases/test_http_api/test_chat_assistant_management/test_delete_chat_assistants.pyindex c36a7c0291..2a2fdc9a6a 100644--- a/test/testcases/test_http_api/test_chat_assistant_management/test_delete_chat_assistants.py+++ b/test/testcases/test_http_api/test_chat_assistant_management/test_delete_chat_assistants.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, batch_create_chat_assistants, delete_chat_assistants, list_chat_assistants+from common import batch_create_chat_assistants, delete_chat_assistants, list_chat_assistants+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_chat_assistant_management/test_list_chat_assistants.py b/test/testcases/test_http_api/test_chat_assistant_management/test_list_chat_assistants.pyindex ad03fa5422..20bce689ee 100644--- a/test/testcases/test_http_api/test_chat_assistant_management/test_list_chat_assistants.py+++ b/test/testcases/test_http_api/test_chat_assistant_management/test_list_chat_assistants.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, delete_datasets, list_chat_assistants+from common import delete_datasets, list_chat_assistants+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import is_sorteddiff --git a/test/testcases/test_http_api/test_chat_assistant_management/test_update_chat_assistant.py b/test/testcases/test_http_api/test_chat_assistant_management/test_update_chat_assistant.pyindex 003e714842..54a1613193 100644--- a/test/testcases/test_http_api/test_chat_assistant_management/test_update_chat_assistant.py+++ b/test/testcases/test_http_api/test_chat_assistant_management/test_update_chat_assistant.py@@ -14,7 +14,8 @@# limitations under the License.#import pytest-from common import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN, list_chat_assistants, update_chat_assistant+from common import list_chat_assistants, update_chat_assistant+from configs import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import encode_avatarfrom utils.file_utils import create_image_filediff --git a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_add_chunk.py b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_add_chunk.pyindex ab4739f0b3..d46469d91c 100644--- a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_add_chunk.py+++ b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_add_chunk.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, add_chunk, delete_documents, list_chunks+from common import add_chunk, delete_documents, list_chunks+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_delete_chunks.py b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_delete_chunks.pyindex 275632b39f..69f1744e28 100644--- a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_delete_chunks.py+++ b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_delete_chunks.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, batch_add_chunks, delete_chunks, list_chunks+from common import batch_add_chunks, delete_chunks, list_chunks+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_list_chunks.py b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_list_chunks.pyindex ac7577190a..c8134214c7 100644--- a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_list_chunks.py+++ b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_list_chunks.py@@ -17,7 +17,8 @@ import osfrom concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, batch_add_chunks, list_chunks+from common import batch_add_chunks, list_chunks+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_retrieval_chunks.py b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_retrieval_chunks.pyindex 9f35f7f1da..52421d5b16 100644--- a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_retrieval_chunks.py+++ b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_retrieval_chunks.py@@ -17,10 +17,8 @@ import osfrom concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import (- INVALID_API_TOKEN,- retrieval_chunks,-)+from common import retrieval_chunks+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_update_chunk.py b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_update_chunk.pyindex 3e2b86c13a..d6d0278fee 100644--- a/test/testcases/test_http_api/test_chunk_management_within_dataset/test_update_chunk.py+++ b/test/testcases/test_http_api/test_chunk_management_within_dataset/test_update_chunk.py@@ -18,7 +18,8 @@ from concurrent.futures import ThreadPoolExecutor, as_completedfrom random import randintimport pytest-from common import INVALID_API_TOKEN, delete_documents, update_chunk+from common import delete_documents, update_chunk+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_dataset_mangement/test_delete_datasets.py b/test/testcases/test_http_api/test_dataset_mangement/test_delete_datasets.pyindex ae7189cc82..0165633bcb 100644--- a/test/testcases/test_http_api/test_dataset_mangement/test_delete_datasets.py+++ b/test/testcases/test_http_api/test_dataset_mangement/test_delete_datasets.py@@ -18,11 +18,11 @@ from concurrent.futures import ThreadPoolExecutor, as_completedimport pytestfrom common import (- INVALID_API_TOKEN,batch_create_datasets,delete_datasets,list_datasets,)+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_dataset_mangement/test_list_datasets.py b/test/testcases/test_http_api/test_dataset_mangement/test_list_datasets.pyindex 8ce0edad14..9d81491b4b 100644--- a/test/testcases/test_http_api/test_dataset_mangement/test_list_datasets.py+++ b/test/testcases/test_http_api/test_dataset_mangement/test_list_datasets.py@@ -17,7 +17,8 @@ import uuidfrom concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, list_datasets+from common import list_datasets+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import is_sorteddiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_delete_documents.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_delete_documents.pyindex 23a54e3cda..74f5c06063 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_delete_documents.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_delete_documents.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, bulk_upload_documents, delete_documents, list_documents+from common import bulk_upload_documents, delete_documents, list_documents+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_download_document.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_download_document.pyindex 843f607376..2d04ae5319 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_download_document.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_download_document.py@@ -18,7 +18,8 @@ import jsonfrom concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, bulk_upload_documents, download_document, upload_documents+from common import bulk_upload_documents, download_document, upload_documents+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom requests import codesfrom utils import compare_by_hashdiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_list_documents.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_list_documents.pyindex 6e62554f3a..4fbe59b0bd 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_list_documents.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_list_documents.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, list_documents+from common import list_documents+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import is_sorteddiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_parse_documents.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_parse_documents.pyindex 0a5b218992..e8ffa914ed 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_parse_documents.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_parse_documents.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, bulk_upload_documents, list_documents, parse_documents+from common import bulk_upload_documents, list_documents, parse_documents+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import wait_fordiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_stop_parse_documents.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_stop_parse_documents.pyindex b981507185..4c32448789 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_stop_parse_documents.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_stop_parse_documents.py@@ -17,7 +17,8 @@ from concurrent.futures import ThreadPoolExecutorfrom time import sleepimport pytest-from common import INVALID_API_TOKEN, bulk_upload_documents, list_documents, parse_documents, stop_parse_documents+from common import bulk_upload_documents, list_documents, parse_documents, stop_parse_documents+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import wait_fordiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_update_document.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_update_document.pyindex cb28cf5aa2..3e21f518a2 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_update_document.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_update_document.py@@ -16,7 +16,8 @@import pytest-from common import DOCUMENT_NAME_LIMIT, INVALID_API_TOKEN, list_documents, update_document+from common import list_documents, update_document+from configs import DOCUMENT_NAME_LIMIT, INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_file_management_within_dataset/test_upload_documents.py b/test/testcases/test_http_api/test_file_management_within_dataset/test_upload_documents.pyindex 681026d1e9..cbb6285f90 100644--- a/test/testcases/test_http_api/test_file_management_within_dataset/test_upload_documents.py+++ b/test/testcases/test_http_api/test_file_management_within_dataset/test_upload_documents.py@@ -19,7 +19,8 @@ from concurrent.futures import ThreadPoolExecutor, as_completedimport pytestimport requests-from common import DOCUMENT_NAME_LIMIT, FILE_API_URL, HOST_ADDRESS, INVALID_API_TOKEN, list_datasets, upload_documents+from common import FILE_API_URL, list_datasets, upload_documents+from configs import DOCUMENT_NAME_LIMIT, HOST_ADDRESS, INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom requests_toolbelt import MultipartEncoderfrom utils.file_utils import create_txt_filediff --git a/test/testcases/test_http_api/test_session_management/test_create_session_with_chat_assistant.py b/test/testcases/test_http_api/test_session_management/test_create_session_with_chat_assistant.pyindex d5701e7a14..322fd1b7a7 100644--- a/test/testcases/test_http_api/test_session_management/test_create_session_with_chat_assistant.py+++ b/test/testcases/test_http_api/test_session_management/test_create_session_with_chat_assistant.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, SESSION_WITH_CHAT_NAME_LIMIT, create_session_with_chat_assistant, delete_chat_assistants, list_session_with_chat_assistants+from common import create_session_with_chat_assistant, delete_chat_assistants, list_session_with_chat_assistants+from configs import INVALID_API_TOKEN, SESSION_WITH_CHAT_NAME_LIMITfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_session_management/test_delete_sessions_with_chat_assistant.py b/test/testcases/test_http_api/test_session_management/test_delete_sessions_with_chat_assistant.pyindex 25a4f531f8..818050819b 100644--- a/test/testcases/test_http_api/test_session_management/test_delete_sessions_with_chat_assistant.py+++ b/test/testcases/test_http_api/test_session_management/test_delete_sessions_with_chat_assistant.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, batch_add_sessions_with_chat_assistant, delete_session_with_chat_assistants, list_session_with_chat_assistants+from common import batch_add_sessions_with_chat_assistant, delete_session_with_chat_assistants, list_session_with_chat_assistants+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthdiff --git a/test/testcases/test_http_api/test_session_management/test_list_sessions_with_chat_assistant.py b/test/testcases/test_http_api/test_session_management/test_list_sessions_with_chat_assistant.pyindex 8ee95b6dc8..5ff29e022e 100644--- a/test/testcases/test_http_api/test_session_management/test_list_sessions_with_chat_assistant.py+++ b/test/testcases/test_http_api/test_session_management/test_list_sessions_with_chat_assistant.py@@ -16,7 +16,8 @@from concurrent.futures import ThreadPoolExecutor, as_completedimport pytest-from common import INVALID_API_TOKEN, delete_chat_assistants, list_session_with_chat_assistants+from common import delete_chat_assistants, list_session_with_chat_assistants+from configs import INVALID_API_TOKENfrom libs.auth import RAGFlowHttpApiAuthfrom utils import is_sorteddiff --git a/test/testcases/test_http_api/test_session_management/test_update_session_with_chat_assistant.py b/test/testcases/test_http_api/test_session_management/test_update_session_with_chat_assistant.pyindex d6693b4745..e035e876b5 100644--- a/test/testcases/test_http_api/test_session_management/test_update_session_with_chat_assistant.py+++ b/test/testcases/test_http_api/test_session_management/test_update_session_with_chat_assistant.py@@ -17,7 +17,8 @@ from concurrent.futures import ThreadPoolExecutor, as_completedfrom random import randintimport pytest-from common import INVALID_API_TOKEN, SESSION_WITH_CHAT_NAME_LIMIT, delete_chat_assistants, list_session_with_chat_assistants, update_session_with_chat_assistant+from common import delete_chat_assistants, list_session_with_chat_assistants, update_session_with_chat_assistant+from configs import INVALID_API_TOKEN, SESSION_WITH_CHAT_NAME_LIMITfrom libs.auth import RAGFlowHttpApiAuth