Skip to main content

Input

Struct Input 

Source
pub struct Input {
Show 26 fields pub disable_search: Option<bool>, pub enable_search_classifier: Option<bool>, pub image_domain_filter: Option<Vec<String>>, pub image_format_filter: Option<Vec<String>>, pub language_preference: Option<String>, pub last_updated_after_filter: Option<String>, pub last_updated_before_filter: Option<String>, pub max_tokens: Option<i64>, pub messages: Vec<Message>, pub model: InputModel, pub reasoning_effort: Option<InputReasoningEffort>, pub response_format: Option<ResponseFormat>, pub return_images: Option<bool>, pub return_related_questions: Option<bool>, pub search_after_date_filter: Option<String>, pub search_before_date_filter: Option<String>, pub search_domain_filter: Option<Vec<String>>, pub search_language_filter: Option<Vec<String>>, pub search_mode: Option<InputSearchMode>, pub search_recency_filter: Option<InputSearchRecencyFilter>, pub stop: Option<InputStop>, pub stream: Option<bool>, pub stream_mode: Option<InputStreamMode>, pub temperature: Option<f64>, pub top_p: Option<f64>, pub web_search_options: Option<WebSearchOptions>,
}
Expand description

Generates a chat completion response for a provided conversation history (messages). Supports optional streaming, response formatting (plain text or JSON schema), and web search configuration.

Fields§

§disable_search: Option<bool>

Disable search.

§enable_search_classifier: Option<bool>

Enable search classifier.

§image_domain_filter: Option<Vec<String>>

Image domain filter list.

§image_format_filter: Option<Vec<String>>

Image format filter list.

§language_preference: Option<String>

Language preference (string format not specified).

§last_updated_after_filter: Option<String>

Last-updated-after filter (string format not specified).

§last_updated_before_filter: Option<String>

Last-updated-before filter (string format not specified).

§max_tokens: Option<i64>

Maximum tokens to generate.

§messages: Vec<Message>

Array of messages forming the conversation history.

§model: InputModel

Model to use. Supported values for sync: sonar, sonar-pro, sonar-reasoning-pro. Do NOT use sonar-deep-research on this endpoint because it will timeout with 502 Bad Gateway.

§reasoning_effort: Option<InputReasoningEffort>

Reasoning effort.

§response_format: Option<ResponseFormat>

Response formatting control. One of: { "type": "text" } or { "type": "json_schema", "json_schema": <JSONSchema> } or null.

§return_images: Option<bool>

Whether to return images.

§return_related_questions: Option<bool>

Whether to return related questions.

§search_after_date_filter: Option<String>

Search after date filter (string format not specified).

§search_before_date_filter: Option<String>

Search before date filter (string format not specified).

§search_domain_filter: Option<Vec<String>>

Domain filter list.

§search_language_filter: Option<Vec<String>>

Language filter list.

§search_mode: Option<InputSearchMode>

Search mode.

§search_recency_filter: Option<InputSearchRecencyFilter>

Search recency filter.

§stop: Option<InputStop>

Stop sequence(s).

§stream: Option<bool>

Whether to stream the response.

§stream_mode: Option<InputStreamMode>

Streaming event format mode. Default: full.

§temperature: Option<f64>

Sampling temperature.

§top_p: Option<f64>

Nucleus sampling parameter.

§web_search_options: Option<WebSearchOptions>

Implementations§

Trait Implementations§

Source§

impl Clone for Input

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Input

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Input

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<Input> for Input

Source§

fn from(value: Input) -> Self

Converts to this type from the input type.
Source§

impl IntoOperation for Input

Source§

type Output = Output

The type the response decodes to.
Source§

fn into_operation(self) -> Result<Operation<Output>, Error>

Builds the operation, failing when the input does not validate.
Source§

impl Serialize for Input

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<Input> for Input

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Input) -> Result<Self, ConversionError>

Performs the conversion.

Auto Trait Implementations§

§

impl Forget for Input

§

impl Freeze for Input
where *const u8 is !null: Freeze, PhantomData<String>: Freeze, PhantomData<u8>: Freeze, PhantomData<Message>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for Input

§

impl RefUnwindSafe for Input

§

impl Send for Input
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for Input
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for Input
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for Input

§

impl UnwindSafe for Input
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more