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 waits on a person. ask_later, generate, run_tools, and step expose individual operations. Answer what a paused call asks, an approval included (see pending_questions), then complete carries it on. queue adds a message from anywhere, even while the loop runs, and the loop takes it between two moves.

Read the conversation through messages.