langflow icon indicating copy to clipboard operation
langflow copied to clipboard

feat: store message in agent component

Open edwinjosechittilappilly opened this issue 2 months ago • 1 comments

This pull request introduces several changes to the agent components in the Langflow backend. The main updates include adding a method to store agent history and incorporating new imports to support this functionality.

New functionality:

  • src/backend/base/langflow/base/agents/agent.py: Added an abstract method store_agent_history to store the message in memory.
  • src/backend/base/langflow/components/agents/agent.py: Implemented the store_agent_history method to store the message using StoreMessageComponent.

Import updates:

  • src/backend/base/langflow/components/agents/agent.py: Added imports for override, StoreMessageComponent, MESSAGE_SENDER_NAME_USER, and MESSAGE_SENDER_USER to support the new functionality. [1] [2]

Enhancements to message handling:

  • src/backend/base/langflow/components/agents/agent.py: Modified the message_response method to create a Message object if input_value is present and store it in agent history.
  • src/backend/base/langflow/components/agents/agent.py: Updated message_response to store the agent history after running the agent.

edwinjosechittilappilly avatar Dec 06 '24 04:12 edwinjosechittilappilly