AS AgentScopeAPI 手册 / API Reference

DashScopeMultiModalEmbedding

public class DashScopeMultiModalEmbedding implements EmbeddingModel
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:56–401

DashScope Multi Modal 向量化,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.embedding.dashscope 包,实现 EmbeddingModel。核心成员包括 builder、embed、getModelName、getDimensions、DashScopeMultiModalEmbedding。

DashScope Multi-Modal Embedding Model implementation.

This implementation provides access to DashScope's multi-modal embedding API, supporting both text and image embedding operations via ContentBlock input. All content types are processed through the MultiModalEmbedding API for consistency.

Supports:

  • TextBlock - via DashScope MultiModalEmbedding API with MultiModalEmbeddingItemText

  • ImageBlock - via DashScope MultiModalEmbedding API with MultiModalEmbeddingItemImage

Other ContentBlock types are not supported and will result in an EmbeddingException.

Supports timeout and retry configuration through ExecutionConfig.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
DashScopeMultiModalEmbedding的构建器。
Builder for DashScopeMultiModalEmbedding.

构造器摘要Constructor Summary

构造器Constructor说明Description
public DashScopeMultiModalEmbedding(String apiKey, String modelName, int dimensions, ExecutionConfig defaultExecutionConfig, String baseUrl)
初始化 `DashScopeMultiModalEmbedding` 实例。
Creates a new DashScope multi-modal embedding model instance.

方法摘要Method Summary

方法Method说明Description
public static Builder builder()
static
创建新的构建器用于 DashScopeMultiModalEmbedding。
Creates a new builder for DashScopeMultiModalEmbedding.
public Mono<double[]> embed(ContentBlock block)
设置该参数。
Performs the embed operation.
public String getModelName()
获取模型名称。
Returns the model name.
public int getDimensions()
获取维度。
Returns the dimensions.

构造器详情Constructor Detail

DashScopeMultiModalEmbedding

public DashScopeMultiModalEmbedding(String apiKey, String modelName, int dimensions, ExecutionConfig defaultExecutionConfig, String baseUrl)

初始化 DashScopeMultiModalEmbedding 实例。

Creates a new DashScope multi-modal embedding model instance.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 键(类型 `String`)。the API key for DashScope authentication
modelNameString模型名称(类型 `String`)。the model name (e.g., "multimodal-embedding-v1")
dimensionsint向量化向量的维度。the dimension of embedding vectors
defaultExecutionConfigExecutionConfig用于超时和重试的默认执行配置。default execution configuration for timeout and retry
baseUrlString基类 URL(类型 `String`)。custom base URL for DashScope API (null for default)
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:77–90

方法详情Method Detail

builder

public static Builder builder()
static

创建新的构建器用于 DashScopeMultiModalEmbedding。

Creates a new builder for DashScopeMultiModalEmbedding.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:97–99

embed

public Mono<double[]> embed(ContentBlock block)

设置该参数。

Performs the embed operation.

参数Parameters
名称Name类型Type说明Description
blockContentBlock内容块(类型 `ContentBlock`)。The block.
返回Returns Mono<double[]>
返回Mono。Returns mono.
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:101–140

getModelName

public String getModelName()

获取模型名称。

Returns the model name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:297–300

getDimensions

public int getDimensions()

获取维度。

Returns the dimensions.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:302–305

嵌套类详情Nested Class Detail

Builder

public static class Builder

DashScopeMultiModalEmbedding的构建器。位于 io.agentscope.core.embedding.dashscope 包。核心成员包括 apiKey、modelName、dimensions、executionConfig、baseUrl、build。

Builder for DashScopeMultiModalEmbedding.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.