Skip to content
Pine Computer Request access
Menu

17 / 26 Assistants that finish the request · Example

Book an appointment

Asked for a check-up before ten, your assistant books the first open slot the person agrees to.

Illustration of an example: a person asks your assistant, in its chat, to book a check-up at Whitebirch Dental next week, any weekday morning before ten. A computer opens Whitebirch’s booking page, shown on a small live screen in the chat. Someone else takes the 9:15 on Tuesday first; the page changes, and the computer picks the next open time, 8:30 on Wednesday, which the clinic holds. The assistant asks “Book it?” with the time and the cancellation terms, and nothing is booked until the person confirms; then the clinic’s confirmation lands in the chat.
Who it’s for
Assistants whose users ask for the dentist or the garage and expect it booked.
Why it’s hard
The 9:15 that was open a minute ago can be taken before the form is sent. Missing the appointment can cost a fee, so the person agrees to the time.
You get back
  • A booking at a time the person confirmed
  • The clinic’s confirmation, with how to cancel
How it runs, in your product’s code

A computer opens Whitebirch’s booking page and picks the earliest time before ten. If someone takes it first, the computer is told the moment the page changes and moves to the next. Your assistant then asks in the chat, and the person reads the time and the cancellation terms, then clicks Confirm booking.

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  Book a check-up at Whitebirch Dental next week, any weekday  morning before ten. Ask before confirming.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.