-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Describe the bug
I've used pymysql and database session service to store the adk chat session data, however, it seems like the session chat data didn't show as expected.
related api: GET http://127.0.0.1:8080/apps/my_agent/users/user/sessions/1be66d52-36e3-4092-99cb-a795957d0680
api response data:
...
{
"content": {
"parts": [
{
"text": "I need to transfer to the `knowledge_retrieve_agent` to retrieve the document.\n\n"
},
{
"functionCall": {
"id": "adk-8f521665-f854-4a76-b4cd-b03d8677ab0c",
"args": {
"agent_name": "knowledge_retrieve_agent"
},
"name": "transfer_to_agent"
}
}
],
"role": "model"
},
"invocationId": "e-a647fe88-20dd-4ecc-b3a5-3fa982efc40d",
"author": "problem_analysis_agent",
"actions": {
"stateDelta": {},
"artifactDelta": {},
"requestedAuthConfigs": {}
},
"longRunningToolIds": [],
"id": "fzfUoYlX",
"timestamp": 1748243390.0
},
{
"content": {
"parts": [
{
"text": "please use rag to retrieval the doc "
}
],
"role": "user"
},
"invocationId": "e-a647fe88-20dd-4ecc-b3a5-3fa982efc40d",
"author": "user",
"actions": {
"stateDelta": {},
"artifactDelta": {},
"requestedAuthConfigs": {}
},
"longRunningToolIds": [],
"id": "zgrx7klz",
"timestamp": 1748243390.0
},
...
As we can see, the timestamp same to be 1748243390.0, I'm wondering if it's the root cause.
To Reproduce
Steps to reproduce the behavior:
- Install google-adk==1.0.0 and pymysql, use mysql as session storage
- Run 'uvicorn main:app --host 0.0.0.0 --port 8080' to start the adk web service
- Open 'http://127.0.0.1:8080' and try to chat several rounds with the agent, close and re-open it
- You may see the disorder issue as well
Expected behavior
chat history should be ordered by the original asking order.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
- Python version(python -V): 3.12.7
- ADK version(pip show google-adk): 1.0.0
Additional context