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-5')
chat.with_instructions("Be terse.").with_tools(Weather)

ask runs the conversation loop, executing tools until the model answers or a call needs approval. ask_later, generate, run_tools, and step expose individual operations. Resume an approval pause with approve or deny followed by complete.

A Chat is Enumerable over its messages.