pub struct ParametersBuilder { /* private fields */ }
Expand description
Builder for Parameters
.
Implementations§
Source§impl ParametersBuilder
impl ParametersBuilder
Sourcepub fn result_format<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn result_format<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
返回数据的格式。推荐优先设置为“message“
Sourcepub fn translation_options(&mut self, value: TranslationOptions) -> &mut Self
pub fn translation_options(&mut self, value: TranslationOptions) -> &mut Self
当您使用翻译模型时需要配置的翻译参数。
pub fn incremental_output<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
pub fn tools<VALUE: Into<Vec<FunctionCall>>>( &mut self, value: VALUE, ) -> &mut Self
Sourcepub fn parallel_tool_calls<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn parallel_tool_calls<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
是否开启并行工具调用。参数为true时开启,为false时不开启。并行工具调用详情请参见:并行工具调用。
pub fn thinking_budget<VALUE: Into<usize>>(&mut self, value: VALUE) -> &mut Self
pub fn enable_search<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn search_options<VALUE: Into<SearchOptions>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn search_options<VALUE: Into<SearchOptions>>( &mut self, value: VALUE, ) -> &mut Self
联网搜索的策略。仅当enable_search为true时生效。
Sourcepub fn enable_thinking<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn enable_thinking<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
只支持 qwen3, 对 QwQ 与 DeepSeek-R1 模型无效。
pub fn response_format<VALUE: Into<ResponseFormat>>( &mut self, value: VALUE, ) -> &mut Self
Sourcepub fn repetition_penalty<VALUE: Into<f64>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn repetition_penalty<VALUE: Into<f64>>( &mut self, value: VALUE, ) -> &mut Self
模型生成时连续序列中的重复度。提高repetition_penalty时可以降低模型生成的重复度,1.0表示不做惩罚。没有严格的取值范围,只要大于0即可。
Sourcepub fn presence_penalty<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn presence_penalty<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
控制模型生成文本时的内容重复度。
取值范围:[-2.0, 2.0]。正数会减少重复度,负数会增加重复度。
适用场景:
- 较高的presence_penalty适用于要求多样性、趣味性或创造性的场景,如创意写作或头脑风暴。
- 较低的presence_penalty适用于要求一致性或专业术语的场景,如技术文档或其他正式文档。
Sourcepub fn vl_high_resolution_images<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn vl_high_resolution_images<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
是否提高输入图片的默认Token上限。输入图片的默认Token上限为1280,配置为true时输入图片的Token上限为16384。
Sourcepub fn vl_enable_image_hw_output<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn vl_enable_image_hw_output<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
是否返回图像缩放后的尺寸。模型会对输入的图像进行缩放处理,配置为 True 时会返回图像缩放后的高度和宽度,开启流式输出时,该信息在最后一个数据块(chunk)中返回。支持Qwen-VL模型。
Sourcepub fn build(&self) -> Result<Parameters, ParametersBuilderError>
pub fn build(&self) -> Result<Parameters, ParametersBuilderError>
Source§impl ParametersBuilder
impl ParametersBuilder
Trait Implementations§
Source§impl Clone for ParametersBuilder
impl Clone for ParametersBuilder
Source§fn clone(&self) -> ParametersBuilder
fn clone(&self) -> ParametersBuilder
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 moreAuto Trait Implementations§
impl Freeze for ParametersBuilder
impl RefUnwindSafe for ParametersBuilder
impl Send for ParametersBuilder
impl Sync for ParametersBuilder
impl Unpin for ParametersBuilder
impl UnwindSafe for ParametersBuilder
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