This version is still in development and is not considered stable yet. For the latest snapshot version, please use Spring AI 1.0.0-SNAPSHOT! |
Refer to the Dependency Management section to add the Spring AI BOM to your build file. |
Property | Description | Default |
---|---|---|
spring.ai.retry.max-attempts |
Maximum number of retry attempts. |
10 |
spring.ai.retry.backoff.initial-interval |
Initial sleep duration for the exponential backoff policy. |
2 sec. |
spring.ai.retry.backoff.multiplier |
Backoff interval multiplier. |
5 |
spring.ai.retry.backoff.max-interval |
Maximum backoff duration. |
3 min. |
spring.ai.retry.on-client-errors |
If false, throw a NonTransientAiException, and do not attempt retry for |
false |
spring.ai.retry.exclude-on-http-codes |
List of HTTP status codes that should not trigger a retry (e.g. to throw NonTransientAiException). |
empty |
spring.ai.retry.on-http-codes |
List of HTTP status codes that should trigger a retry (e.g. to throw TransientAiException). |
empty |
Property | Description | Default |
---|---|---|
spring.ai.zhipuai.base-url |
The URL to connect to |
|
spring.ai.zhipuai.api-key |
The API Key |
- |
Property | Description | Default |
---|---|---|
spring.ai.zhipuai.chat.enabled |
Enable ZhiPuAI chat model. |
true |
spring.ai.zhipuai.chat.base-url |
Optional overrides the spring.ai.zhipuai.base-url to provide chat specific url |
|
spring.ai.zhipuai.chat.api-key |
Optional overrides the spring.ai.zhipuai.api-key to provide chat specific api-key |
- |
spring.ai.zhipuai.chat.options.model |
This is the ZhiPuAI Chat model to use |
|
spring.ai.zhipuai.chat.options.maxTokens |
The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. |
- |
spring.ai.zhipuai.chat.options.temperature |
What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. |
0.7 |
spring.ai.zhipuai.chat.options.topP |
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.. |
1.0 |
spring.ai.zhipuai.chat.options.stop |
The model will stop generating characters specified by stop, and currently only supports a single stop word in the format of ["stop_word1"] |
- |
spring.ai.zhipuai.chat.options.user |
A unique identifier representing your end-user, which can help ZhiPuAI to monitor and detect abuse. |
- |
spring.ai.zhipuai.chat.options.requestId |
The parameter is passed by the client and must ensure uniqueness. It is used to distinguish the unique identifier for each request. If the client does not provide it, the platform will generate it by default. |
- |
spring.ai.zhipuai.chat.options.doSample |
When do_sample is set to true, the sampling strategy is enabled. If do_sample is false, the sampling strategy parameters temperature and top_p will not take effect. |
true |
You can override the common spring.ai.zhipuai.base-url and spring.ai.zhipuai.api-key for the ChatModel implementations.
The spring.ai.zhipuai.chat.base-url and spring.ai.zhipuai.chat.api-key properties if set take precedence over the common properties.
This is useful if you want to use different ZhiPuAI accounts for different models and different model endpoints.
|
All properties prefixed with spring.ai.zhipuai.chat.options can be overridden at runtime by adding a request specific Runtime Options to the Prompt call.
|
In addition to the model specific ZhiPuAiChatOptions you can use a portable ChatOptions instance, created with the ChatOptionsBuilder#builder(). |
replace the api-key with your ZhiPuAI credentials.
|
Refer to the Dependency Management section to add the Spring AI BOM to your build file. |