I’m in lesson 4 and running the notebook locally on my device. I’m running python v 3.11 in venv. My OPENAI_API_KEY env variable is set correctly. I’ve also downloaded the csv data file and confirmed that it’s placed in the correct folder with the notebook and loads successfully given the file path when calling loader.load()
. This is confirmed by the metadata
in the dict reporting the file path and 999 rows.
When attempting to run the following cell, there is a warning that is raised.
index = VectorstoreIndexCreator(
vectorstore_cls=DocArrayInMemorySearch
).from_loaders([loader])
The warning is as follows.
/Users/pchittum/projects/learning/venv-jupyter/lib/python3.11/site-packages/pydantic/_migration.py:281: UserWarning:
pydantic.error_wrappers:ValidationError
has been moved topydantic:ValidationError
.
warnings.warn(f’{import_path}
has been moved to{new_location}
.')
There was a pip version notice when I executed the docarray
install command in the previous cell.
The subsequent cells are:
query ="Please list all your shirts with sun protection \
in a table in markdown and summarize each one."
and
response = index.query(query)
That last cell throws an error:
ValidationError: 2 validation errors for DocArrayDoc
text
Field required [type=missing, input_value={‘embedding’: [0.00332062… -0.021229914268597688]}, input_type=dict]
For further information visit Redirecting...
metadata
Field required [type=missing, input_value={‘embedding’: [0.00332062… -0.021229914268597688]}, input_type=dict]
For further information visit Redirecting...
This almost seems like a problem with a version mismatch in the pydantic library in the notebook. And since I’m all out of API calls to OpenAI, I can’t test in the online version of the notebook whether or not this problem exists in the hosted environment.
I’m also pretty new to python, so I could totally see that this might be a local runtime issue. Running platform.python_version()
on the notebook returns 3.9.17. Is that possibly the problem?
Thanks for any nudges in the right direction. I’m sure I’ll learn something.