Find answers from the community

Updated 3 months ago

Testing out CondenseQuestionChatEngine I

Testing out CondenseQuestionChatEngine. I'm getting this error when submitting a question:. Does anyone have an example of where you set the mode? I'm not finding it in the docs.
Plain Text
raise ValueError(f"Unknown chat mode: {chat_mode}")
ValueError: Unknown chat mode: <llama_index.chat_engine.condense_question.CondenseQuestionChatEngine object... >
L
e
8 comments
How are you creating the chat engine right now?

CondenseQuestionChatEngine is the default chat engine

chat_engine = index.as_chat_engine(verbose=True)
@Logan M Like this
Plain Text
chat_engine = index.as_chat_engine(CondenseQuestionChatEngine.from_defaults(
        query_engine=query_engine,
        condense_question_prompt=custom_prompt, 
        chat_history=custom_chat_history, 
        verbose=True))
ah, you are nesting objects

Just do this

Plain Text
chat_engine = index.as_chat_engine(
        condense_question_prompt=custom_prompt, 
        chat_history=custom_chat_history, 
        verbose=True)
@Logan M Once again you are tops.
🫑 perfect!
Add a reply
Sign up and join the conversation on Discord