deepset-ai / haystack-core-integrations

Additional packages (components, document stores and the likes) to extend the capabilities of Haystack version 2.0 and onwards
https://haystack.deepset.ai
Apache License 2.0
121 stars 119 forks source link

How to connect to separate gRPC host in WeaviateDocumentStore #1170

Open koty11 opened 1 week ago

koty11 commented 1 week ago

Describe the bug Hello Haystack team,

I'm currently working with a Weaviate setup where the REST API and gRPC services are hosted on different domains. Specifically, I have:

REST API Host: https://weaviate.xxyy.com gRPC Host: https://weaviate.grpc.xxyy.com

In the original Weaviate Python client library, it's possible to specify different hosts for the REST and gRPC connections using the ConnectionParams class:

from weaviate.connect import ConnectionParams
import weaviate

connection_params = ConnectionParams.from_params(
    http_host="weaviate.xxyy.com",
    http_port=443,
    http_secure=True,
    grpc_host="weaviate.grpc.xxyy.com",
    grpc_port=443,
    grpc_secure=True,
)
client = weaviate.Client(connection_params=connection_params)

This configuration allows me to connect to the REST API and gRPC services using different hosts and ports.

Issue:

In Haystack's WeaviateDocumentStore, there doesn't seem to be an option to specify separate hosts for the REST API and gRPC connections. The url parameter sets both to the same host, and there's no exposed parameter to set a different gRPC host.

To Reproduce Here's the current initialization in Haystack:

from haystack_integrations.document_stores.weaviate.document_store import WeaviateDocumentStore
from haystack_integrations.document_stores.weaviate.auth import AuthApiKey

document_store = WeaviateDocumentStore(
    url="https://weaviate.xxyy.com",
    auth_client_secret=AuthApiKey(api_key="your_weaviate_api_key"),
    grpc_secure=True,
)

Describe your environment (please complete the following information):