PromptRunner.Session (PromptRunnerSDK v0.6.1)

Copy Markdown View Source

Prompt Runner bridge onto the current ASM session runtime.

This module starts provider sessions through ASM, projects wrapped CliSubprocessCore events into Prompt Runner's canonical event vocabulary, and preserves provider-native recovery handles so the runner can attempt an exact session resume instead of replaying the full prompt from scratch.

Summary

Functions

Resumes an existing provider-native conversation with a continuation prompt.

Starts a streaming prompt session and returns a lazy event stream.

Types

close_fun()

@type close_fun() :: (-> :ok)

llm_config()

@type llm_config() :: map()

provider()

@type provider() :: PromptRunner.LLM.provider()

stream()

@type stream() :: Enumerable.t()

stream_event()

@type stream_event() :: map()

Functions

resume_stream(llm_config, meta, prompt)

@spec resume_stream(llm_config(), map(), String.t()) ::
  {:ok, stream(), close_fun(), map()} | {:error, term()}

Resumes an existing provider-native conversation with a continuation prompt.

start_stream(llm_config, prompt)

@spec start_stream(llm_config(), String.t()) ::
  {:ok, stream(), close_fun(), map()} | {:error, term()}

Starts a streaming prompt session and returns a lazy event stream.