Pi.Session (pi_bridge v0.6.22)

Copy Markdown View Source

Pi session APIs: host-session helpers plus server-owned BEAM sessions.

Summary

Functions

Returns active model-facing tools from the active pi host session. Prefer Pi.Host.active_tools/1.

Appends a custom entry to the active pi host session. Prefer Pi.Host.append_entry/3.

Cancels active work in a BEAM session.

Creates a child BEAM session linked to a parent session id.

Completes the current BEAM session messages through its LLM backend.

Detaches the caller from semantic state updates from a BEAM session.

Emits a structured event into a BEAM session without changing its status.

Returns compact project/runtime metadata from the active pi host session. Prefer Pi.Host.info/1.

Returns all active BEAM session states.

Looks up an active BEAM session by id.

Reruns a BEAM session from its latest user message.

Runs a prompt through a BEAM session's LLM backend.

Sends a custom message entry to the active pi host session. Prefer Pi.Host.send_message/3.

Returns renderer-neutral snapshots for active BEAM sessions.

Starts a server-owned BEAM session process.

Returns one BEAM session state.

Subscribes the caller to semantic state updates from a BEAM session.

Functions

active_tools(opts \\ [])

Returns active model-facing tools from the active pi host session. Prefer Pi.Host.active_tools/1.

append_entry(custom_type, data \\ %{}, opts \\ [])

Appends a custom entry to the active pi host session. Prefer Pi.Host.append_entry/3.

cancel(session)

Cancels active work in a BEAM session.

child(parent, opts \\ [])

Creates a child BEAM session linked to a parent session id.

complete(session, opts \\ [])

Completes the current BEAM session messages through its LLM backend.

detach(session, pid \\ self())

Detaches the caller from semantic state updates from a BEAM session.

emit_event(session, event)

Emits a structured event into a BEAM session without changing its status.

info(opts \\ [])

Returns compact project/runtime metadata from the active pi host session. Prefer Pi.Host.info/1.

list()

Returns all active BEAM session states.

lookup(id)

Looks up an active BEAM session by id.

rerun(session, opts \\ [])

Reruns a BEAM session from its latest user message.

run(session, prompt, opts \\ [])

Runs a prompt through a BEAM session's LLM backend.

send_message(custom_type, data \\ %{}, opts \\ [])

Sends a custom message entry to the active pi host session. Prefer Pi.Host.send_message/3.

snapshots()

Returns renderer-neutral snapshots for active BEAM sessions.

start(opts \\ [])

Starts a server-owned BEAM session process.

state(session)

Returns one BEAM session state.

subscribe(session, pid \\ self())

Subscribes the caller to semantic state updates from a BEAM session.