Skip to content
Pine Computer Request access
Menu

18 / 26 Assistants that finish the request · Example

Compare and buy

Your assistant finds the cheapest place to buy it, delivery included, and places the order when the person says yes.

Illustration of an example: a person asks your assistant, in its chat, for the cheapest grey Corva task chair that arrives by Friday. A computer fills a basket at each of three shops at the same moment, shown on a small live screen in the chat, and stops before payment. The comparison comes back with delivery in each total: Oakleaf Home is cheapest at £198. The assistant asks “Buy it?” and nothing is spent until the person approves; then the order confirmation lands in the chat.
Who it’s for
Shopping assistants whose users say “just buy it”.
Why it’s hard
The price on the product page isn’t what you pay. Delivery and discounts only show up at checkout. Stock and delivery dates change through the day, so an old comparison is no use.
You get back
  • Each shop’s total and delivery date, side by side
  • The order confirmation, as a file in the chat

Every shop is checked at the same moment, so no price in the comparison is an hour older than the rest.

A real run: the cheapest day next week for two on the London–Paris train, found on the operator’s own site, and stopped before any passenger or payment details. Cookbook 02: Give it a goal
How it runs, in your product’s code

Your assistant starts a computer for each shop worth checking. Each fills a basket and stops on the last page before payment, so the comparison uses real totals. Then your assistant asks in the chat. The person looks over the cheapest order on the live screen, places it themselves and hands back. The confirmation lands in the conversation, with the comparison beside it.

Ruby · task-turn excerpt
# Existing backend Computer and session; see setup docs.# saved_message_id is your durable ID for this request.computer.require_agent_protocol!agent = session.agentgoal = <<~JOB  Find the cheapest grey Corva task chair that arrives by  Friday, and buy it once the person approves.JOBturn = agent.run(goal, idempotency_key: saved_message_id)# Persist turn.turn_id before waiting or leaving this process.turn = agent.wait(turn_id: turn.turn_id, timeout: 30)case turn.statewhen "running", "canceling"  # Schedule another wait for this turn ID.when "needs_input"  # Present turn.question; authorize any desktop handoff.  # When the user replies, answer this turn and save the new ID:  # agent.answer(turn_id: turn.turn_id, answer: reply.text)when "answered"  # Continue with turn.next_turn_id; do not resubmit the goal.when "completed"  turn.result.artifacts.each do |file|    bytes = session.read_file(file.fetch("relative_path"))    # Save bytes in your own file store before stopping.  end  # Verify the outputs and external state against the request.when "failed", "canceled"  # Record the outcome; check side effects before any retry.end

Requires a configured Computer, session and durable request ID. The comments mark application logic you supply; this excerpt does not implement storage, polling or human handoff. Agent integration · Saving outputs

Build more.
Hand AI the work.