This commit is contained in:
2025-10-13 20:02:37 +08:00
parent 1c66c35a34
commit 1c2ff00110

View File

@@ -3,6 +3,7 @@ from typing import Type, List
import tyro
from mcp.server.fastmcp import FastMCP
import tyro
from loguru import logger
from langchain_community.vectorstores import FAISS
from langchain_core.documents.base import Document
@@ -23,11 +24,16 @@ class SimpleRagConfig(ToolConfig):
"""embedding model name"""
api_key:str = "wrong-key"
"""api_key for model; for generic text splitting; give a wrong key"""
"""api_key for model; for generic text splitting; give a wrong key <-- wrong, MUST have api key"""
folder_path:str = "assets/xiaozhan_emb"
"""path to local database"""
def __post_init__(self):
if self.api_key == "wrong-key":
logger.info("wrong embedding key, using simple retrieval method")
class SimpleRag(LangToolBase):
def __init__(self, config:SimpleRagConfig):