Spaces:
Running
Running
Update semsearch.py
Browse files- semsearch.py +28 -10
semsearch.py
CHANGED
@@ -135,16 +135,34 @@ logger.debug(f"### webpageDocNames: {webpageDocNames}")
|
|
135 |
######################################################
|
136 |
# Connect to the Weaviate vector database.
|
137 |
logger.info("#### Create Weaviate db client connection.")
|
138 |
-
client = weaviate.connect_to_custom(
|
139 |
-
http_host="127.0.0.1",
|
140 |
-
http_port=8080,
|
141 |
-
http_secure=False,
|
142 |
-
grpc_host="127.0.0.1",
|
143 |
-
grpc_port=50051,
|
144 |
-
grpc_secure=False,
|
145 |
-
timeout=[600,600]
|
146 |
-
#read_timeout=600,
|
147 |
-
#write_timeout=90
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
)
|
149 |
client.connect()
|
150 |
|
|
|
135 |
######################################################
|
136 |
# Connect to the Weaviate vector database.
|
137 |
logger.info("#### Create Weaviate db client connection.")
|
138 |
+
#client = weaviate.connect_to_custom(
|
139 |
+
# http_host="127.0.0.1",
|
140 |
+
# http_port=8080,
|
141 |
+
# http_secure=False,
|
142 |
+
# grpc_host="127.0.0.1",
|
143 |
+
# grpc_port=50051,
|
144 |
+
# grpc_secure=False,
|
145 |
+
# timeout=[600,600]
|
146 |
+
# #read_timeout=600,
|
147 |
+
# #write_timeout=90
|
148 |
+
#)
|
149 |
+
|
150 |
+
client = weaviate.WeaviateClient(
|
151 |
+
connection_params=ConnectionParams.from_params(
|
152 |
+
http_host="localhost",
|
153 |
+
http_port="8080",
|
154 |
+
http_secure=False,
|
155 |
+
grpc_host="localhost",
|
156 |
+
grpc_port="50051",
|
157 |
+
grpc_secure=False,
|
158 |
+
),
|
159 |
+
# auth_client_secret=weaviate.auth.AuthApiKey("secr3tk3y"),
|
160 |
+
# additional_headers={
|
161 |
+
# "X-OpenAI-Api-Key": os.getenv("OPENAI_APIKEY")
|
162 |
+
# },
|
163 |
+
additional_config=AdditionalConfig(
|
164 |
+
timeout=Timeout(init=60, query=600, insert=600), # Values in seconds
|
165 |
+
)
|
166 |
)
|
167 |
client.connect()
|
168 |
|