class RubyLLM::Chat

A Chat is a conversation with an AI model. It holds the messages exchanged so far, the tools the model may call, and the settings applied to each request. RubyLLM.chat is the usual way to create one.

chat = RubyLLM.chat
chat.ask "What's the best way to learn Ruby?"

Configuration methods return self, so calls chain:

chat = RubyLLM.chat(model: 'claude-sonnet-4-5')
chat.with_instructions("Be terse.").with_tools(Weather)

ask runs the agentic loop to completion, executing tool calls until the model produces a final answer. ask_later, generate, run_tools, and step expose the individual moves of that loop.

A Chat is Enumerable over its messages.