Skip to content

Conversation

@eyurtsev
Copy link
Collaborator

@eyurtsev eyurtsev commented Aug 4, 2023

Fixes mutation in place in the JsonOutputFunctionParser. This causes issues
when trying to re-use the original AI message.

@vercel
Copy link

vercel bot commented Aug 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2023 5:24pm

@dosubot dosubot bot added the bug Related to a bug, vulnerability, unexpected error with an existing feature label Aug 4, 2023
@eyurtsev eyurtsev requested review from baskaryan and hwchase17 August 4, 2023 15:15
try:
func_call = message.additional_kwargs["function_call"]
except ValueError as exc:
func_call = message.additional_kwargs["function_call"].copy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be deep copied to be safe?

Copy link
Collaborator Author

@eyurtsev eyurtsev Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works i favor shallow copies to keep things light weight though I think it hardly matters in this case as it's a tiny dict so deep copy works

@eyurtsev eyurtsev merged commit f616aee into master Aug 7, 2023
@eyurtsev eyurtsev deleted the eugene/fix_mutation_in_place branch August 7, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Related to a bug, vulnerability, unexpected error with an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants