Skip to contents

Starts the queued input of an idle session (built with .run = FALSE, or given a follow-up with gptr_steer()) and pumps it until turns model turns have ended or the run settles. A running session is advanced the same way.

Usage

gptr_step(s, turns = 1L)

Arguments

s

A session.

turns

The number of turns to advance (Inf for all).

Value

s, invisibly. A run that settles in status error, blocked, budget or max_turns signals the condition documented in peter().

Details

.run = FALSE builds a session without making its model request; gptr_step() or gptr_wait() starts it. Supply an explicit workspace with envir = when results must remain available outside the function that creates the session.

Examples

session = peter("Plan the analysis", model = gptr_fake_provider(list("Plan: ...")),
  .run = FALSE)
gptr_step(session)
#> gptr: thinking
#> gptr: done · 1 turn · 1.6k tokens · $0.0000
session$turns
#> [1] 1