Find answers from the community

Updated 4 months ago

Kwargs

At a glance

The post indicates that the ContextChatEngine.from_defaults() function ignores keyword arguments (kwargs). The comments suggest that the kwargs are included due to "kwargs abuse" in the index.as_chat_engine function. Community members discuss trying to pass in an override for the context string, and one member ended up overloading the constructor since they already had a subclass. Another community member notes that the system prompt passed in gets appended to the context, and that the LLM has a habit of saying "not in the context", which can be confusing for end-users. To address this, the community member changed the default context to use the phrase "information below" instead of "context below".

ContextChatEngine.from_defaults() ignores kwargs πŸ˜›
L
i
7 comments
Kwargs are just there because of kwargs abuse during index.as_chat_engine lol
What were you trying to pass in?
An override for the context string
I ended up overloading the constructor since I already had a subclass
Ah yea, it's a little hard-coded at the moment, makes sense.

The system prompt passed in gets appended to it though
yep, but the LLM has an unfortunate habit of saying "not in the context" which to an end-user is like "what the heck is a context"
so i changed the default context to use the word "information below" instead of "context below" so it stops mentioning it
Add a reply
Sign up and join the conversation on Discord