Skip to content

Unnecessarily complicated return statement in Drafter.py #13

@wagenbm

Description

@wagenbm

Hi Vaibhav,

I observed within the file Drafter.py regarding the function

our_agent

that the return statement

return {"messages": list(state["messages"]) + [user_message, response]}

could actually be replaced with the following code:

return {"messages": [user_message, response]}

I tried it out and do not observe a different behavior of the program. Is there a reason why you are returning all the messages from the state instead the new ones only which are merged with the reducer add_messages into the state?

Thanks and kind regards,
Matthias

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions