pub enum PartEnum {
Reasoning(Reasoning),
Text(Text),
Tool(Tool),
Structured(Value),
File(File),
Embeddings(Embeddings),
}Variants§
Implementations§
Source§impl PartEnum
impl PartEnum
Sourcepub fn from_function_call(fc: FunctionCall) -> PartEnum
pub fn from_function_call(fc: FunctionCall) -> PartEnum
Construct a PartEnum::Tool in the Pending state from a model-emitted call.
Sourcepub fn from_function_response(fr: FunctionResponse) -> PartEnum
pub fn from_function_response(fr: FunctionResponse) -> PartEnum
Construct a PartEnum::Tool that is already Completed with the given response.
Used by deserialization shims and tests. Runtime flows should instead
construct a Pending tool and call Tool::complete after execution.
pub fn tool(&self) -> Option<&Tool>
pub fn function_call(&self) -> Option<FunctionCall>
pub fn function_response(&self) -> Option<FunctionResponse>
pub fn text(&self) -> Option<Text>
pub fn reasoning(&self) -> Option<Reasoning>
pub fn embeddings(&self) -> Option<Embeddings>
pub fn structured(&self) -> Option<Value>
pub fn file(&self) -> Option<File>
pub fn from_reasoning(s: impl Into<String>) -> PartEnum
pub fn from_text(s: impl Into<String>) -> PartEnum
pub fn from_tool(tool: Tool) -> PartEnum
pub fn from_embeddings(embeddings: Embeddings) -> PartEnum
pub fn from_structured(value: Value) -> PartEnum
pub fn from_file(file: File) -> PartEnum
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PartEnum
impl<'de> Deserialize<'de> for PartEnum
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PartEnum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PartEnum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PartEnum
impl Serialize for PartEnum
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PartEnum
Auto Trait Implementations§
impl Freeze for PartEnum
impl RefUnwindSafe for PartEnum
impl Send for PartEnum
impl Sync for PartEnum
impl Unpin for PartEnum
impl UnsafeUnpin for PartEnum
impl UnwindSafe for PartEnum
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