ai.Prompt

The rendered, provider-neutral prompt passed to clients. Roles split the prompt into messages and media remains structural until a provider lowers it to its wire format.

Reference version

Signature

class ai.Prompt

The rendered, provider-neutral prompt passed to clients. Roles split the prompt into messages and media remains structural until a provider lowers it to its wire format.

Source:<builtin>/ai/spec.bamlbytes 4148–4678

Fields

_data

$rust_type

Instance methods

function

messages

(self) -> ai.PromptMessage[] throws never

Return the ordered chat messages used by provider request builders.

function

text

(self) -> string throws never

Render the prompt as readable text. Message roles are emitted as headers.

Implementations

baml.ToString for ai.Prompt

Instance methods

function

to_string

(self) -> string throws never

Source:<builtin>/ai/spec.bamlbytes 4552–4676