Find answers from the community

Home
Members
Harshvardhan
H
Harshvardhan
Offline, last seen 3 months ago
Joined September 25, 2024
H
Harshvardhan
·

```

Plain Text
/venv/lib/python3.11/site-packages/llama_index/core/program/utils.py:58: UserWarning: Failed to use `OpenAIPydanticProgram`. Please ensure that is installed by running `pip install llama-index-program-openai`.
  warnings.warn(
/venv/lib/python3.11/site-packages/llama_index/core/program/utils.py:58: UserWarning: Failed to use `OpenAIPydanticProgram`. Please ensure that is installed by running `pip install llama-index-program-openai`.
  warnings.warn(

Hello, I am uncertain as to why I keep receiving warnings. I utilized a markdown parser and query engine while using Anthropic as LLM and OpenAI embeddings. I am not using any structured output, so I am unsure why I continue to receive these warnings.
llama-index==0.10.12
3 comments
H
L
How can I create a chat engine from the Retriever query engine?
Plain Text
query_engine = RetrieverQueryEngine.from_args(
                        retriever=hybrid_retriever,
                        node_postprocessors=[cohere_rerank],
                        llm=llm,
                    )
3 comments
W
L
H
H
Harshvardhan
·

Hello,

Hello,
I am currently testing a document that requires me to obtain specific output from the query engine. I am following the example provided in https://docs.llamaindex.ai/en/stable/module_guides/querying/structured_outputs/query_engine/, but unfortunately, I keep getting a blank object. Below is my Pydantic model. I am using it to generate a set of questions from the details that I have obtained from the vector store.

I'm using OpenAI model and embeddings for this example.

Plain Text
class Questions(BaseModel):
    """ Data model for a questions, which has four options, one correct option and explanation for the correct option."""
    question: str = Field(..., description="natural lanaguage question")
    options: List[str] = Field(..., description="four options for the question")
    corrent_option: str = Field(..., description="correct option for the question")
    explanation : str = Field(..., description="explanation for the correct option")

Plain Text
query_engine = index.as_query_engine(
    response_mode="tree_summarize", output_cls = Questions, llm = Settings.llm
)
4 comments
H
L