pub struct Response {
pub id: String,
pub conversation_id: Option<String>,
pub previous_response_id: Option<String>,
pub history_item_ids: Option<String>,
pub metadata: Option<String>,
pub created_at: i64,
}Expand description
LLM API response stored in the database.
Maps to the responses table and represents a single API response
with its metadata and history chain.
Fields§
§id: StringUnique response identifier.
conversation_id: Option<String>Optional conversation this response belongs to.
previous_response_id: Option<String>Optional reference to previous response for chaining.
history_item_ids: Option<String>History item IDs as JSON array string.
metadata: Option<String>Response metadata as JSON object string.
created_at: i64Creation timestamp as Unix timestamp in seconds.
Implementations§
Source§impl Response
impl Response
Sourcepub fn history_item_ids_vec(&self) -> Vec<String>
pub fn history_item_ids_vec(&self) -> Vec<String>
Deserialize history_item_ids from JSON string to Vec
Sourcepub fn metadata_as<T: DeserializeOwned>(&self) -> Option<T>
pub fn metadata_as<T: DeserializeOwned>(&self) -> Option<T>
Deserialize metadata from JSON string to the given type.
Trait Implementations§
Source§impl From<Response> for ResponseData
impl From<Response> for ResponseData
Source§fn from(row: StorageDbResponse) -> Self
fn from(row: StorageDbResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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