AS AgentScopeAPI 手册 / API Reference

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–61

OPENAI

OPENAI("openai")
staticfinal

打开AI。

Opens the AI.

源码Source io/agentscope/micronaut/model/ModelProviderType.java:62–92

GEMINI

GEMINI("gemini")
staticfinal

执行 GEMINI 方法。

Performs the GEMINI operation.

源码Source io/agentscope/micronaut/model/ModelProviderType.java:93–122

ANTHROPIC

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
propertiesAgentscopeProperties属性(类型 `AgentscopeProperties`)。The properties.
返回Returns Model
返回模型。Returns model.
源码Source io/agentscope/micronaut/model/ModelProviderType.java:160

fromProperties

public static ModelProviderType fromProperties(AgentscopeProperties properties)
static

设置来自属性。

Resolve provider from root properties.

参数Parameters
名称Name类型Type说明Description
propertiesAgentscopeProperties属性(类型 `AgentscopeProperties`)。root configuration properties
返回Returns ModelProviderType
已解析提供者。resolved provider enum
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if properties is null
源码Source io/agentscope/micronaut/model/ModelProviderType.java:170–187
基于官方固定版本源码静态生成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.