Open SavvySupport opened 4 hours ago
The error you're encountering, "chat_history not found in SQLAgentComponent," suggests that the chat_history
attribute is expected but not properly initialized or included in your setup. The chat_history
is typically used to store previous interactions in a chat session, allowing the agent to maintain context or continuity in interactions [1][2].
To resolve this issue, you should ensure that the chat_history
attribute is correctly initialized in your flow. This might involve explicitly defining or passing a chat_history
parameter when setting up the SQLAgentComponent
. If the component or flow setup does not automatically handle this, you may need to manually add a chat_history
input or ensure that the component's configuration includes it as a DataInput
.
If the issue persists, it might be helpful to check if there are any recent changes or updates in the codebase related to the SQLAgentComponent
that could have introduced this requirement.
To continue talking to Dosu, mention @dosu.
Bug Description
The SQLAgent shows error "chat_history not found in SQLAgentComponent".
Reproduction
Error building Component SQLAgent:
chat_history not found in SQLAgentComponent
Traceback (most recent call last): File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 708, in _build_results result = await initialize.loading.get_instance_results( File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/interface/initialize/loading.py", line 68, in get_instance_results return await build_component(params=custom_params, custom_component=custom_component) File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/interface/initialize/loading.py", line 145, in build_component build_results, artifacts = await custom_component.build_results() File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/custom/custom_component/component.py", line 837, in build_results return await self._build_with_tracing() File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/custom/custom_component/component.py", line 819, in _build_with_tracing _results, _artifacts = await self._build_results() File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/custom/custom_component/component.py", line 883, in _build_results result = await method() File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/base/agents/agent.py", line 81, in message_response message = await self.run_agent(agent=agent) File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/base/agents/agent.py", line 136, in run_agent if self.chat_history: File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/custom/custom_component/component.py", line 665, in getattr raise AttributeError(msg) AttributeError: chat_history not found in SQLAgentComponent
Expected behavior
Expecting a response from the SQLAgent, instead of an error message for "chat_history"
Who can help?
No response
Operating System
MacOS
Langflow Version
1.1
Python Version
3.10
Screenshot
Flow File
No response