# Manage chat with API

> [!WARNING]
> **Preview:** This Pre-GA product is subject to the "Pre-GA Offerings Terms" in the [Service Specific Terms](https://cloud.google.com/terms/service-terms#1), offered "as is" with limited support. See the [launch stage
> descriptions](https://cloud.google.com/products#product-launch-stages) for more details."

This page describes the
[chat-sessions](https://github.com/rubenrgzr/nai-code-examples/tree/main/typescript-examples/chat-sessions)
configuration pattern that demonstrates how to effectively manage chat sessions
with APIs. The pattern shows the system maintaining a history of the user's
conversation and then leveraging this stored context to clarify ambiguous
queries. For example, if a user asks, "What does it look like?", the session
history helps the API understand that "it" likely refers to an entity mentioned
earlier in the dialogue.

Additional information and technical specifications are available in the
[README](https://github.com/rubenrgzr/nai-code-examples/blob/main/typescript-examples/chat-sessions/README.md)
file.