ModelProviderType
public enum ModelProviderType
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:34–188定义模型提供者类型的枚举。位于 io.agentscope.micronaut.model 包。核心成员包括 createModel、fromProperties、DASHSCOPE、OPENAI、GEMINI、ANTHROPIC。
Enum-based strategy for creating concrete Model instances from configuration.
枚举常量摘要Enum Constant Summary
| 常量Constant | 说明Description |
|---|---|
DASHSCOPE | 执行DashScope相关操作。 Performs the DASHSCOPE operation. |
OPENAI | 打开AI。 Opens the AI. |
GEMINI | 执行 `GEMINI` 方法。 Performs the GEMINI operation. |
ANTHROPIC | 执行 `ANTHROPIC` 方法。 Performs the ANTHROPIC operation. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public abstract Model createModel(AgentscopeProperties properties)abstract | 创建模型。 Create a concrete `Model` instance using the given properties. |
public static ModelProviderType fromProperties(AgentscopeProperties properties)static | 设置来自属性。 Resolve provider from root properties. |
枚举常量详情Enum Constant Detail
DASHSCOPE
DASHSCOPE("dashscope")
staticfinal
执行DashScope相关操作。
Performs the DASHSCOPE operation.
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:35–61OPENAI
OPENAI("openai")
staticfinal
打开AI。
Opens the AI.
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:62–92GEMINI
GEMINI("gemini")
staticfinal
执行 GEMINI 方法。
Performs the GEMINI operation.
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:93–122ANTHROPIC
ANTHROPIC("anthropic")
staticfinal
执行 ANTHROPIC 方法。
Performs the ANTHROPIC operation.
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:123–149方法详情Method Detail
createModel
public abstract Model createModel(AgentscopeProperties properties)
abstract
创建模型。
Create a concrete Model instance using the given properties.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
properties | AgentscopeProperties | 属性(类型 `AgentscopeProperties`)。The properties. |
Model返回模型。Returns model.
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:160fromProperties
public static ModelProviderType fromProperties(AgentscopeProperties properties)
static
设置来自属性。
Resolve provider from root properties.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
properties | AgentscopeProperties | 属性(类型 `AgentscopeProperties`)。root configuration properties |
ModelProviderType已解析提供者。resolved provider enum
IllegalArgumentException可能抛出 `IllegalArgumentException`。if properties is null
源码Source
io/agentscope/micronaut/model/ModelProviderType.java:170–187