Class TextEmbeddingParam.TextEmbeddingParamBuilder<C extends TextEmbeddingParam,B extends TextEmbeddingParam.TextEmbeddingParamBuilder<C,B>>
java.lang.Object
com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder<C,B>
com.alibaba.dashscope.legacy_2x.base.HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C,B>
com.alibaba.dashscope.legacy_2x.embeddings.TextEmbeddingParam.TextEmbeddingParamBuilder<C,B>
- Enclosing class:
- TextEmbeddingParam
public abstract static class TextEmbeddingParam.TextEmbeddingParamBuilder<C extends TextEmbeddingParam,B extends TextEmbeddingParam.TextEmbeddingParamBuilder<C,B>>
extends HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C,B>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()For specifying the output vector dimensions, which is applicable only to the text-embedding-v3 model and above versions.outputType(TextEmbeddingParam.OutputType outputType) The user-specified output for discrete vector representation is only applicable to models of version text_embedding_v3 or above.protected abstract Bself()texts(Collection<? extends String> texts) textType(TextEmbeddingParam.TextType textType) After the text is converted into a vector, it can be applied to downstream tasks such as retrieval, clustering, and classification.toString()Methods inherited from class com.alibaba.dashscope.legacy_2x.base.HalfDuplexServiceParam.HalfDuplexServiceParamBuilder
model, resourcesMethods inherited from class com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder
apiKey, clearHeaders, clearParameters, enableEncrypt, header, headers, parameter, parameters, securityCheck, workspace
-
Constructor Details
-
TextEmbeddingParamBuilder
public TextEmbeddingParamBuilder()
-
-
Method Details
-
text
-
texts
-
clearTexts
-
textType
After the text is converted into a vector, it can be applied to downstream tasks such as retrieval, clustering, and classification. For asymmetric tasks such as retrieval, in order to achieve better retrieval results, it is recommended to distinguish between query text (query) and bottom database text (document) types, clustering Symmetric tasks such as , classification, etc. do not need to be specially specified, and the system default value "document" can be used- Returns:
this.
-
dimension
For specifying the output vector dimensions, which is applicable only to the text-embedding-v3 model and above versions. The specified value can only be selected from the six values: 1024, 768, 512, 256, 128, or 64, with 1024 as the default value.- Returns:
this.
-
outputType
The user-specified output for discrete vector representation is only applicable to models of version text_embedding_v3 or above. The value can be chosen from dense, sparse, or dense&sparse, with dense as the default selection, resulting in the output of continuous vectors only.- Returns:
this.
-
instruct
- Returns:
this.
-
self
- Specified by:
selfin classHalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends TextEmbeddingParam,B extends TextEmbeddingParam.TextEmbeddingParamBuilder<C, B>>
-
build
- Specified by:
buildin classHalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends TextEmbeddingParam,B extends TextEmbeddingParam.TextEmbeddingParamBuilder<C, B>>
-
toString
- Overrides:
toStringin classHalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends TextEmbeddingParam,B extends TextEmbeddingParam.TextEmbeddingParamBuilder<C, B>>
-