Adipta commited on
Commit
2c39139
1 Parent(s): e0c369a

Update pdfchatbot.py

Browse files
Files changed (1) hide show
  1. pdfchatbot.py +4 -6
pdfchatbot.py CHANGED
@@ -72,13 +72,11 @@ class PDFChatBot:
72
  """
73
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
74
  docs = text_splitter.split_documents(self.documents)
75
-
76
- auth_config = weaviate.AuthApiKey(api_key=os.getenv("WEAVIATE_API_KEY"))
77
 
78
- weaviate_client = weaviate.Client(
79
- url=os.getenv("WEAVIATE_URL"),
80
- auth_client_secret=auth_config,
81
- )
82
 
83
  self.vectordb = WeaviateVectorStore.from_documents(docs, self.embeddings, client=weaviate_client)
84
 
 
72
  """
73
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
74
  docs = text_splitter.split_documents(self.documents)
 
 
75
 
76
+ weaviate_client = weaviate.connect_to_wcs(
77
+ cluster_url=os.getenv("WEAVIATE_URL"),
78
+ auth_credentials=weaviate.auth.AuthApiKey(os.getenv("WEAVIATE_API_KEY"))
79
+ )
80
 
81
  self.vectordb = WeaviateVectorStore.from_documents(docs, self.embeddings, client=weaviate_client)
82