[GH-ISSUE #1328] [BUG]: [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]} #837

Closed
opened 2026-02-22 18:21:39 -05:00 by yindo · 0 comments
Owner

Originally created by @FrankTiao on GitHub (May 10, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1328

Originally assigned to: @shatfield4 on GitHub.

How are you running AnythingLLM?

Docker (local)

What happened?

I am using the gemini-1.5-pro-latest model and uploaded a local document named "goframe-latest_compressed.pdf". I then used the "up-pin form workspace" function to pin the document. During the first question and answer in each thread, the model responds normally. However, from the second question onwards, I receive the following error:

Could not respond to message.
[GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]}

Are there known steps to reproduce?

  1. Upload a local document ( The download link for my document is here )
  2. Start a thread and ask a question about the document content. For example:

me: 介绍goframe

  1. Receive a normal response from the model. For example:

model: GoFrame 简介 GoFrame 是一款模块化、高性能、企业级的 Go 语言应用开发框架....

  1. Ask a second question within the same thread. For example:

me: 写一个GoFrame 的快速入门示例

  1. Could not respond to message. [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]}
Originally created by @FrankTiao on GitHub (May 10, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1328 Originally assigned to: @shatfield4 on GitHub. ### How are you running AnythingLLM? Docker (local) ### What happened? I am using the `gemini-1.5-pro-latest` model and uploaded a local document named "goframe-latest_compressed.pdf". I then used the "up-pin form workspace" function to pin the document. During the first question and answer in each thread, the model responds normally. However, from the second question onwards, I receive the following error: > Could not respond to message. > [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]} ### Are there known steps to reproduce? 1. Upload a local document ( [The download link for my document is here](https://drive.google.com/file/d/1s2LLuJraGMk-0vFvTOOA897EVvEWGbXA/view) ) 2. Start a thread and ask a question about the document content. For example: > me: 介绍goframe 3. Receive a normal response from the model. For example: > model: GoFrame 简介 GoFrame 是一款模块化、高性能、企业级的 Go 语言应用开发框架.... 4. Ask a second question within the same thread. For example: > me: 写一个GoFrame 的快速入门示例 5. Could not respond to message. [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]}
yindo added the possible buginvestigating labels 2026-02-22 18:21:39 -05:00
yindo closed this issue 2026-02-22 18:21:40 -05:00
yindo changed title from [BUG]: [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]} to [GH-ISSUE #1328] [BUG]: [GoogleGenerativeAI Error]: Content with role 'user' can't follow 'user'. Valid previous roles: {"user":["model"],"function":["model"],"model":["user","function"],"system":[]} 2026-06-05 14:37:28 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#837