refactor(agent): standardize memory handling and update chat history logic (#8715)

* update chat history

* update to agents

* Update Simple Agent.json

* update to templates

* ruff errors

* Update agent.py

* Update test_agent_component.py

* [autofix.ci] apply automated fixes

* update templates

* test fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
This commit is contained in:
Edwin Jose 2025-06-25 11:33:57 -05:00 committed by GitHub
commit 38d5885fa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 8672 additions and 17583 deletions

View file

@ -14,7 +14,6 @@ from langflow.base.models.openai_constants import (
from langflow.components.agents.agent import AgentComponent
from langflow.components.tools.calculator import CalculatorToolComponent
from langflow.custom import Component
from langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_AI
from tests.base import ComponentTestBaseWithClient, ComponentTestBaseWithoutClient
from tests.unit.mock_language_model import MockLanguageModel
@ -50,9 +49,6 @@ class TestAgentComponent(ComponentTestBaseWithoutClient):
"system_prompt": "You are a helpful assistant.",
"tools": [],
"verbose": True,
"session_id": str(uuid4()),
"sender": MESSAGE_SENDER_AI,
"sender_name": MESSAGE_SENDER_NAME_AI,
}
async def test_build_config_update(self, component_class, default_kwargs):
@ -129,7 +125,7 @@ class TestAgentComponentWithClient(ComponentTestBaseWithClient):
input_value=input_value,
api_key=api_key,
model_name="gpt-4o",
llm_type="OpenAI",
agent_llm="OpenAI",
temperature=temperature,
_session_id=str(uuid4()),
)