hi @zhou_yangbo !
You are probably initiating the v3 client and trying to run a v4 syntax.
Note that the v4 package has both v3 client and v4 client.
In order to use the v4 client, you must do this:
client = weaviate.connect_to_wcs(
cluster_url=os.getenv("WCS_URL"),
auth_credentials=weaviate.auth.AuthApiKey(os.getenv("WCS_API_KEY")),
headers={
"X-OpenAI-Api-Key": os.environ["OPENAI_APIKEY"] # Replace with your inference API key
}
)
this is how you initiate the v4 client.
For the v3 client, you can use the same package, but initialize it using:
client = weaviate.Client(
url = "https://WEAVIATE_INSTANCE_URL", # Replace with your Weaviate endpoint
auth_client_secret=weaviate.auth.AuthApiKey(api_key="YOUR-WEAVIATE-API-KEY"), # Replace with your Weaviate instance API key
additional_headers = {
"X-OpenAI-Api-Key": "YOUR-OPENAI-API-KEY" # Replace with your inference API key
}
)
Not that you still get the client, but the first one is a v4 client, and the second one is a v3 client.
Let me know if this clarifies.
Thanks!