diff --git a/evals/evaluation/rag_pilot/README.md b/evals/evaluation/rag_pilot/README.md index 3a9dc1ce..6006f6bf 100644 --- a/evals/evaluation/rag_pilot/README.md +++ b/evals/evaluation/rag_pilot/README.md @@ -4,20 +4,6 @@ RAG Pilot provides a set of tuners to optimize various parameters in a retrieval-augmented generation (RAG) pipeline. Each tuner allows fine-grained control over key aspects of parsing, chunking, postporcessing, and generating selection, enabling better retrieval and response generation. -### 🧠 Available Tuners - -| Tuner | Stage | Function | Configuration | -|---|---|---|---| -| **EmbeddingTuner** | Retrieval | Tune embedding model and related parameters | Allows selection and configuration of the embedding model used for vectorization, including model name and optional parameters like dimension or backend. | -| **NodeParserTuner** | Retrieval | Tune node parser parameters | General tuner for configuring node parsers, possibly extending to custom strategies or pre-processing logic. | -| **SimpleNodeParserChunkTuner** | Retrieval | Tune `SentenceSplitter`'s `chunk_size` and `chunk_overlap` | Configures chunking behavior for document parsing by adjusting the size of individual text chunks and their overlap to ensure context retention. | -| **RetrievalTopkTuner** | Retrieval | Tune `top_k` for retriever | Adjusts how many documents are retrieved before reranking, balancing recall and performance. | -| **RerankerTopnTuner** | Postprocessing | Tune `top_n` for reranking | Adjusts the number of top-ranked documents returned after reranking, optimizing relevance and conciseness. | - - -These tuners help in optimizing document parsing, chunking strategies, reranking efficiency, and embedding selection for improved RAG performance. - - ## 🌐 Quickstart Guide ### ⚙️ Dependencies and Environment Setup @@ -31,12 +17,14 @@ Load documents in EdgeCraftRAG before running RAG Pilot. #### Setup RAG Pilot ```bash -cd rag_pilot -# (Optional) Build RAG Pilot and UI docker images +# Build RAG Pilot and UI docker images +cd rag_pilot docker build --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTP_PROXYS=$HTTP_PROXYS --build-arg NO_PROXY=$NO_PROXY -t opea/ragpilot:latest -f ./Dockerfile . docker build --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTP_PROXYS=$HTTP_PROXYS --build-arg NO_PROXY=$NO_PROXY -t opea/ragpilot-ui:latest -f ./ui/Dockerfile.ui . - +# Or build docker images by build.sh +cd ./rag_pilot/docker_image_build +docker compose -f build.yaml build # Setup ENV export ECRAG_SERVICE_HOST_IP=${HOST_IP} # HOST IP of EC-RAG Service, usually current host ip @@ -49,205 +37,10 @@ export ECRAG_SERVICE_HOST_IP=${HOST_IP} # HOST IP of EC-RAG Service, usually cur # If you want to change exposed RAG Pilot service port #export RAGPILOT_SERVICE_PORT= +#Start RAG Pilor server +cd ./rag_pilot docker compose -f docker_compose/intel/gpu/arc/compose.yaml up -d ``` -### 🚦 Launch RAG Pilot in Online Mode - -To launch RAG Pilot, create the following *required files* before running the command: - -#### 🔹Input file: QA List File (`your_queries.csv`) - -The input CSV file should contain queries and associated ground truth data (optional) used for evaluation or tuning. Each row corresponds to a specific query and context file. The CSV must include the following **columns**: - -| Column | Required | Description | -|--------|----------|-------------| -| `query_id` | ✅ Yes | Unique identifier for the query. Can be used to group multiple context entries under the same query. | -| `query` | ✅ Yes (at least one per `query_id`) | The actual query string. If left empty for some rows sharing the same `query_id`, the query from the first row with a non-empty value will be used. | -| `file_name` | ✅ Yes | The name of the file or document where the context (for retrieval or grounding) is drawn from. | -| `gt_context` | ✅ Yes | The ground truth context string that should be retrieved or matched against. | -| `ground_truth` | ❌ Optional | The ideal answer or response for the query, used for optional answer-level evaluation. | - -##### 📌 CSV File Example - -```csv -query_id,query,file_name,gt_context,ground_truth -53,故障来源有哪些?,故障处理记录表.txt,故障来源:用户投诉、日志系统、例行维护中发现、其它来源。,故障来源:用户投诉、日志系统、例行维护中发现、其它来源。 -93,uMAC网元VNFC有哪几种备份方式,index.txt,ZUF-76-04-005 VNFC支持1+1主备冗余,uMAC网元VFNC有3中备份方式: 支持1+1主备冗余,支持N+M负荷分担冗余, 支持1+1互备冗余。 -93,,index.txt,ZUF-76-04-006 VNFC支持N+M负荷分担冗余, -93,,index.txt,ZUF-76-04-008 VNFC支持1+1互备冗余, -``` - -#### ▶️ Run RAG Pilot - -Run the following command to start the tuning process. - -```bash -# Run pipeline tuning tool -export ECRAG_SERVICE_HOST_IP="ecrag_host_ip" -python3 -m run_pilot -q "your_queries.csv" -``` - -#### 📦 Output Files and Structure - -Each tuning run in **RAG Pilot** generates a set of structured output files for analyzing and comparing different RAG pipeline configurations. - -##### 📁 Directory Layout - -- `rag_pilot_/`: Main folder for a tuning session. - - `summary.csv` – Overall performance metrics of all executed pipelines. - - `curr_pipeline.json` – Best pipeline configuration. - - `curr_rag_results.json` – Results of the best pipeline. - - `rag_summary.csv` – Query-wise summary. - - `rag_contexts.csv` – Detailed context analysis. - - `entry_/`: Subfolders for each tried pipeline with the same file structure: - - `pipeline.json` - - `rag_results.json` - - `rag_summary.csv` - - `rag_contexts.csv` - -##### 🗂️ Output File Overview - -| File Name | Description | -|----------------------|-----------------------------------------------------------------------------| -| `summary.csv` | Aggregated summary across all pipelines | -| `pipeline.json` | RAG pipeline configuration used in a specific trial | -| `rag_results.json` | List of results for each query, including metadata and context sets | -| `rag_summary.csv` | Summary of each query's outcome, including response and context hit counts | -| `rag_contexts.csv` | Breakdown of retrieved/reranked contexts and mapping to ground truth | - -**Context Mapping Notes:** - -- Contexts are categorized as `gt_contexts`, `retrieval_contexts`, or `postprocessing_contexts`. -- Mappings track which retrieved or postprocessed contexts hit the ground truth. -- Each context is associated with a `query_id` and indexed for traceability. - - -## 📴 Offline RAG Tuning - -RAG Pilot supports offline mode using a RAG configuration file. - -### ⚙️ Environment Setup - -Refer to [Create Running Environment](#create-running-environment) in the Online RAG pipeline tuning section for setting up the environment before proceeding. - -### 🚦 Launch RAG Pilot in Offline Mode - -To be added in later release - - -## 🔧 How to Adjust RAG Pilot to Tune Your RAG Solution - -### 🧩 What's Nodes and Modules - -RAG Pilot represents each stage of the RAG pipeline as a **node**, such as `node_parser`, `indexer`, `retriever`, etc. Each node can have different **modules** that define its type and configuration. The nodes and modules are specified in a YAML file, allowing users to switch between different implementations easily. - -Here is an example of nodes and modules for EdgeCraftRAG. - -![RAG Pilot Architecture](RAG_Pilot.png) - -### ⚙️ How to Configure Nodes and Modules - -The available nodes and their modules are stored in a YAML file (i.e. `configs/ecrag.yaml` for EdgeCraftRAG as below). Each node can have multiple modules, and both nodes and modules have configurable parameters that can be tuned. - -```yaml -nodes: - - node: node_parser - modules: - - module_type: simple - chunk_size: 400 - chunk_overlap: 48 - - module_type: hierarchical - chunk_sizes: - - 256 - - 384 - - 512 - - node: indexer - embedding_model: - - BAAI/bge-small-zh-v1.5 - - BAAI/bge-small-en-v1.5 - modules: - - module_type: vector - - module_type: faiss_vector - - node: retriever - retrieve_topk: 30 - modules: - - module_type: vectorsimilarity - - module_type: auto_merge - - module_type: bm25 - - node: postprocessor - modules: - - module_type: reranker - top_n: 3 - reranker_model: BAAI/bge-reranker-large - - module_type: metadata_replace - - node: generator - model: - - Qwen/Qwen2-7B-Instruct - inference_type: - - local - - vllm - prompt: null -``` - -1. **Each Node Can Have Multiple Modules** - - A node represents a stage in the RAG pipeline, such as `node_parser`, `indexer`, or `retriever`. - - Each node can support different modules that define how it operates. For example, the `node_parser` node can use either a `simple` or `hierarchical` module. - -2. **Nodes Have Parameters to Tune** - - Some nodes have global parameters that affect all modules within them. For instance, the `retriever` node has a `retrieve_topk` parameter that defines how many top results are retrieved. - -3. **Modules Have Parameters to Tune** - - Each module within a node can have its own parameters. For example, the `simple` parser module has `chunk_size` and `chunk_overlap` parameters, while the `hierarchical` parser module supports multiple `chunk_sizes`. - -4. **Each Node Selects Its Module Based on a Type Map** - - The tool uses an internal mapping to associate each module type with its corresponding function. The type of module selected for each node is defined in a mapping system like the one below: - - ```python - COMP_TYPE_MAP = { - "node_parser": "parser_type", - "indexer": "indexer_type", - "retriever": "retriever_type", - "postprocessor": "processor_type", - "generator": "inference_type", - } - ``` - -### 🧑‍💻 How to Use Nodes and Modules - -Besides the YAML configuration file, the tool also uses a module map to associate each module with a runnable instance. This ensures that the tool correctly links each module type to its respective function within the pipeline. - -#### 🧾 Example: Mapping Modules to Functions -The function below defines how different module types are mapped to their respective components in EdgeCraftRAG: - -```python -def get_ecrag_module_map(ecrag_pl): - ecrag_modules = { - # root - "root": (ecrag_pl, ""), - # node_parser - "node_parser": (ecrag_pl, "node_parser"), - "simple": (ecrag_pl, "node_parser"), - "hierarchical": (ecrag_pl, "node_parser"), - "sentencewindow": (ecrag_pl, "node_parser"), - # indexer - "indexer": (ecrag_pl, "indexer"), - "vector": (ecrag_pl, "indexer"), - "faiss_vector": (ecrag_pl, "indexer"), - # retriever - "retriever": (ecrag_pl, "retriever"), - "vectorsimilarity": (ecrag_pl, "retriever"), - "auto_merge": (ecrag_pl, "retriever"), - "bm25": (ecrag_pl, "retriever"), - # postprocessor - "postprocessor": (ecrag_pl, "postprocessor[0]"), - "reranker": (ecrag_pl, "postprocessor[0]"), - "metadata_replace": (ecrag_pl, "postprocessor[0]"), - # generator - "generator": (ecrag_pl, "generator"), - } - return ecrag_modules -``` - -By modifying the YAML configuration file and understanding how modules are mapped to functions, you can experiment with different configurations and parameter settings to optimize their RAG pipeline effectively. +About how to use RAG Pilot and more details, please refer to this [doc](./docs/Detail_Guide.md) for details. diff --git a/evals/evaluation/rag_pilot/VERSION b/evals/evaluation/rag_pilot/VERSION index e0ecd517..59d3fe04 100644 --- a/evals/evaluation/rag_pilot/VERSION +++ b/evals/evaluation/rag_pilot/VERSION @@ -1 +1 @@ -25.05-dev +25.07-dev diff --git a/evals/evaluation/rag_pilot/api/v1/pilot.py b/evals/evaluation/rag_pilot/api/v1/pilot.py index 34a17afc..31ef8c8b 100644 --- a/evals/evaluation/rag_pilot/api/v1/pilot.py +++ b/evals/evaluation/rag_pilot/api/v1/pilot.py @@ -182,6 +182,23 @@ async def run_pipeline_by_id(id: uuid.UUID): return f"Error: Pipeline {id} does not exist" +@pilot_app.post(path="/v1/pilot/pipeline/restore") +async def restore_pipeline(): + success = pilot.restore_curr_pl() + if success: + current_pl = pilot.get_curr_pl() + return { + "message": "Pipeline restored successfully", + "pipeline_id": str(current_pl.get_id()) if current_pl else None, + "restored_from": "EdgeCraftRAG active pipeline", + } + else: + raise HTTPException( + status_code=404, + detail="Failed to restore pipeline: No active pipeline found in EdgeCraftRAG service or restore operation failed", + ) + + @pilot_app.post(path="/v1/pilot/files") async def add_files(request: DataIn): ret = upload_files(request) diff --git a/evals/evaluation/rag_pilot/api/v1/tuner.py b/evals/evaluation/rag_pilot/api/v1/tuner.py index 38adb3d4..8714bc74 100644 --- a/evals/evaluation/rag_pilot/api/v1/tuner.py +++ b/evals/evaluation/rag_pilot/api/v1/tuner.py @@ -158,6 +158,21 @@ async def get_stage_pipelines(stage: RAGStage = Path(...)): return pipeline_list +@tuner_app.get(path="/v1/tuners/stage/{stage}/pipelines/best/id") +async def get_stage_pipelines_best(stage: RAGStage = Path(...)): + tuner_names = tunerMgr.get_tuners_by_stage(stage) + pl_id_list = [] + for tuner_name in tuner_names: + record = tunerMgr.get_tuner_record(tuner_name) + if record is not None: + pl_id_list.extend(list(record.all_pipeline_ids)) + if record.base_pipeline_id not in pl_id_list: + pl_id_list.append(record.base_pipeline_id) + pl_id_list = list(set(pl_id_list)) + best_pl_id = get_best_pl_id(pl_id_list, stage) + return best_pl_id + + @tuner_app.get(path="/v1/tuners/{tuner_name}/pipelines/best") async def get_pipeline_best(tuner_name): record = tunerMgr.get_tuner_record(tuner_name) diff --git a/evals/evaluation/rag_pilot/components/pilot/base.py b/evals/evaluation/rag_pilot/components/pilot/base.py index 4fe58d63..9ecebbd7 100644 --- a/evals/evaluation/rag_pilot/components/pilot/base.py +++ b/evals/evaluation/rag_pilot/components/pilot/base.py @@ -180,9 +180,6 @@ def get_prompt(self) -> Optional[str]: def export_pipeline(self): self._restore_model_instances() exported_pl = copy.deepcopy(self.pl) - if hasattr(exported_pl, "generator") and exported_pl.generator: - if hasattr(exported_pl.generator, "prompt_content"): - delattr(exported_pl.generator, "prompt_content") self._replace_model_with_id() return exported_pl @@ -372,7 +369,16 @@ class RAGResults(BaseModel): finished: bool = False def add_result(self, result): - self.results.append(result) + # if result.query_id has appear in self.results, then update the result,else append the results + updated_existing = False + if result.query_id is not None: + for idx, r in enumerate(self.results): + if r.query_id == result.query_id: + self.results[idx] = result + updated_existing = True + break + if not updated_existing: + self.results.append(result) self.cal_metadata() def cal_recall(self): @@ -418,7 +424,7 @@ def get_metrics(self): return self.metadata or {} def get_metric(self, metric: Metrics, default=float("-inf")): - return self.metadata.get(metric.value, default) + return (self.metadata or {}).get(metric.value, default) def update_result_metrics(self, query_id: int, metrics: Dict[str, Union[float, int]]): updated = False diff --git a/evals/evaluation/rag_pilot/components/pilot/ecrag/api_schema.py b/evals/evaluation/rag_pilot/components/pilot/ecrag/api_schema.py index 66b12a43..d7ae1c84 100644 --- a/evals/evaluation/rag_pilot/components/pilot/ecrag/api_schema.py +++ b/evals/evaluation/rag_pilot/components/pilot/ecrag/api_schema.py @@ -25,6 +25,7 @@ class NodeParserIn(BaseModel): class IndexerIn(BaseModel): indexer_type: str embedding_model: Optional[ModelIn] = None + vector_uri: Optional[str] = None class RetrieverIn(BaseModel): @@ -43,6 +44,7 @@ class GeneratorIn(BaseModel): prompt_content: Optional[str] = None model: Optional[ModelIn] = None inference_type: Optional[str] = "local" + vllm_endpoint: Optional[str] = None class PipelineCreateIn(BaseModel): @@ -78,3 +80,7 @@ class KnowledgeBaseCreateIn(BaseModel): name: str description: Optional[str] = None active: Optional[bool] = None + + +class MilvusConnectRequest(BaseModel): + vector_uri: str diff --git a/evals/evaluation/rag_pilot/components/pilot/ecrag/base.py b/evals/evaluation/rag_pilot/components/pilot/ecrag/base.py index 9eabf857..db1dc414 100644 --- a/evals/evaluation/rag_pilot/components/pilot/ecrag/base.py +++ b/evals/evaluation/rag_pilot/components/pilot/ecrag/base.py @@ -50,6 +50,7 @@ class IndexerType(str, Enum): FAISS_VECTOR = "faiss_vector" DEFAULT_VECTOR = "vector" + MILVUS_VECTOR = "milvus_vector" class RetrieverType(str, Enum): diff --git a/evals/evaluation/rag_pilot/components/pilot/pilot.py b/evals/evaluation/rag_pilot/components/pilot/pilot.py index 2a954f33..082037f2 100644 --- a/evals/evaluation/rag_pilot/components/pilot/pilot.py +++ b/evals/evaluation/rag_pilot/components/pilot/pilot.py @@ -185,6 +185,17 @@ def get_curr_pl(self): else: return None + def restore_curr_pl(self): + pilot.curr_pl_id = None + pl_raw = get_active_pipeline() + if pl_raw: + active_pl = RAGPipeline(pl_raw) + active_pl.regenerate_id() + pilot.add_rag_pipeline(active_pl) + return self.rag_pipeline_dict[self.curr_pl_id] + else: + return None + def get_curr_pl_id(self): if self.curr_pl_id: return self.curr_pl_id diff --git a/evals/evaluation/rag_pilot/docker_compose/intel/gpu/arc/compose.yaml b/evals/evaluation/rag_pilot/docker_compose/intel/gpu/arc/compose.yaml index 42a53ef5..f88373f5 100644 --- a/evals/evaluation/rag_pilot/docker_compose/intel/gpu/arc/compose.yaml +++ b/evals/evaluation/rag_pilot/docker_compose/intel/gpu/arc/compose.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 services: - ui: + ragpilot-ui: image: ${REGISTRY:-opea}/ragpilot-ui:${TAG:-latest} container_name: ragpilot-ui environment: diff --git a/evals/evaluation/rag_pilot/docker_image_build/build.yaml b/evals/evaluation/rag_pilot/docker_image_build/build.yaml index 9373155f..d3edf401 100644 --- a/evals/evaluation/rag_pilot/docker_image_build/build.yaml +++ b/evals/evaluation/rag_pilot/docker_image_build/build.yaml @@ -9,7 +9,7 @@ services: args: http_proxy: ${http_proxy} https_proxy: ${https_proxy} - dockerfile: ../ui/Dockerfile.ui + dockerfile: ./ui/Dockerfile.ui image: ${REGISTRY:-opea}/ragpilot-ui:${TAG:-latest} ragpilot: build: @@ -17,5 +17,5 @@ services: args: http_proxy: ${http_proxy} https_proxy: ${https_proxy} - dockerfile: ../Dockerfile + dockerfile: ./Dockerfile image: ${REGISTRY:-opea}/ragpilot:${TAG:-latest} diff --git a/evals/evaluation/rag_pilot/docs/Detail_Guide.md b/evals/evaluation/rag_pilot/docs/Detail_Guide.md new file mode 100644 index 00000000..561a1183 --- /dev/null +++ b/evals/evaluation/rag_pilot/docs/Detail_Guide.md @@ -0,0 +1,271 @@ +# 🚀 RAG Pilot - A RAG Pipeline Tuning Tool + +## 📖 Overview + +RAG Pilot provides a set of tuners to optimize various parameters in a retrieval-augmented generation (RAG) pipeline. Each tuner allows fine-grained control over key aspects of parsing, chunking, postporcessing, and generating selection, enabling better retrieval and response generation. + +## 🧠 Available Tuners + +| Tuner | Stage | Function | Configuration | +|---|---|---|---| +| **EmbeddingTuner** | Retrieval | Tune embedding model and related parameters | Allows selection and configuration of the embedding model used for vectorization, including model name and optional parameters like dimension or backend. | +| **NodeParserTuner** | Retrieval | Tune node parser parameters | General tuner for configuring node parsers, possibly extending to custom strategies or pre-processing logic. | +| **SimpleNodeParserChunkTuner** | Retrieval | Tune `SentenceSplitter`'s `chunk_size` and `chunk_overlap` | Configures chunking behavior for document parsing by adjusting the size of individual text chunks and their overlap to ensure context retention. | +| **RetrievalTopkTuner** | Retrieval | Tune `top_k` for retriever | Adjusts how many documents are retrieved before reranking, balancing recall and performance. | +| **RerankerTopnTuner** | Postprocessing | Tune `top_n` for reranking | Adjusts the number of top-ranked documents returned after reranking, optimizing relevance and conciseness. | +| **PromptTuner** | Generator | Tune `prompt` for generator |Generate multiple responses using different prompts for users. | + +These tuners help in optimizing document parsing, chunking strategies, reranking efficiency, and embedding selection for improved RAG performance. + + +## 🚦 How to use RAG Pilot + +To launch RAG Pilot, create the following *required files* before running the command: + +### 🔹Input file: QA List File (`your_queries.csv`) + +The input CSV file should contain queries and associated ground truth data (optional) used for evaluation or tuning. Each row corresponds to a specific query and context file. The CSV must include the following **columns**: + +| Column | Required | Description | +|--------|----------|-------------| +| `query_id` | ✅ Yes | Unique identifier for the query. Can be used to group multiple context entries under the same query. | +| `query` | ✅ Yes (at least one per `query_id`) | The actual query string. If left empty for some rows sharing the same `query_id`, the query from the first row with a non-empty value will be used. | +| `file_name` | ✅ Yes | The name of the file or document where the context (for retrieval or grounding) is drawn from. | +| `gt_context` | ✅ Yes | The ground truth context string that should be retrieved or matched against. | +| `ground_truth` | ❌ Optional | The ideal answer or response for the query, used for optional answer-level evaluation. | + +#### 📌 CSV File Example + +```csv +query_id,query,file_name,gt_context,ground_truth +53,故障来源有哪些?,故障处理记录表.txt,故障来源:用户投诉、日志系统、例行维护中发现、其它来源。,故障来源:用户投诉、日志系统、例行维护中发现、其它来源。 +93,uMAC网元VNFC有哪几种备份方式,index.txt,ZUF-76-04-005 VNFC支持1+1主备冗余,uMAC网元VFNC有3中备份方式: 支持1+1主备冗余,支持N+M负荷分担冗余, 支持1+1互备冗余。 +93,,index.txt,ZUF-76-04-006 VNFC支持N+M负荷分担冗余, +93,,index.txt,ZUF-76-04-008 VNFC支持1+1互备冗余, +``` + +### ▶️ Use RAG Pilot with UI + +RAG Pilot provides an interactive UI interface to assist with usage, including the following stages: +#### 1. Ground Truth Uploading +Upload the QA List File mentioned above by click the `Upload` button: + +![Ground truth upload](../pics/upload_ground_truth.png) +Or you can also create your own ground truth by click the `Create Ground Truth` button, use `+` and `-` button to add or delete ground truth. + +![Create ground truth](../pics/create_ground_truth.png) + +#### 2. Response Rating +After groud truth loading, RAG Pilot wii generate response bases on EC-RAG current pipeline. +You can rating each result after the responses generated. +![Rating](../pics/rating.png) + +#### 3. Retrieve Context Tuning +During this stage, RAG Pilot will execute four tuners: EmbeddingTuner, NodeParserTuner, SimpleNodeParserChunkTuner, and RerankerTopnTuner. + +These tuners will experiment with various parameter combinations to construct corresponding pipelines, ultimately selecting the most effective pipeline as the operational one. + +![Retrieval](../pics/retrieved_pipelines.png) +Once all four tuners have completed their tasks, the page will display the results, including the `ground truth hits` and the `retrieved chunks`. + +![retrieved chunks](../pics/retrieved_chunks.png) + +#### 4. Postprocess Context Tuning +This stage adjusts the number of top-ranked documents returned after reranking, optimizing relevance and conciseness. +After this tuner finished, the page will show recall plots of different `topn` + +![recall plot](../pics/recall_plot.png) + +You can select the desired `Top n` value. The page will display the `ground truth hits` from both the postprocessing and retrieval stages, as well as the `retrieved chunks` from the postprocessing stage. + +![postprocess chunks](../pics/postprocess_chunks.png) + +#### 5. Generation tuning + +This page will displays the activated prompts sourced from text files located in the `./prompt_templates` folder, along with detailed prompt contents specified in the `prompt_contents` section of the ecrag.yaml file. + +![activated prompts](../pics/activated_prompt.png) + +After clicking the Next button, RAG Pilot will utilize these prompts to generate answers. You can then evaluate and rate the responses generated from different prompts. + +![different promp answers](../pics/answer_wi_diff_prompts.png) + +#### 6. View Results +After `Generation tuning` stage, you can see the overall user rating of different prompts. For each pipeline, you can view configuration details, download the specific pipeline configurations, and update them to EC-RAG. + +![different prompts results](../pics/diff_prompt_res.png) + +Note that once you run `retrieval`,`postprocessing` or `generation` stage , the EC-RAG active pipeline will be changed, you have to reset EC-RAG pipeline in EC-RAG server if needed. + +### ▶️ Use RAG Pilot with RESTful API +#### Upload ground truth +```bash +curl -X POST http://localhost:16030/v1/pilot/ground_truth/file \ + -H "Content-Type: multipart/form-data" \ + -F "file=@{your ground truth csv path}" | jq '.' +``` +#### Get current active pipeline +```bash +# get active pipeline id +curl -X GET http://localhost:16030/v1/pilot/pipeline/active/id | jq '.' +#get active pipeline detail configs +curl -X GET http://localhost:16030/v1/pilot/pipeline/active | jq '.' +``` +#### Run current pipeline +```bash +curl -X POST http://localhost:16030/v1/pilot/pipeline/active/run| jq '.' +``` +#### Get pipeline results +```bash +#get detail results +curl -X GET http://localhost:16030/v1/pilot/pipeline/{pipeline id}/results | jq '.' +#get pipeline metrics +curl -X GET http://localhost:16030/v1/pilot/pipeline/{pipeline id}/results/metrics | jq '.' +``` +#### Run different stages +```bash +#stage including retrieval,postprocessing and generation +curl -X POST http://localhost:16030/v1/tuners/stage/{stage}/run | jq '.' +``` +#### Get stage states +```bash +curl -X GET http://localhost:16030/v1/tuners/stage/{stage}/status | jq '.' +``` +#### Get stage results +```bash +#get stage detail results +curl -X GET http://localhost:16030/v1/tuners/stage/{stage}/results | jq '.' +#get stage metrics +curl -X GET http://localhost:16030/v1/tuners/stage/{stage}/results/metrics | jq '.' +``` +#### Get best stage pipeline +```bash +curl -X GET http://localhost:16030/v1/tuners/stage/{stage}/pipelines/best/id | jq '.' +``` + +#### Reset +##### Restore EC-RAG current active pipeline +Once you change EC-RAG pipeline ,you can restore RAG Pilot active pipeline to the new EC-RAG pipeline by: +```bash +curl -X POST http://localhost:16030/v1/pilot/pipeline/restore | jq '.' +``` +##### Reset stage +```bash +curl -X POST http://localhost:16030/v1/tuners/stage/{stage}/reset | jq '.' +``` +Note that once you run `retrieval`,`postprocessing` or `generation` stage , the EC-RAG active pipeline will be changed, you have to reset EC-RAG pipeline in EC-RAG server if needed. +## 🔧 How to Adjust RAG Pilot to Tune Your RAG Solution + +### 🧩 What's Nodes and Modules + +RAG Pilot represents each stage of the RAG pipeline as a **node**, such as `node_parser`, `indexer`, `retriever`, etc. Each node can have different **modules** that define its type and configuration. The nodes and modules are specified in a YAML file, allowing users to switch between different implementations easily. + +Here is an example of nodes and modules for EdgeCraftRAG. + +![RAG Pilot Architecture](../pics/RAG_Pilot.png) + +### ⚙️ How to Configure Nodes and Modules + +The available nodes and their modules are stored in a YAML file (i.e. `configs/ecrag.yaml` for EdgeCraftRAG as below). Each node can have multiple modules, and both nodes and modules have configurable parameters that can be tuned. + +```yaml +nodes: + - node: node_parser + modules: + - module_type: simple + chunk_size: 400 + chunk_overlap: 48 + - module_type: hierarchical + chunk_sizes: + - 256 + - 384 + - 512 + - node: indexer + embedding_model: + - BAAI/bge-small-zh-v1.5 + - BAAI/bge-small-en-v1.5 + modules: + - module_type: vector + - module_type: faiss_vector + - node: retriever + retrieve_topk: 30 + modules: + - module_type: vectorsimilarity + - module_type: auto_merge + - module_type: bm25 + - node: postprocessor + modules: + - module_type: reranker + top_n: 3 + reranker_model: BAAI/bge-reranker-large + - module_type: metadata_replace + - node: generator + model: + - Qwen/Qwen2-7B-Instruct + inference_type: + - local + - vllm + prompt: null +``` + +1. **Each Node Can Have Multiple Modules** + - A node represents a stage in the RAG pipeline, such as `node_parser`, `indexer`, or `retriever`. + - Each node can support different modules that define how it operates. For example, the `node_parser` node can use either a `simple` or `hierarchical` module. + +2. **Nodes Have Parameters to Tune** + - Some nodes have global parameters that affect all modules within them. For instance, the `retriever` node has a `retrieve_topk` parameter that defines how many top results are retrieved. + +3. **Modules Have Parameters to Tune** + - Each module within a node can have its own parameters. For example, the `simple` parser module has `chunk_size` and `chunk_overlap` parameters, while the `hierarchical` parser module supports multiple `chunk_sizes`. + +4. **Each Node Selects Its Module Based on a Type Map** + - The tool uses an internal mapping to associate each module type with its corresponding function. The type of module selected for each node is defined in a mapping system like the one below: + + ```python + COMP_TYPE_MAP = { + "node_parser": "parser_type", + "indexer": "indexer_type", + "retriever": "retriever_type", + "postprocessor": "processor_type", + "generator": "inference_type", + } + ``` + +### 🧑‍💻 How to Use Nodes and Modules + +Besides the YAML configuration file, the tool also uses a module map to associate each module with a runnable instance. This ensures that the tool correctly links each module type to its respective function within the pipeline. + +#### 🧾 Example: Mapping Modules to Functions +The function below defines how different module types are mapped to their respective components in EdgeCraftRAG: + +```python +def get_ecrag_module_map(ecrag_pl): + ecrag_modules = { + # root + "root": (ecrag_pl, ""), + # node_parser + "node_parser": (ecrag_pl, "node_parser"), + "simple": (ecrag_pl, "node_parser"), + "hierarchical": (ecrag_pl, "node_parser"), + "sentencewindow": (ecrag_pl, "node_parser"), + # indexer + "indexer": (ecrag_pl, "indexer"), + "vector": (ecrag_pl, "indexer"), + "faiss_vector": (ecrag_pl, "indexer"), + # retriever + "retriever": (ecrag_pl, "retriever"), + "vectorsimilarity": (ecrag_pl, "retriever"), + "auto_merge": (ecrag_pl, "retriever"), + "bm25": (ecrag_pl, "retriever"), + # postprocessor + "postprocessor": (ecrag_pl, "postprocessor[0]"), + "reranker": (ecrag_pl, "postprocessor[0]"), + "metadata_replace": (ecrag_pl, "postprocessor[0]"), + # generator + "generator": (ecrag_pl, "generator"), + } + return ecrag_modules +``` + + +By modifying the YAML configuration file and understanding how modules are mapped to functions, you can experiment with different configurations and parameter settings to optimize their RAG pipeline effectively. diff --git a/evals/evaluation/rag_pilot/pics/RAG_Pilot.png b/evals/evaluation/rag_pilot/pics/RAG_Pilot.png new file mode 100644 index 00000000..18939ce5 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/RAG_Pilot.png differ diff --git a/evals/evaluation/rag_pilot/pics/activated_prompt.png b/evals/evaluation/rag_pilot/pics/activated_prompt.png new file mode 100644 index 00000000..1b96d0a2 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/activated_prompt.png differ diff --git a/evals/evaluation/rag_pilot/pics/answer_wi_diff_prompts.png b/evals/evaluation/rag_pilot/pics/answer_wi_diff_prompts.png new file mode 100644 index 00000000..b52396f7 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/answer_wi_diff_prompts.png differ diff --git a/evals/evaluation/rag_pilot/pics/create_ground_truth.png b/evals/evaluation/rag_pilot/pics/create_ground_truth.png new file mode 100644 index 00000000..88a15c6a Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/create_ground_truth.png differ diff --git a/evals/evaluation/rag_pilot/pics/diff_prompt_res.png b/evals/evaluation/rag_pilot/pics/diff_prompt_res.png new file mode 100644 index 00000000..3d5f824a Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/diff_prompt_res.png differ diff --git a/evals/evaluation/rag_pilot/pics/postprocess_chunks.png b/evals/evaluation/rag_pilot/pics/postprocess_chunks.png new file mode 100644 index 00000000..c1c12fc5 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/postprocess_chunks.png differ diff --git a/evals/evaluation/rag_pilot/pics/rating.png b/evals/evaluation/rag_pilot/pics/rating.png new file mode 100644 index 00000000..705da858 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/rating.png differ diff --git a/evals/evaluation/rag_pilot/pics/recall_plot.png b/evals/evaluation/rag_pilot/pics/recall_plot.png new file mode 100644 index 00000000..190017db Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/recall_plot.png differ diff --git a/evals/evaluation/rag_pilot/pics/retrieved_chunks.png b/evals/evaluation/rag_pilot/pics/retrieved_chunks.png new file mode 100644 index 00000000..04886144 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/retrieved_chunks.png differ diff --git a/evals/evaluation/rag_pilot/pics/retrieved_pipelines.png b/evals/evaluation/rag_pilot/pics/retrieved_pipelines.png new file mode 100644 index 00000000..84168ea6 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/retrieved_pipelines.png differ diff --git a/evals/evaluation/rag_pilot/pics/upload_ground_truth.png b/evals/evaluation/rag_pilot/pics/upload_ground_truth.png new file mode 100644 index 00000000..312f0667 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/upload_ground_truth.png differ diff --git a/evals/evaluation/rag_pilot/pics/view_res.png b/evals/evaluation/rag_pilot/pics/view_res.png new file mode 100644 index 00000000..0c2059a1 Binary files /dev/null and b/evals/evaluation/rag_pilot/pics/view_res.png differ diff --git a/evals/evaluation/rag_pilot/ui/components.d.ts b/evals/evaluation/rag_pilot/ui/components.d.ts index b9467725..63402aa7 100644 --- a/evals/evaluation/rag_pilot/ui/components.d.ts +++ b/evals/evaluation/rag_pilot/ui/components.d.ts @@ -13,6 +13,8 @@ declare module 'vue' { AAffix: typeof import('ant-design-vue/es')['Affix'] ABadgeRibbon: typeof import('ant-design-vue/es')['BadgeRibbon'] AButton: typeof import('ant-design-vue/es')['Button'] + ACard: typeof import('ant-design-vue/es')['Card'] + ACardMeta: typeof import('ant-design-vue/es')['CardMeta'] ACol: typeof import('ant-design-vue/es')['Col'] ACollapse: typeof import('ant-design-vue/es')['Collapse'] ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] diff --git a/evals/evaluation/rag_pilot/ui/src/api/ragPilot/index.ts b/evals/evaluation/rag_pilot/ui/src/api/ragPilot/index.ts index c64d7c61..fe7d0242 100644 --- a/evals/evaluation/rag_pilot/ui/src/api/ragPilot/index.ts +++ b/evals/evaluation/rag_pilot/ui/src/api/ragPilot/index.ts @@ -52,14 +52,14 @@ export const getMetricsByPipelineId = (pipelineId: Number) => { }); }; -export const requesPipelineRun = () => { +export const requestPipelineRun = () => { return request({ url: "v1/pilot/pipeline/active/run", method: "post", }); }; -export const requesStageRun = (stageName: String) => { +export const requestStageRun = (stageName: String) => { return request({ url: `v1/tuners/stage/${stageName}/run`, method: "post", @@ -99,9 +99,9 @@ export const getMetricsByStage = (stage: String) => { method: "get", }); }; -export const getBasePipelineByTuner = (tunerName: String) => { +export const getPipelinesByTuner = (tunerName: String) => { return request({ - url: `v1/tuners/${tunerName}/pipeline/base`, + url: `v1/tuners/${tunerName}/pipelines`, method: "get", }); }; @@ -120,7 +120,7 @@ export const getPrompById = (pipelineId: number) => { }); }; -export const requesPromptUpdate = (data: Object) => { +export const requestPromptUpdate = (data: Object) => { return request({ url: `v1/tuners/results/getPromptList`, method: "patch", @@ -131,7 +131,7 @@ export const requesPromptUpdate = (data: Object) => { }); }; -export const requesPromptActive = (data: Object) => { +export const requestPromptActive = (data: Object) => { return request({ url: `v1/tuners/results/getPromptList`, method: "patch", @@ -139,13 +139,13 @@ export const requesPromptActive = (data: Object) => { }); }; -export const requesTopnUpdate = (top_n: String) => { +export const requestTopnUpdate = (top_n: String) => { return request({ url: `v1/pilot/pipeline/active/top_n/${top_n}`, method: "patch", }); }; -export const requesStageReset = (stage: String) => { +export const requestStageReset = (stage: String) => { return request({ url: `v1/tuners/stage/${stage}/reset`, method: "post", @@ -185,6 +185,12 @@ export const getBestPipelineByStage = (stage: String) => { method: "get", }); }; +export const requestPipelineReset = () => { + return request({ + url: "v1/pilot/pipeline/restore", + method: "post", + }); +}; export const uploadPipelineFileUrl = `${ import.meta.env.VITE_API_URL diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.css b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.css index 03e5fe8c..f2aa72d6 100644 --- a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.css +++ b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4784207 */ - src: url('iconfont.woff2?t=1750225675265') format('woff2'), - url('iconfont.woff?t=1750225675265') format('woff'), - url('iconfont.ttf?t=1750225675265') format('truetype'); + src: url('iconfont.woff2?t=1752805895135') format('woff2'), + url('iconfont.woff?t=1752805895135') format('woff'), + url('iconfont.ttf?t=1752805895135') format('truetype'); } .iconfont { @@ -13,6 +13,14 @@ -moz-osx-font-smoothing: grayscale; } +.icon-upload1:before { + content: "\e87b"; +} + +.icon-edit:before { + content: "\e633"; +} + .icon-skip:before { content: "\e6d7"; } diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.js b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.js index 49460df1..fcdc71d9 100644 --- a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.js +++ b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.js @@ -1,4 +1,4 @@ // Copyright (C) 2025 Intel Corporation // SPDX-License-Identifier: Apache-2.0 -window._iconfont_svg_string_4784207='',(h=>{var l=(a=(a=document.getElementsByTagName("script"))[a.length-1]).getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var c,t,i,o,v,e=function(l,a){a.parentNode.insertBefore(l,a)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}c=function(){var l,a=document.createElement("div");a.innerHTML=h._iconfont_svg_string_4784207,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?e(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),c()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=c,o=h.document,v=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,m())})}function m(){v||(v=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}m()}})(window); +window._iconfont_svg_string_4784207='',(h=>{var l=(a=(a=document.getElementsByTagName("script"))[a.length-1]).getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var c,t,i,o,v,e=function(l,a){a.parentNode.insertBefore(l,a)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}c=function(){var l,a=document.createElement("div");a.innerHTML=h._iconfont_svg_string_4784207,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?e(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),c()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=c,o=h.document,v=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,m())})}function m(){v||(v=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}m()}})(window); diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.json b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.json index 2474afe9..6c05b345 100644 --- a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.json +++ b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.json @@ -5,6 +5,20 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "929936", + "name": "upload", + "font_class": "upload1", + "unicode": "e87b", + "unicode_decimal": 59515 + }, + { + "icon_id": "1420883", + "name": "edit", + "font_class": "edit", + "unicode": "e633", + "unicode_decimal": 58931 + }, { "icon_id": "11753455", "name": "skip", diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.ttf b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.ttf index 2954a383..bb61d808 100644 Binary files a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.ttf and b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.ttf differ diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff index d72ed382..b0167e2c 100644 Binary files a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff and b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff differ diff --git a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff2 b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff2 index 7637fe83..66cbfeaf 100644 Binary files a/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff2 and b/evals/evaluation/rag_pilot/ui/src/assets/iconFont/iconfont.woff2 differ diff --git a/evals/evaluation/rag_pilot/ui/src/i18n/en.ts b/evals/evaluation/rag_pilot/ui/src/i18n/en.ts index c3c65129..77fca5aa 100644 --- a/evals/evaluation/rag_pilot/ui/src/i18n/en.ts +++ b/evals/evaluation/rag_pilot/ui/src/i18n/en.ts @@ -16,7 +16,7 @@ export default { reset: "Reset", error: "Error", exit: "Exit", - back: "Back", + back: "Prev", prompt: "Prompt", download: "Download", collapse: "Collapse", @@ -26,6 +26,8 @@ export default { uploadTip: "Click or drag file to this area to upload", exitTip: "Are you sure to exit? After exiting, the process will be reset.", ratingTip: "Please read each question patiently and rate the answer.", + ratingTip1: + "Please read each question patiently and rate the answers in each prompt", rated: "Rated", total: "Total", retry: "Retry", @@ -34,23 +36,31 @@ export default { configuration: "Pipeline configuration", waitTip: "Please wait patiently and do not refresh the page during this period.", + reUpload: "Re-upload", + upload: "Upload file", }, home: { title: "Hi, I'm RAG Pilot.", - des: "Please upload the file for debugging and analysis.", + des: "Choose your preferred method to start creating.", tip: "There is no available pipeline. Please create or activate it first.", + info: "Upload or create ground truth.", create: " Create Ground Truth", - edit: "Edit Ground Truth", + edit: "Edit", uploadSucc: "Upload Successfully !", uploadErr: "Files upload failed!", - fileFormat: "Supports CSV JSON format, with file size not exceeding 200M.", - created: "You have successfully created ground truth.", + upload: "Upload File", + fileFormat: "Supports CSV JSON format.", + sizeFormat: "File size not exceeding 200M.", + manual: "Manually Create", + createdText: "Create and edit data online, with more flexible operations.", + createdTip: "Support data export to local storage.", + created: "Created successfully !", validSizeErr: "Single file size not exceeding 200M.", form: { delContext: "Delete Context", delQuery: "Delete Query", - addContext: "addete Context", - addQuery: "Delete Query", + addContext: "Add Context", + addQuery: "Add Query", label: { query: "Query", gt_context: "Contexts Ground Truth", diff --git a/evals/evaluation/rag_pilot/ui/src/i18n/zh.ts b/evals/evaluation/rag_pilot/ui/src/i18n/zh.ts index c31f100d..e6d0bef6 100644 --- a/evals/evaluation/rag_pilot/ui/src/i18n/zh.ts +++ b/evals/evaluation/rag_pilot/ui/src/i18n/zh.ts @@ -26,6 +26,7 @@ export default { uploadTip: "点击或将文件拖到此区域进行上传", exitTip: "您确定要退出吗?退出后,进程将重置。", ratingTip: "请耐心阅读每个问题,并对答案进行评分", + ratingTip1: "请耐心阅读每个问题,并对每个提示词模版中的答案进行评分,", rated: "已完成", total: "总计", retry: "重试", @@ -33,17 +34,26 @@ export default { selected: "选择的", configuration: "Pipeline 配置", waitTip: "请耐心等待,在此期间不要刷新页面。", + reUpload: "重新上传", + upload: "选择文件上传", }, home: { title: "您好, 我是RAG Pilot.", - des: " 请上传文件以进行调试和分析", + des: " 选择你喜欢的方式开始创建", tip: "没有可用的Pipeline。请先创建或激活它", + info: "直接上传或者手动创建调试样本", create: "创建调试样本", - edit: "编辑调试样本", + edit: "编辑", + upload: "上传文件", uploadSucc: "文件上传成功 !", uploadErr: "文件上传失败!", - fileFormat: "支持 CSV 和 JSON 格式,文件大小不超过 200MB", - created: "您已成功创建调试样本", + fileFormat: "支持 CSV 和 JSON 格式", + sizeFormat: "文件大小不超过 200MB", + manual: "手动创建", + createdText: "在线创建和编辑数据,操作更灵活", + createdTip: "支持数据下载到本地", + created: "创建成功 !", + validSizeErr: "文件大小不能超过 200MB", form: { delContext: " 删除上下文", diff --git a/evals/evaluation/rag_pilot/ui/src/theme/common.less b/evals/evaluation/rag_pilot/ui/src/theme/common.less index d15cb6db..6750b12c 100644 --- a/evals/evaluation/rag_pilot/ui/src/theme/common.less +++ b/evals/evaluation/rag_pilot/ui/src/theme/common.less @@ -158,7 +158,6 @@ color: var(--font-main-color); font-weight: 600; line-height: 20px; - height: 20px; font-size: 14px; } } diff --git a/evals/evaluation/rag_pilot/ui/src/theme/layout.less b/evals/evaluation/rag_pilot/ui/src/theme/layout.less index 5a2e79b9..20ee95bb 100644 --- a/evals/evaluation/rag_pilot/ui/src/theme/layout.less +++ b/evals/evaluation/rag_pilot/ui/src/theme/layout.less @@ -37,6 +37,7 @@ div[aria-hidden="true"] { .layout-container { width: 100%; height: 100%; + overflow: hidden; .layout-header { position: relative; @@ -48,24 +49,17 @@ div[aria-hidden="true"] { .layout-main { overflow: auto; width: 100%; - min-width: 1000px; + overflow: auto; .layout-view { - width: 75%; max-width: 1440px; min-width: 960px; margin: 0 auto; height: 100%; } } - @media (max-width: 1100px) { - .layout-main { - } - } } -/* 宽高 100% -------------------------------- */ .w100 { width: 100% !important; } @@ -86,18 +80,16 @@ div[aria-hidden="true"] { min-height: 100vh !important; } -// 滚动条凹槽的颜色,还可以设置边框属性 &::-webkit-scrollbar-track-piece { background-color: var(--bg-content-color); + z-index: 100; } -// 滚动条的宽度 &::-webkit-scrollbar { width: 6px; height: 6px; } -// 滚动条的设置 &::-webkit-scrollbar-thumb { background-color: var(--bg-scrollbar); background-clip: padding-box; diff --git a/evals/evaluation/rag_pilot/ui/src/theme/variables.less b/evals/evaluation/rag_pilot/ui/src/theme/variables.less index 2d3bef50..addc14c2 100644 --- a/evals/evaluation/rag_pilot/ui/src/theme/variables.less +++ b/evals/evaluation/rag_pilot/ui/src/theme/variables.less @@ -37,7 +37,7 @@ --font-tip-color: #999999; --bg-scrollbar: #dddddd; --bg-scrollbar-hover: #bbbbbb; - --bg-box-shadow: rgba(0, 0, 0, 0.05); + --bg-box-shadow: rgba(0, 0, 0, 0.08); --bg-gradient-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1); --menu-bg: var(--bg-main-color); diff --git a/evals/evaluation/rag_pilot/ui/src/views/home/index.vue b/evals/evaluation/rag_pilot/ui/src/views/home/index.vue index 478a539f..1e8f7dd0 100644 --- a/evals/evaluation/rag_pilot/ui/src/views/home/index.vue +++ b/evals/evaluation/rag_pilot/ui/src/views/home/index.vue @@ -7,59 +7,124 @@
- {{ $t("home.title") }} + {{ $t("home.tip") }}
-
- - -