pub struct EmbeddingsParameters {
pub dimension: Option<u16>,
pub output_type: Option<String>,
pub instruct: Option<String>,
}
Fields§
§dimension: Option<u16>
向量维度,可选值: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。
output_type: Option<String>
用户指定输出离散向量表示只适用于text_embedding_v3与text_embedding_v4模型,取值在dense、sparse、dense&sparse之间,默认取dense,只输出连续向量。
instruct: Option<String>
添加自定义任务说明,仅在使用 text-embedding-v4 模型且 text_type 为 query 时生效。建议使用英文撰写,通常可带来约 1%–5% 的效果提升。
Trait Implementations§
Source§impl Clone for EmbeddingsParameters
impl Clone for EmbeddingsParameters
Source§fn clone(&self) -> EmbeddingsParameters
fn clone(&self) -> EmbeddingsParameters
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 EmbeddingsParameters
impl Debug for EmbeddingsParameters
Source§impl<'de> Deserialize<'de> for EmbeddingsParameters
impl<'de> Deserialize<'de> for EmbeddingsParameters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for EmbeddingsParameters
impl PartialEq for EmbeddingsParameters
Source§impl Serialize for EmbeddingsParameters
impl Serialize for EmbeddingsParameters
Source§impl Validator<EmbeddingsParameters> for ModelValidator
impl Validator<EmbeddingsParameters> for ModelValidator
Source§fn validate<R: RequestTrait<P = EmbeddingsParameters> + ?Sized>(
&self,
params: &R,
) -> Result<()>
fn validate<R: RequestTrait<P = EmbeddingsParameters> + ?Sized>( &self, params: &R, ) -> Result<()>
验证请求的参数
impl StructuralPartialEq for EmbeddingsParameters
Auto Trait Implementations§
impl Freeze for EmbeddingsParameters
impl RefUnwindSafe for EmbeddingsParameters
impl Send for EmbeddingsParameters
impl Sync for EmbeddingsParameters
impl Unpin for EmbeddingsParameters
impl UnwindSafe for EmbeddingsParameters
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