Spaces:
Sleeping
Sleeping
Update pergunte_2.py
Browse files10 unmodified lines111213141516171819202115162223247 unmodified lines323334303536372 unmodified lines4041423943444510 unmodified lines# ======================================================================================# CONFIG VETOR (Mantendo a estrutura original do pergunte_2.py)# ======================================================================================from pathlib import Path
# ================= CONFIG VETOR =================REPO_ROOT = Path(__file__).resolve().parentPERSIST_DIR = str((REPO_ROOT / "chroma_taxbot").resolve())PERSIST_DIR = os.getenv("CHROMA_DIR", PERSIST_DIR) # opcional, mesmo override do ingestorCOLLECTION = "taxbot_mem"
PERSIST_DIR = "./chroma_rt"COLLECTION = "reforma_rt_irpfm"
from langchain_openai import OpenAIEmbeddings, ChatOpenAIfrom langchain_chroma import Chroma7 unmodified lines# Cache global do Chroma_VDB = Nonedef load_vectordb() -> Chroma: """Abre a base existente (sem reindexar) com cache global.""" global _VDB if _VDB is None: _VDB = Chroma(2 unmodified lines embedding_function=emb, ) return _VDB
# ======================================================================================# CÁLCULOS / FERRAMENTAS (Integrando as ferramentas do pasted_content.txt)# ======================================================================================pergunte_2.py+7-4