pub struct EmbeddingsParametersBuilder { /* private fields */ }
Expand description
Builder for EmbeddingsParameters
.
Implementations§
Source§impl EmbeddingsParametersBuilder
impl EmbeddingsParametersBuilder
Sourcepub fn dimension<VALUE: Into<u16>>(&mut self, value: VALUE) -> &mut Self
pub fn dimension<VALUE: Into<u16>>(&mut self, value: VALUE) -> &mut Self
向量维度,可选值:768、1024、1536、2048 用于用户指定输出向量维度,只适用于text-embedding-v3与text-embedding-v4模型。指定的值只能在2048(仅适用于text-embedding-v4)、1536(仅适用于text-embedding-v4)1024、768、512、256、128或64八个值之间选取,默认值为1024。
Sourcepub fn output_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn output_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
用户指定输出离散向量表示只适用于text_embedding_v3与text_embedding_v4模型,取值在dense、sparse、dense&sparse之间,默认取dense,只输出连续向量。
Sourcepub fn instruct<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn instruct<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
添加自定义任务说明,仅在使用 text-embedding-v4 模型且 text_type 为 query 时生效。建议使用英文撰写,通常可带来约 1%–5% 的效果提升。
Sourcepub fn build(
&self,
) -> Result<EmbeddingsParameters, EmbeddingsParametersBuilderError>
pub fn build( &self, ) -> Result<EmbeddingsParameters, EmbeddingsParametersBuilderError>
Trait Implementations§
Source§impl Clone for EmbeddingsParametersBuilder
impl Clone for EmbeddingsParametersBuilder
Source§fn clone(&self) -> EmbeddingsParametersBuilder
fn clone(&self) -> EmbeddingsParametersBuilder
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 EmbeddingsParametersBuilder
impl RefUnwindSafe for EmbeddingsParametersBuilder
impl Send for EmbeddingsParametersBuilder
impl Sync for EmbeddingsParametersBuilder
impl Unpin for EmbeddingsParametersBuilder
impl UnwindSafe for EmbeddingsParametersBuilder
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