AS AgentScopeAPI 手册 / API Reference

ModelProviderSupport

public final class ModelProviderSupport
源码Source io/agentscope/core/model/ModelProviderSupport.java:19–89

模型提供者 Support,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.model 包。核心成员包括 findAssignableComponent、firstNonBlank、trimToNull、intOption、booleanOption、stringOption。

Shared helpers for model providers.

方法摘要Method Summary

方法Method说明Description
public static T T findAssignableComponent(ModelCreationContext context, Class<T> componentType)
static
查找 `findAssignableComponent`。
Finds the assignable component.
public static String firstNonBlank(String... values)
static
设置该参数。
Performs the first non blank operation.
public static String trimToNull(String value)
static
设置该参数。
Performs the trim to null operation.
public static Integer intOption(ModelCreationContext context, String key)
static
执行 `intOption` 方法。
Performs the int option operation.
public static Boolean booleanOption(ModelCreationContext context, String key)
static
执行 `booleanOption` 方法。
Performs the boolean option operation.
public static String stringOption(ModelCreationContext context, String key)
static
执行 `stringOption` 方法。
Performs the string option operation.

方法详情Method Detail

findAssignableComponent

public static T T findAssignableComponent(ModelCreationContext context, Class<T> componentType)
static

查找 findAssignableComponent。

Finds the assignable component.

参数Parameters
名称Name类型Type说明Description
contextModelCreationContext上下文(类型 `ModelCreationContext`)。The context.
componentTypeClass<T>component 类型(类型 `Class`)。The component type.
返回Returns T
返回T。Returns t.
源码Source io/agentscope/core/model/ModelProviderSupport.java:23–31

firstNonBlank

public static String firstNonBlank(String... values)
static

设置该参数。

Performs the first non blank operation.

参数Parameters
名称Name类型Type说明Description
values varargsString...值(类型 `String...`)。The values.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/model/ModelProviderSupport.java:33–44

trimToNull

public static String trimToNull(String value)
static

设置该参数。

Performs the trim to null operation.

参数Parameters
名称Name类型Type说明Description
valueString值(类型 `String`)。The value.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/model/ModelProviderSupport.java:46–52

intOption

public static Integer intOption(ModelCreationContext context, String key)
static

执行 intOption 方法。

Performs the int option operation.

参数Parameters
名称Name类型Type说明Description
contextModelCreationContext上下文(类型 `ModelCreationContext`)。The context.
keyString键(类型 `String`)。The key.
返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/model/ModelProviderSupport.java:54–64

booleanOption

public static Boolean booleanOption(ModelCreationContext context, String key)
static

执行 booleanOption 方法。

Performs the boolean option operation.

参数Parameters
名称Name类型Type说明Description
contextModelCreationContext上下文(类型 `ModelCreationContext`)。The context.
keyString键(类型 `String`)。The key.
返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/model/ModelProviderSupport.java:66–76

stringOption

public static String stringOption(ModelCreationContext context, String key)
static

执行 stringOption 方法。

Performs the string option operation.

参数Parameters
名称Name类型Type说明Description
contextModelCreationContext上下文(类型 `ModelCreationContext`)。The context.
keyString键(类型 `String`)。The key.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/model/ModelProviderSupport.java:78–88
基于官方固定版本源码静态生成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.