Find answers from the community

Updated 4 months ago

KeyError

At a glance

The post describes an issue with a chat_engine object, where a KeyError is raised due to the absence of a custom_chat_history parameter. Community members suggest changing custom_chat_history to chat_history to resolve the issue. However, the code still does not seem to respond as expected, and the community members discuss potential debugging approaches, such as using a debugger, though the original poster acknowledges their limited experience with Python.

Plain Text
chat_engine = CondenseQuestionChatEngine.from_defaults(
    query_engine=index.as_query_engine(),
    condense_question_prompt=custom_prompt,
    chat_history=custom_chat_history,
    verbose=True,
    llm=llm,
    service_context=service_context,
)

Gives me
Plain Text
KeyError: 'custom_chat_history'



Full Code in Thread
L
T
11 comments
What's the full error though?
Hi, Sorry for responding just now. I had a very busy schedule.

The Full Error is attached
Change custom_chat_history to chat_history
It doesnt seem to respond.
Code attached
Attachment
image.png
Like it seems to have generated, but it doesnt respond
Attachment
image.png
Welp it does reply, just needs way to long for just giving a "Dunno"
Heya @Logan M do you know what that would happen?
I have no idea unfortunately -- I would have to walk through code with a debugger to figure it out (and that is an option I highly recommend getting good at with python tbh)
Sorry to ask so stupidly, but how do I do that? I'm very much not good with python, as you can probably tell
@Logan M hehe
Add a reply
Sign up and join the conversation on Discord