pub struct InferenceResponse {
pub text: String,
pub model_used: String,
pub input_tokens: u64,
pub output_tokens: u64,
}Expand description
One completion result.
Both token counts are host measurements, not provider-reported figures:
the host counts the outgoing payload and the raw driver response with the
same tiktoken convention the agent loop uses for its own turns. A driver
that reports a usage block reaches the session trace with it, never
these fields. model-used is likewise the model string the host sent —
the driver wire format never echoes back a confirmed model name.
Fields§
§text: StringConcatenated text content of the driver’s response.
model_used: StringThe model string the host sent for this call.
input_tokens: u64Host-side token count of the outgoing request payload.
output_tokens: u64Host-side token count of the raw driver response.
Trait Implementations§
Source§impl Clone for InferenceResponse
impl Clone for InferenceResponse
impl ComponentType for InferenceResponse
Source§impl Debug for InferenceResponse
impl Debug for InferenceResponse
Source§impl<'de> Deserialize<'de> for InferenceResponse
impl<'de> Deserialize<'de> for InferenceResponse
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
impl Lift for InferenceResponse
impl Lower for InferenceResponse
Auto Trait Implementations§
impl Forget for InferenceResponse
impl Freeze for InferenceResponse
impl Move for InferenceResponse
impl RefUnwindSafe for InferenceResponse
impl Send for InferenceResponse
impl Sync for InferenceResponse
impl Unpin for InferenceResponse
impl UnsafeUnpin for InferenceResponse
impl UnwindSafe for InferenceResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more