pub struct ModelReturn {
pub message: Payload,
pub calls: Vec<ToolCall>,
pub usage: Option<ModelUsage>,
pub stop: Option<StopReason>,
pub billed_usd_micros: Option<UsdMicros>,
}Expand description
One assistant turn. message is the in-window content; calls is the
requested tool wave — empty means the turn loop may conclude the run.
usage/stop/billed_usd_micros ride along from real dialects and
stay None for scripted adapters that predate cost accounting.
Fields§
§message: Payload§calls: Vec<ToolCall>§usage: Option<ModelUsage>§stop: Option<StopReason>§billed_usd_micros: Option<UsdMicros>Implementations§
Source§impl ModelReturn
impl ModelReturn
Sourcepub fn bare(message: Payload, calls: Vec<ToolCall>) -> ModelReturn
pub fn bare(message: Payload, calls: Vec<ToolCall>) -> ModelReturn
Scripted/minimal construction: content and wave only.
Sourcepub fn from_response(
resp: ChatResponse,
billed_usd_micros: Option<UsdMicros>,
) -> Result<ModelReturn, AxError>
pub fn from_response( resp: ChatResponse, billed_usd_micros: Option<UsdMicros>, ) -> Result<ModelReturn, AxError>
The one mapping from canonical response to seam return: tool_use blocks become the wave, everything is kept for the account.
Trait Implementations§
Source§impl Clone for ModelReturn
impl Clone for ModelReturn
Source§impl Debug for ModelReturn
impl Debug for ModelReturn
Source§impl<'de> Deserialize<'de> for ModelReturn
impl<'de> Deserialize<'de> for ModelReturn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelReturn
impl PartialEq for ModelReturn
Source§impl Serialize for ModelReturn
impl Serialize for ModelReturn
impl StructuralPartialEq for ModelReturn
Auto Trait Implementations§
impl Freeze for ModelReturn
impl RefUnwindSafe for ModelReturn
impl Send for ModelReturn
impl Sync for ModelReturn
impl Unpin for ModelReturn
impl UnsafeUnpin for ModelReturn
impl UnwindSafe for ModelReturn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more