Hi Everyone. I really need your guys help here!
I am given a weaviate URL which has been deployed as a web app. I am given the url to it - say its https://sample-weaviate.myorg.com (hiding the url for the sake of security). I am not given any ports or any grcp related data.
I had a version 3 code that could connect to it in the following manner
from weaviate import Client as wClient
self.weaviate = wClient(WEAVIATE_ENDPOINT)
Now for version 4, which offers the following ways to connect to it, I am failing miserably, trying to connect to the weaviate instance using just the URL, which I code easily do in v3
Weaviate Cloud (not the case for me as its not hosted on weaviate cloud)
Local instances (this seems to pre and post append the port to it, so couldn’t get it to work)
Custom connections again requires http port, grpc host & port, which I am not provided.
Embedded Weaviate (not the case for me)
Can anyone please help me by providing the python code to connect to a weaviate instance, provided only the URL? I’m using weaviate client v4.10.2
The python client v4 introduces the GRPC connection. So in order to use it, you need to make sure you server is a recent version (1.25+ should be fine) and has the GRPC port exposed.
Now, if your cluster is under a SSL/TLS endpoint, you need to make sure that both grpc and http endpoints are secure in the client.
Here you can customize your connection. So let’s say you expose http and grpc on different ports, or different domains, etc:
that was really helpful. Thank you! and is there a way to check is gRPC ports are being exposed? Also to use custom connections function to connect
my http_host would be the url of the weaviate and the port would be something like 8080. Is that correct?
Sorry for the late response here. I was out on vacations
Here I have written some examples on how to check the availability for both endpoints using curl and grpcurl and also when behind a reverse proxy serving TLS/SSL like traefik: