There seems to be an issue within the devchat's chat functionality, specifically with the chat_json decorator. When it's called multiple times, the PROMPT template variable undergoes an undesired mutation during execution. This mutation affects the outcome when the function is repeatedly invoked, leading to inconsistent behavior and potentially incorrect results.
Steps to reproduce:
- Set up a
PROMPT template for use with the chat_json decorator in a devchat environment.
- Invoke a function decorated with
chat_json multiple times that uses the PROMPT template.
- Observe that the content of
PROMPT is changed after initial calls, affecting subsequent function calls.
Expected behavior: The PROMPT template variable should remain constant across multiple invocations of the decorated function, ensuring consistent functionality throughout.
Actual behavior: The PROMPT variable is mutated during the process, leading to inconsistencies and possibly incorrect operation of the decorated function across calls.
This issue significantly affects the reliability and predictability of using the devchat's chat feature with the chat_json decorator, especially in scenarios where function reusability is crucial. Any insights or fixes for this problem would be greatly appreciated.
There seems to be an issue within the devchat's
chatfunctionality, specifically with thechat_jsondecorator. When it's called multiple times, thePROMPTtemplate variable undergoes an undesired mutation during execution. This mutation affects the outcome when the function is repeatedly invoked, leading to inconsistent behavior and potentially incorrect results.Steps to reproduce:
PROMPTtemplate for use with thechat_jsondecorator in a devchat environment.chat_jsonmultiple times that uses thePROMPTtemplate.PROMPTis changed after initial calls, affecting subsequent function calls.Expected behavior: The
PROMPTtemplate variable should remain constant across multiple invocations of the decorated function, ensuring consistent functionality throughout.Actual behavior: The
PROMPTvariable is mutated during the process, leading to inconsistencies and possibly incorrect operation of the decorated function across calls.This issue significantly affects the reliability and predictability of using the devchat's
chatfeature with thechat_jsondecorator, especially in scenarios where function reusability is crucial. Any insights or fixes for this problem would be greatly appreciated.