pub struct GenerationConfig {Show 21 fields
pub stop_sequences: Option<Vec<String>>,
pub response_mime_type: Option<String>,
pub response_json_schema: Option<Value>,
pub response_modalities: Option<Vec<Modality>>,
pub candidate_count: Option<i32>,
pub max_output_tokens: Option<i32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub seed: Option<i32>,
pub response_logprobs: Option<bool>,
pub logprobs: Option<i32>,
pub enable_enhanced_civic_answers: Option<bool>,
pub speech_config: Option<SpeechConfig>,
pub thinking_config: Option<ThinkingConfig>,
pub image_config: Option<ImageConfig>,
pub media_resolution: Option<MediaResolution>,
pub audio_timestamp: Option<bool>,
pub enable_affective_dialog: Option<bool>,
}Fields§
§stop_sequences: Option<Vec<String>>§response_mime_type: Option<String>§response_json_schema: Option<Value>§response_modalities: Option<Vec<Modality>>§candidate_count: Option<i32>§max_output_tokens: Option<i32>§temperature: Option<f32>§top_p: Option<f32>§top_k: Option<i32>§presence_penalty: Option<f32>§frequency_penalty: Option<f32>§seed: Option<i32>§response_logprobs: Option<bool>§logprobs: Option<i32>§enable_enhanced_civic_answers: Option<bool>§speech_config: Option<SpeechConfig>§thinking_config: Option<ThinkingConfig>§image_config: Option<ImageConfig>§media_resolution: Option<MediaResolution>§audio_timestamp: Option<bool>§enable_affective_dialog: Option<bool>Implementations§
Source§impl GenerationConfig
impl GenerationConfig
pub fn new( stop_sequences: Option<Vec<String>>, response_mime_type: Option<String>, response_json_schema: Option<&Bound<'_, PyAny>>, response_modalities: Option<Vec<Modality>>, thinking_config: Option<ThinkingConfig>, temperature: Option<f32>, top_p: Option<f32>, top_k: Option<i32>, candidate_count: Option<i32>, max_output_tokens: Option<i32>, response_logprobs: Option<bool>, logprobs: Option<i32>, presence_penalty: Option<f32>, frequency_penalty: Option<f32>, seed: Option<i32>, audio_timestamp: Option<bool>, media_resolution: Option<MediaResolution>, speech_config: Option<SpeechConfig>, enable_affective_dialog: Option<bool>, enable_enhanced_civic_answers: Option<bool>, image_config: Option<ImageConfig>, ) -> GenerationConfig
pub fn __str__(&self) -> String
Trait Implementations§
Source§impl Clone for GenerationConfig
impl Clone for GenerationConfig
Source§fn clone(&self) -> GenerationConfig
fn clone(&self) -> GenerationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerationConfig
impl Debug for GenerationConfig
Source§impl Default for GenerationConfig
impl Default for GenerationConfig
Source§fn default() -> GenerationConfig
fn default() -> GenerationConfig
impl DerefToPyAny for GenerationConfig
Source§impl<'de> Deserialize<'de> for GenerationConfigwhere
GenerationConfig: Default,
impl<'de> Deserialize<'de> for GenerationConfigwhere
GenerationConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenerationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenerationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<'a, 'py> FromPyObject<'a, 'py> for GenerationConfigwhere
GenerationConfig: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for GenerationConfigwhere
GenerationConfig: Clone,
Source§type Error = PyClassGuardError<'a, 'py>
type Error = PyClassGuardError<'a, 'py>
Source§fn extract(
obj: Borrowed<'a, 'py, PyAny>,
) -> Result<GenerationConfig, <GenerationConfig as FromPyObject<'a, 'py>>::Error>
fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<GenerationConfig, <GenerationConfig as FromPyObject<'a, 'py>>::Error>
Source§impl<'py> IntoPyObject<'py> for GenerationConfig
impl<'py> IntoPyObject<'py> for GenerationConfig
Source§type Target = GenerationConfig
type Target = GenerationConfig
Source§type Output = Bound<'py, <GenerationConfig as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <GenerationConfig as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<GenerationConfig as IntoPyObject<'py>>::Output, <GenerationConfig as IntoPyObject<'py>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<GenerationConfig as IntoPyObject<'py>>::Output, <GenerationConfig as IntoPyObject<'py>>::Error>
Source§impl PartialEq for GenerationConfig
impl PartialEq for GenerationConfig
Source§impl PyClass for GenerationConfig
impl PyClass for GenerationConfig
Source§impl PyTypeInfo for GenerationConfig
impl PyTypeInfo for GenerationConfig
Source§const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl Serialize for GenerationConfig
impl Serialize for GenerationConfig
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,
impl StructuralPartialEq for GenerationConfig
Auto Trait Implementations§
impl Freeze for GenerationConfig
impl RefUnwindSafe for GenerationConfig
impl Send for GenerationConfig
impl Sync for GenerationConfig
impl Unpin for GenerationConfig
impl UnsafeUnpin for GenerationConfig
impl UnwindSafe for GenerationConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.