pub struct ResponseKey {
pub _think: Option<String>,
/* private fields */
}Expand description
Parsed response key from LLM structured output.
Fields§
§_think: Option<String>Optional synthetic reasoning from the LLM.
Implementations§
Source§impl ResponseKey
impl ResponseKey
Sourcepub fn response_format(
vector_response_keys: Vec<String>,
think: bool,
) -> ResponseFormat
pub fn response_format( vector_response_keys: Vec<String>, think: bool, ) -> ResponseFormat
Creates a response format for JSON schema output mode.
Constrains the LLM to output a JSON object with the selected response key.
Sourcepub fn tool(vector_response_keys: Vec<String>, think: bool) -> Tool
pub fn tool(vector_response_keys: Vec<String>, think: bool) -> Tool
Creates a tool definition for tool call output mode.
The LLM calls this tool with the selected response key as an argument.
Sourcepub fn tool_choice() -> ToolChoice
pub fn tool_choice() -> ToolChoice
Creates a tool choice that forces the LLM to call the response_key tool.
Trait Implementations§
Source§impl Debug for ResponseKey
impl Debug for ResponseKey
Source§impl<'de> Deserialize<'de> for ResponseKey
impl<'de> Deserialize<'de> for ResponseKey
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
Auto Trait Implementations§
impl Freeze for ResponseKey
impl RefUnwindSafe for ResponseKey
impl Send for ResponseKey
impl Sync for ResponseKey
impl Unpin for ResponseKey
impl UnwindSafe for ResponseKey
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> 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