I connected to weaviate using Docker, which seems to work fine.
The only issue is that I get a Deprecation Warning for using v3 when I think I am using v4.
Inside a jupyter notebook I am connecting to my weaviate Docker:
import weaviate
import os
import json
client = weaviate.Client(
url = "http://localhost:8080", # Replace with your endpoint
additional_headers = {
"X-OpenAI-Api-Key": os.getenv("OPENAI_API_KEY") # Replace with your inference API key
}
)
And I get the warning message [/Users/kon/miniconda3/envs/factcheck-gpt/lib/python3.11/site-packages/weaviate/warnings.py:158](https://file+.vscode-resource.vscode-cdn.net/Users/kon/miniconda3/envs/factcheck-gpt/lib/python3.11/site-packages/weaviate/warnings.py:158): DeprecationWarning: Dep016: You are using the Weaviate v3 client, which is deprecated. Consider upgrading to the new and improved v4 client instead! See here for usage: https://weaviate.io/developers/weaviate/client-libraries/python warnings.warn(
although I have installed v4 in this environment I am using:
!pip list | grep weaviate
weaviate-client 4.4.2
for now it works, I can run all the code from the quickstart_end_to_end notebook, but I am still wondering where this warning is coming from.
If you are not utilizing v3 at all, can you consider removing weaviate client v3 globally, if it still exist? I am not an expert on python, but i had similar issues where I had to remove a package globally.
Hi @hebkon you are using the v4 client, but you are connecting using a v3 style method. The older style is there for compatibility as people transition to the new style.
I feel the error message should be better. The code should be able to check which version of the client is installed. If a v4 client is installed, but a v3 method is being used, the error message should say so!
“You appear to be using a v3 method with a v4 client, consider migrating your code to use v4 methods as v3 methods are deprecated.”