Are we able to pass the previous response ID? It looks like this is not currently supported.
Reference: ai.chats — Allows creating local stateful chat objects to simplify multi-turn interactions.
My use case:
In our chat, we support file uploads, and users can interact with the chat later. Ideally, we want to pass the previous response ID and have the Gemini API maintain the state on its server side.
Hii @Senthil_Kumar ,
Welcome to the Forum!
Not yet. The Gemini API currently doesn’t support passing previous response IDs to maintain state server-side. For now, you can manage state locally using ai.chats to simulate multi-turn sessions, but true server-side session memory isn’t available yet.
Thanks!
@Shrushti_Patil thanks for confirming.
We’re using MCP context to manage our LLM interactions. Some responses are directly answered by the LLM, and others involve tool calls to external systems before replying. Currently, we’re able to pass system and user messages in the prompt.
Question: How can we include tool calls and their outputs in the context so Gemini can maintain the correct state and flow in multi-turn conversations?