pub enum InteractionStatus {
InProgress,
RequiresAction,
Incomplete,
BudgetExceeded,
Completed,
Failed,
Cancelled,
Unknown(String),
}Expand description
Lifecycle status of an interaction.
Variants§
InProgress
RequiresAction
Incomplete
BudgetExceeded
Completed
Failed
Cancelled
Unknown(String)
A status this crate does not know yet. Google adds wire values without notice; carrying the spelling verbatim keeps the whole payload deserializable instead of failing on the new value.
Implementations§
Source§impl InteractionStatus
impl InteractionStatus
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true when polling can stop: the status will not advance on its own.
The known in-flight statuses are the allowlist, so a status this crate does not know yet reads as terminal: a poll loop that treated an unknown status as in-flight would wait on it forever, whereas surfacing it lets the caller act on the provider’s own spelling.
InteractionStatus::RequiresAction is terminal for the poll
even though the interaction itself is resumable: it only advances
when the caller submits tool results, so waiting on it can never
succeed. Callers must branch on it as a distinct, resumable
outcome rather than a completion.
Sourcepub fn as_wire_str(&self) -> &str
pub fn as_wire_str(&self) -> &str
The exact spelling the Interactions API uses for this status on the wire.
Spelled out rather than derived from Debug (which would yield
BudgetExceeded, not budget_exceeded) so the string that reaches
crate::completion::FinishReason::Other is the provider’s own.
Trait Implementations§
Source§impl Clone for InteractionStatus
impl Clone for InteractionStatus
Source§fn clone(&self) -> InteractionStatus
fn clone(&self) -> InteractionStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more