pub enum Outcome {
Show 22 variants
Value(Value),
Chat(Box<Chat>),
Agent(Box<Chat>),
Message(Box<Message>),
ToolCall(ToolCall),
Answer(Answer),
Judgment(Box<Judgment>),
Embedding(Box<Embedding>),
Transcription(Box<Transcription>),
Ocr(Box<Ocr>),
Rerank(Box<Rerank>),
Moderation(Box<Moderation>),
ModerationResult(ModerationResult),
Tokenization(Tokenization),
ServerToolCall(ServerToolCall),
Image(Box<Image>),
Video(Box<Video>),
Speech(Box<Speech>),
Attachment(Attachment),
List(Vec<Outcome>),
Map(Vec<(String, Outcome)>),
Other(Box<dyn Any + Send + Sync>),
}Expand description
What perform returned. Ruby returns any object; the port names the kinds it can evaluate.
Outcome::Agent is a chat an agent built (Agent.new.chat), kept apart only so evidence
can tell they were an agent’s, which Ruby normalizes to the same data as the chat.
Variants§
Value(Value)
JSON data: strings, numbers, booleans, null, arrays, objects.
Chat(Box<Chat>)
Agent(Box<Chat>)
Message(Box<Message>)
ToolCall(ToolCall)
Answer(Answer)
Judgment(Box<Judgment>)
Embedding(Box<Embedding>)
Transcription(Box<Transcription>)
Ocr(Box<Ocr>)
Rerank(Box<Rerank>)
Moderation(Box<Moderation>)
ModerationResult(ModerationResult)
Tokenization(Tokenization)
ServerToolCall(ServerToolCall)
Image(Box<Image>)
Video(Box<Video>)
Speech(Box<Speech>)
Attachment(Attachment)
List(Vec<Outcome>)
An array of outcomes ([agent, { second: chat }]).
Map(Vec<(String, Outcome)>)
An object whose values are outcomes.
Other(Box<dyn Any + Send + Sync>)
Any other type; it needs an adapter.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn other<T: Any + Send + Sync>(value: T) -> Outcome
pub fn other<T: Any + Send + Sync>(value: T) -> Outcome
Any other type, converted by an adapter declared for it.
Sourcepub fn chat(&self) -> Option<&Chat>
pub fn chat(&self) -> Option<&Chat>
The returned chat (or the agent’s chat), when perform returned one.
Trait Implementations§
Source§impl From<Attachment> for Outcome
impl From<Attachment> for Outcome
Source§fn from(v: Attachment) -> Outcome
fn from(v: Attachment) -> Outcome
Converts to this type from the input type.
Source§impl From<Moderation> for Outcome
impl From<Moderation> for Outcome
Source§fn from(v: Moderation) -> Outcome
fn from(v: Moderation) -> Outcome
Converts to this type from the input type.
Source§impl From<ModerationResult> for Outcome
impl From<ModerationResult> for Outcome
Source§fn from(v: ModerationResult) -> Outcome
fn from(v: ModerationResult) -> Outcome
Converts to this type from the input type.
Source§impl From<Tokenization> for Outcome
impl From<Tokenization> for Outcome
Source§fn from(v: Tokenization) -> Outcome
fn from(v: Tokenization) -> Outcome
Converts to this type from the input type.
Source§impl From<Transcription> for Outcome
impl From<Transcription> for Outcome
Source§fn from(v: Transcription) -> Outcome
fn from(v: Transcription) -> Outcome
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Outcome
impl !UnwindSafe for Outcome
impl Freeze for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
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