query_engine
defined and my question is how do I pass the program variable (as shown on the documentation page) to the query engine: ### program defined based on the documentation program = GuidancePydanticProgram( output_cls=Result, prompt_template_str="Generate a response using the query asked as follows: {{query}}", guidance_llm=self.llm, verbose=True, ) ### standard query_engine defined, but how do I pass in the program variable or get the program to see the vector index? query_engine = index.as_query_engine( similarity_top_k=2, node_postprocessors=[ MetadataReplacementPostProcessor(target_metadata_key="window") ], output_cls=Result, ) response = query_engine.query(query)
index.as_query_engine(output_cls=my_output_cls)
raise OutputParserException( llama_index.output_parsers.base.OutputParserException: Failed to parse pydantic object from guidance program
from llama_index.output_parsers import PydanticOutputParser prompt_template_str = """\ Generate an example album, with an artist and a list of songs. \ Using the movie {movie_name} as inspiration.\ """ program = LLMTextCompletionProgram.from_defaults( output_parser=PydanticOutputParser(Album), prompt_template_str=prompt_template_str, llm=llm, verbose=True, )
None
.