GeminiProperties
@ConfigurationProperties(prefix = "agentscope.gemini") public class GeminiProperties
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:52–158Gemini 属性,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.gemini 包。核心成员包括 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
# base-url: # optional
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 Detail
isEnabled
public boolean isEnabled()
判断是否已启用。
Returns whether the enabled.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:95–97setEnabled
public void setEnabled(boolean enabled)
设置已启用。
Sets the enabled.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
enabled | boolean | 已启用(类型 `boolean`)。The enabled. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:99–101getApiKey
public String getApiKey()
获取API 键。
Returns the api key.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:103–105setApiKey
public void setApiKey(String apiKey)
设置API 键。
Sets the api key.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。The api key. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:107–109getModelName
public String getModelName()
获取模型名称。
Returns the model name.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:111–113setModelName
public void setModelName(String modelName)
设置模型名称。
Sets the model name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。The model name. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:115–117getBaseUrl
public String getBaseUrl()
获取基类 URL。
Returns the base url.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:119–121setBaseUrl
public void setBaseUrl(String baseUrl)
设置基类 URL。
Sets the base url.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。The base url. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:123–125isStream
public boolean isStream()
判断是否流。
Returns whether the stream.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:127–129setStream
public void setStream(boolean stream)
设置流。
Sets the stream.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stream | boolean | 流(类型 `boolean`)。The stream. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:131–133getProject
public String getProject()
获取 getProject。
Returns the project.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:135–137setProject
public void setProject(String project)
设置 setProject。
Sets the project.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
project | String | project(类型 `String`)。The project. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:139–141getLocation
public String getLocation()
获取 getLocation。
Returns the location.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:143–145setLocation
public void setLocation(String location)
设置 setLocation。
Sets the location.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
location | String | location(类型 `String`)。The location. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:147–149getVertexAI
public Boolean getVertexAI()
获取 getVertexAI。
Returns the vertex AI.
Boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:151–153setVertexAI
public void setVertexAI(Boolean vertexAI)
设置 setVertexAI。
Sets the vertex AI.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
vertexAI | Boolean | vertex AI(类型 `Boolean`)。The vertex AI. |
源码Source
io/agentscope/spring/boot/gemini/GeminiProperties.java:155–157