Find answers from the community

Updated 10 months ago

Simple chat engine and output parsing

At a glance

The community member is having issues with a simple chat engine and output parsing. They are using SimpleChatEngine with a language model and an output parser, but the output is not being returned in the expected Pydantic output class. The comments suggest that the output parser is not being used by the chat engine, and there are no instructions to output anything structured. The community members are asking if there is a way to do a basic chat with chat history and ensure structured output, without using an index or vector store or any data lookup.

Simple chat engine and output parsing doesn't work.
If I do something like
Plain Text
llm = Ollama(
    model="mistral",
)
chat_engine = SimpleChatEngine.from_defaults(
    llm=llm,
    system_prompt=system_prompt,
    output_parser=PydanticOutputParser(output_cls=Choice),
)

The output doesn't get returned in the Pydantic output class. I just get a paragraph from the llm.
L
M
3 comments
Right, its a chat engine, it doesn't use a output parser, that kwarg is unused. It. has no instructions to output anything structured
Is there any way I can do a basic chat with a chat history and ensure structured output ?
Without using some index or vector store or any data lookup
Add a reply
Sign up and join the conversation on Discord