AS AgentScopeAPI 手册 / API Reference

GeminiProperties

@ConfigurationProperties("agentscope.gemini") public class GeminiProperties
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:51–144

Gemini 属性,承载智能体的部署、调度与服务化运行。位于 io.agentscope.micronaut.properties 包。核心成员包括 isEnabled、setEnabled、getApiKey、setApiKey、getModelName、setModelName。

Gemini provider specific settings.

Example configuration using direct Gemini API:

`agentscope:
model:
provider: gemini
gemini:
enabled: true
api-key: ${GEMINI_API_KEY}
model-name: gemini-2.0-flash
stream: true
`

Example configuration using Vertex AI:

`agentscope:
model:
provider: gemini
gemini:
enabled: true
project: your-gcp-project-id
location: us-central1
model-name: gemini-2.0-flash
vertex-ai: true
stream: true
`

方法摘要Method Summary

方法Method说明Description
public boolean isEnabled()
判断是否已启用。
Returns whether the enabled.
public void setEnabled(boolean enabled)
设置已启用。
Sets the enabled.
public String getApiKey()
获取API 键。
Returns the api key.
public void setApiKey(String apiKey)
设置API 键。
Sets the api key.
public String getModelName()
获取模型名称。
Returns the model name.
public void setModelName(String modelName)
设置模型名称。
Sets the model name.
public boolean isStream()
判断是否流。
Returns whether the stream.
public void setStream(boolean stream)
设置流。
Sets the stream.
public String getProject()
获取 `getProject`。
Returns the project.
public void setProject(String project)
设置 `setProject`。
Sets the project.
public String getLocation()
获取 `getLocation`。
Returns the location.
public void setLocation(String location)
设置 `setLocation`。
Sets the location.
public Boolean getVertexAI()
获取 `getVertexAI`。
Returns the vertex AI.
public void setVertexAI(Boolean vertexAI)
设置 `setVertexAI`。
Sets the vertex AI.

方法详情Method Detail

isEnabled

public boolean isEnabled()

判断是否已启用。

Returns whether the enabled.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:89–91

setEnabled

public void setEnabled(boolean enabled)

设置已启用。

Sets the enabled.

参数Parameters
名称Name类型Type说明Description
enabledboolean已启用(类型 `boolean`)。The enabled.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:93–95

getApiKey

public String getApiKey()

获取API 键。

Returns the api key.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:97–99

setApiKey

public void setApiKey(String apiKey)

设置API 键。

Sets the api key.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 键(类型 `String`)。The api key.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:101–103

getModelName

public String getModelName()

获取模型名称。

Returns the model name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:105–107

setModelName

public void setModelName(String modelName)

设置模型名称。

Sets the model name.

参数Parameters
名称Name类型Type说明Description
modelNameString模型名称(类型 `String`)。The model name.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:109–111

isStream

public boolean isStream()

判断是否流。

Returns whether the stream.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:113–115

setStream

public void setStream(boolean stream)

设置流。

Sets the stream.

参数Parameters
名称Name类型Type说明Description
streamboolean流(类型 `boolean`)。The stream.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:117–119

getProject

public String getProject()

获取 getProject。

Returns the project.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:121–123

setProject

public void setProject(String project)

设置 setProject。

Sets the project.

参数Parameters
名称Name类型Type说明Description
projectStringproject(类型 `String`)。The project.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:125–127

getLocation

public String getLocation()

获取 getLocation。

Returns the location.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:129–131

setLocation

public void setLocation(String location)

设置 setLocation。

Sets the location.

参数Parameters
名称Name类型Type说明Description
locationStringlocation(类型 `String`)。The location.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:133–135

getVertexAI

public Boolean getVertexAI()

获取 getVertexAI。

Returns the vertex AI.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:137–139

setVertexAI

public void setVertexAI(Boolean vertexAI)

设置 setVertexAI。

Sets the vertex AI.

参数Parameters
名称Name类型Type说明Description
vertexAIBooleanvertex AI(类型 `Boolean`)。The vertex AI.
源码Source io/agentscope/micronaut/properties/GeminiProperties.java:141–143
基于官方固定版本源码静态生成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.