Update rag_chain.py

This commit is contained in:
localsoo 2025-04-21 00:30:43 +00:00
parent 4b71798dca
commit 24a02c195d

@ -8,17 +8,16 @@ from langchain.llms import HuggingFaceHub
def build_rag_chain():
# 1. Weaviate 클라이언트
client = weaviate.Client(
url=os.getenv("WEAVIATE_URL", "http://183.111.96.67:30846"),
auth_client_secret=weaviate.AuthApiKey(os.getenv("WEAVIATE_API_KEY", "01jryrcctd8c8vxbj4bs2ywrgs")),
additional_headers={"X-HuggingFace-Api-Key": os.getenv("OPENAI_API_KEY", "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")}
)
auth_config = weaviate.AuthApiKey(api_key="01jryrcctd8c8vxbj4bs2ywrgs")
client = weaviate.Client("http://183.111.96.67:32668", auth_client_secret=auth_config)
# 2. 벡터스토어
vectorstore = Weaviate(
client=client,
index_name="LangDocs",
index_name="Test",
text_key="text",
embedding= HuggingFaceEmbeddings(
model_name="sentence-transformers/all-MiniLM-L6-v2"