Is there a way to use
LMFormatEnforcerPydanticProgram
in a query engine? I'm using a quantized LLama2-based model through LLamaCPP, and from there, I'm trying to use the
SubQuestionQueryEngine
like this
query_engine_tools = [
QueryEngineTool(
query_engine=index.as_query_engine(similarity_top_k=10, node_postprocessors=[meta_processor, reranker_procesor]),
metadata=ToolMetadata(
name=f"us_evidence_rules",
description=f"Useful for queries about evidence rules of the US federal government",
),
)
]
response_synthesizer = get_response_synthesizer(response_mode="compact")
query_engine = SubQuestionQueryEngine.from_defaults(
query_engine_tools=query_engine_tools,
response_synthesizer=response_synthesizer,
)
Nevertheless, I keep getting the same error due to the output parsing:
ValidationError: 1 validation error for SubQuestion
__root__
SubQuestion expected dict not str (type=type_error)