-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Crashes after entering additional questions #769
Fix: Crashes after entering additional questions #769
Conversation
Thanks for picking this up. Just answer my minor question and I will merge. |
Thanks for reviewing this. But pardon me, I missed your question? |
Is the call on line 349 really necessary? Can't you just directly put modified_data in the return and omit the json.loads statement on the following line? |
You're absolutely right, I was fixated on splitting out the steps in case in the future Langchain strictens their schema even more that I didn't even realize I do an extra step for no reason. Thanks. I'll implement a fix now with a sanity check. |
…naming; grammar fix
Thanks, great that you dug out the error. |
Done ✅ I would also recommend to put this in a minor release for its PyPi package soon (I'm not sure what your release cycles are like), because this breaks the application whenever the user is asked for clarification. Even if the user skips. |
No problem, glad I could help 😄 |
gpt-engineer 0.0.9 i have this problem tooo in which version this is solved? |
Thanks for reporting! |
Fixes #754.
Cause:
From a recent Langchain update, it seems the AIMessage object has a much stricter schema which only allows
is_chunk
attributes to have aFalse
value. However, in gpt_engineer, the deserialization ofclarify
logs implicitly setsis_chunk
toTrue
.Proposed fixes:
is_chunk
attribute can never beTrue
.Containment/Fix:
I go with Fix 2.
This commit deserializes and stores an intermediate list, from which we explicitly set all
is_chunk
values toFalse
. Since the Langchain messages_from_dict(..) method anyways expect a Message object with anis_chunk
property ofFalse
, we don't have the effect of hotfixing this property, but rather add an additional check to make sure Messages have valid properties (like this is_chunk property for e.g.).