Update rag_chain.py
This commit is contained in:
parent
4b71798dca
commit
24a02c195d
@ -8,17 +8,16 @@ from langchain.llms import HuggingFaceHub
|
|||||||
|
|
||||||
def build_rag_chain():
|
def build_rag_chain():
|
||||||
# 1. Weaviate 클라이언트
|
# 1. Weaviate 클라이언트
|
||||||
client = weaviate.Client(
|
auth_config = weaviate.AuthApiKey(api_key="01jryrcctd8c8vxbj4bs2ywrgs")
|
||||||
url=os.getenv("WEAVIATE_URL", "http://183.111.96.67:30846"),
|
|
||||||
auth_client_secret=weaviate.AuthApiKey(os.getenv("WEAVIATE_API_KEY", "01jryrcctd8c8vxbj4bs2ywrgs")),
|
client = weaviate.Client("http://183.111.96.67:32668", auth_client_secret=auth_config)
|
||||||
additional_headers={"X-HuggingFace-Api-Key": os.getenv("OPENAI_API_KEY", "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")}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# 2. 벡터스토어
|
# 2. 벡터스토어
|
||||||
vectorstore = Weaviate(
|
vectorstore = Weaviate(
|
||||||
client=client,
|
client=client,
|
||||||
index_name="LangDocs",
|
index_name="Test",
|
||||||
text_key="text",
|
text_key="text",
|
||||||
embedding= HuggingFaceEmbeddings(
|
embedding= HuggingFaceEmbeddings(
|
||||||
model_name="sentence-transformers/all-MiniLM-L6-v2"
|
model_name="sentence-transformers/all-MiniLM-L6-v2"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user