pub enum ResponseFormat {
Yaml,
JsonSchema,
}Expand description
Whether the response should be formatted as YAML (default) or JSON matching a schema.
Used by the prompts module to swap the format-specific portion of a structured prompt without rewriting the semantic instructions.
Variants§
Yaml
Plain YAML, with the prompt asking the model to emit a fenced or bare YAML document.
JsonSchema
JSON object that matches a schema attached via
RequestOptions::response_schema. The prompt drops the YAML
structure literal and tells the model to return only the JSON
object.
Implementations§
Source§impl ResponseFormat
impl ResponseFormat
Sourcepub fn from_capabilities(caps: &AiClientCapabilities) -> Self
pub fn from_capabilities(caps: &AiClientCapabilities) -> Self
Returns the response format that should be used given a backend’s capabilities.
Trait Implementations§
Source§impl Clone for ResponseFormat
impl Clone for ResponseFormat
Source§fn clone(&self) -> ResponseFormat
fn clone(&self) -> ResponseFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseFormat
impl Debug for ResponseFormat
Source§impl Default for ResponseFormat
impl Default for ResponseFormat
Source§fn default() -> ResponseFormat
fn default() -> ResponseFormat
Returns the “default value” for a type. Read more
Source§impl PartialEq for ResponseFormat
impl PartialEq for ResponseFormat
impl Copy for ResponseFormat
impl Eq for ResponseFormat
impl StructuralPartialEq for ResponseFormat
Auto Trait Implementations§
impl Freeze for ResponseFormat
impl RefUnwindSafe for ResponseFormat
impl Send for ResponseFormat
impl Sync for ResponseFormat
impl Unpin for ResponseFormat
impl UnsafeUnpin for ResponseFormat
impl UnwindSafe for ResponseFormat
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.