Find answers from the community

Updated 2 months ago

Hello I m trying to move to the latest

Hello, I'm trying to move to the latest version of LlamaIndex and hit this error when querying the Qdrant index. This is my code:
Plain Text
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name=(model_name),
                            openai_api_key=openai_key))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, chunk_size_limit=1024)

vector_store = QdrantVectorStore(client=get_qrant_client(), collection_name=collection_name)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_vector_store(vector_store, service_context)

query_engine = index.as_query_engine()
response = query_engine.query(query_text)

The error is "site-packages\llama_index\schema.py", line 21, in _validate_is_flat_dict
raise ValueError("Value must be one of (str, int, float)")
ValueError: Value must be one of (str, int, float)"

Why is that and how to fix it? Thanks!
L
S
9 comments
Known issue! Should be fixed shortly I think

There's a PR for it here: https://github.com/jerryjliu/llama_index/pull/6230#pullrequestreview-1470442029
Not clear, what is the workaround?
No workaround, gotta wait for the fix to merge 😦
Or you can monkey-patch your installation of llama-index with the fix
By "monkey-patch" do you mean just copying the fix into the local package code?
Yea exactly, that will unblock you right now while the PR is finalized
Gotcha, will do that. Thanks!
Hi, I see the fix is already merged? Not sure, if it's available in the package on PyPi?
Not on PyPI yet, should be a release later today, or early tomorrow πŸ™‚
Add a reply
Sign up and join the conversation on Discord