pub enum RowValue<'a> {
Show 15 variants
MessageQueueContent {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
message_queue_content_id: i64,
},
ToolResponse {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
tool_call_id: &'a str,
},
AssistantResponseRefusal {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
text: &'a str,
},
AssistantResponseReasoning {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
text: &'a str,
},
AssistantResponseToolCalls {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
tool_call_index: u64,
tool_call_id: &'a str,
function_name: &'a str,
arguments: &'a str,
},
AssistantResponseContentText {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
text: &'a str,
},
AssistantResponseContentImage {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
image_url: &'a ImageUrl,
},
AssistantResponseContentAudio {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
input_audio: &'a InputAudio,
},
AssistantResponseContentVideo {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
video_url: &'a VideoUrl,
},
AssistantResponseContentFile {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
file: &'a File,
},
ToolResponseContentText {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
text: &'a str,
},
ToolResponseContentImage {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
image_url: &'a ImageUrl,
},
ToolResponseContentAudio {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
input_audio: &'a InputAudio,
},
ToolResponseContentVideo {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
video_url: &'a VideoUrl,
},
ToolResponseContentFile {
response_id: &'a str,
agent_instance_hierarchy: &'a str,
index: u64,
part_index: u64,
file: &'a File,
},
}Expand description
One streaming-content row to INSERT or UPDATE. Borrowed: every
variant lifts string / media payloads from the owning chunk by
reference. Every variant also carries the enclosing chunk’s
agent_instance_hierarchy so the writer can populate
objectiveai.messages.agent_instance_hierarchy and key the
objectiveai.messages_queue downgrade against the right spawned agent.
Variants§
MessageQueueContent
Consumption signal: the API stamped this
message_queue_contents.id onto the chunk’s
request_message_ids field. The writer’s helper:
- resolves the row’s kind via SQL CASE against
message_queue_contents.kind, UPDATE objectiveai.message_queue SET active=FALSE WHERE id = (SELECT message_queue_id FROM objectiveai.message_queue_contents WHERE id = $content_id) AND active=TRUE, andINSERT objectiveai.messageswith"table"picked from the fivemessage_queue_*enum values matching the kind androw_index = content_id, so the read path dispatches directly to the right per-kind table.
Multiple content_ids sharing one parent fire the flip
once; the rest are no-ops via the AND active=TRUE guard.
Iterators yield these AHEAD of the per-message content rows so the log chronicles consumption before the body the agent produced.
ToolResponse
AssistantResponseRefusal
AssistantResponseReasoning
AssistantResponseToolCalls
Fields
AssistantResponseContentText
Fields
AssistantResponseContentImage
Fields
AssistantResponseContentAudio
Fields
input_audio: &'a InputAudioAssistantResponseContentVideo
Fields
AssistantResponseContentFile
Fields
ToolResponseContentText
Fields
ToolResponseContentImage
Fields
ToolResponseContentAudio
Fields
input_audio: &'a InputAudioToolResponseContentVideo
Fields
ToolResponseContentFile
Implementations§
Source§impl<'a> RowValue<'a>
impl<'a> RowValue<'a>
pub fn table(&self) -> RowTable
Sourcepub fn message_table(&self) -> MessageTable
pub fn message_table(&self) -> MessageTable
MessageTable for this row’s table. Streaming-content rows
always have one — EXCEPT RowValue::ToolResponse, whose head
row emits no messages event (it’s a tool_call_id lookup
only). Callers MUST early-branch ToolResponse before calling
this (write.rs::insert_value/update_value do), or the
.expect() below panics.
Sourcepub fn response_id(&self) -> &'a str
pub fn response_id(&self) -> &'a str
response_id borrowed from the immediately-enclosing
agent-completion chunk’s id. Even for rows emitted under
vector_completion_chunk_rows /
function_execution_chunk_rows, the recursion bottoms out
at an agent-completion chunk and uses that chunk’s id —
never the outer vector/function wrapper’s id. This is what
agents logs read all / read pending use as the
per-block response_id boundary key.
Sourcepub fn agent_instance_hierarchy(&self) -> &'a str
pub fn agent_instance_hierarchy(&self) -> &'a str
agent_instance_hierarchy borrowed from the enclosing
agent-completion chunk. Every streaming-content row lives
inside an agent completion, so this is always non-NULL.
Sourcepub fn row_index(&self) -> i64
pub fn row_index(&self) -> i64
row_index column value for the postgres messages /
messages_queue entry. Always populated for streaming-content
rows.
Sourcepub fn row_sub_index(&self) -> Option<i64>
pub fn row_sub_index(&self) -> Option<i64>
row_sub_index column value: tool_call_index for tool-call
rows, part_index for content-part rows, None for
tool_response / assistant refusal / assistant reasoning (whose
shape has no sub-index). The matching SQL column is nullable.
Sourcepub fn key(&self) -> RowKey<'a>
pub fn key(&self) -> RowKey<'a>
The borrowed key that identifies this row’s slot in postgres.
Hashable + Eq — used by the shadow map to find the previously
stored body without any allocation. Two RowValues targeting
the same row produce equal RowKeys.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for RowValue<'a>
impl<'a> RefUnwindSafe for RowValue<'a>
impl<'a> Send for RowValue<'a>
impl<'a> Sync for RowValue<'a>
impl<'a> Unpin for RowValue<'a>
impl<'a> UnsafeUnpin for RowValue<'a>
impl<'a> UnwindSafe for RowValue<'a>
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
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>
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>
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