Find answers from the community

Updated 5 months ago

Prompt error

At a glance

The community member is encountering a pydantic.error_wrappers.ValidationError when running a code snippet that involves creating a Prompt object and using it with a VectorStoreIndex. The error message indicates that there is an issue with the prompt schema, specifically related to the "url" parameter. Another community member has requested the full traceback to better understand the issue, but it has not been provided.

context str = "abc" query_str = "def" template = ("We have provided context information below. \n" "---------------------\n" f"{context_str}\n" "\n---------------------\n" f"Given this information, please answer the question: {query_str}\n") text_qa_template = Prompt(template=template) vector_store = WeaviateVectorStore(weaviate_client=client, index_name="LlamaIndex") index = VectorStoreIndex.from_vector_store(vector_store=vector_store) query_engine = index.as_query_engine(text_qa_template=text_qa_template) response = str(query_engine.query(query_str))
I am getting the error below in the above snippet of code:
pydantic.error_wrappers.ValidationError: 1 validation error for PromptTemplate
root
Invalid prompt schema; check for mismatched or missing input parameters. '"url"'
(type=value_error)

Can anyone please help me with the same? Thanks.
L
1 comment
Can you give the full traceback? The code looks perfectly fine at first glance
Add a reply
Sign up and join the conversation on Discord