Using "history" with ChatPromptTemplate giving Key error #27207
Replies: 5 comments 65 replies
-
I found a similar issue related to the
By ensuring that |
Beta Was this translation helpful? Give feedback.
-
@dosu I was able to get past the error, but seems like the memory functionality is not workign as intended. Here's my latest code that uses Agent workflow:
Here's how the Langgraph workflow is used to invoke:
When I execute this, and do a follow-up conversation, I don't see it picking up from memory at all. |
Beta Was this translation helpful? Give feedback.
-
@dosu It throws error at My invoke method is: def invoke(self, prompt: ChatPromptTemplate, **kwargs) -> str: |
Beta Was this translation helpful? Give feedback.
-
@dosu it throws following error. The error is at line
|
Beta Was this translation helpful? Give feedback.
-
@dosu When I use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a agent code that takes user questions, forms SQL statement and execute the SQL and the get the result. When trying to add persistent memory capability using "history", I am getting error from
prompt.format_messages(**kwargs)
. Here's my full code:Here's how invoke parse_question:
When I execute, I get as:
KeyError: 'history' at messages = prompt.format_messages(**kwargs)
Beta Was this translation helpful? Give feedback.
All reactions