1 hour ago · 40 min read8063 words · Tech · hide · 0 comments

RubyLLM 2.0 is the biggest release since 1.0. It starts with tool approval: class RefundOrder < RubyLLM::Tool description "Refunds an order" parameter :order_id, description: "ID of the order to refund" requires_approval # that's all it takes def execute(order_id:, tool_call: nil) Refunds.issue(order_id:, idempotency_key: tool_call.id) end end class SupportAgent < RubyLLM::Agent chat_model Chat tools RefundOrder end chat = SupportAgent.create! chat.ask "I was charged twice for order 42." # stops before refunding # later, when the user approves chat = SupportAgent.find(chat.id) chat.approve(chat.pending_approvals.first) chat.complete # issues the refund and answers The pending call is saved in your database, so the approval can come tomorrow, from another process, after two deploys. That’s just one piece. 2.0 also generates video and speech, reads scanned documents, reranks search results, runs provider-hosted tools with typed citations, accounts for every provider attempt (including…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.