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.qianfan.base-url |
The URL to connect to |
|
spring.ai.qianfan.api-key |
The API Key |
- |
spring.ai.qianfan.secret-key |
The Secret Key |
- |
Property | Description | Default |
---|---|---|
spring.ai.qianfan.chat.enabled |
Enable QianFan chat client. |
true |
spring.ai.qianfan.chat.base-url |
Optional overrides the spring.ai.qianfan.base-url to provide chat specific url |
|
spring.ai.qianfan.chat.api-key |
Optional overrides the spring.ai.qianfan.api-key to provide chat specific api-key |
- |
spring.ai.qianfan.chat.secret-key |
Optional overrides the spring.ai.qianfan.secret-key to provide chat specific secret-key |
- |
spring.ai.qianfan.chat.options.model |
This is the QianFan Chat model to use |
|
spring.ai.qianfan.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.qianfan.chat.options.temperature |
The sampling temperature to use that controls the apparent creativity of generated completions. Higher values will make output more random while lower values will make results more focused and deterministic. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict. |
0.7 |
spring.ai.qianfan.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.qianfan.chat.options.presencePenalty |
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics. |
0.0f |
spring.ai.qianfan.chat.options.frequencyPenalty |
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. |
0.0f |
spring.ai.qianfan.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"] |
- |
You can override the common spring.ai.qianfan.base-url , spring.ai.qianfan.chat.api-key and spring.ai.qianfan.chat.secret-key for the ChatClient implementations.
The spring.ai.qianfan.chat.base-url , spring.ai.qianfan.chat.api-key and spring.ai.qianfan.chat.secret-key properties if set take precedence over the common properties.
This is useful if you want to use different QianFan accounts for different models and different model endpoints.
|
All properties prefixed with spring.ai.qianfan.chat.options can be overridden at runtime by adding a request specific Runtime Options to the Prompt call.
|
In addition to the model specific QianFanChatOptions you can use a portable ChatOptions instance, created with the ChatOptionsBuilder#builder(). |
replace the api-key and secret-key with your QianFan credentials.
|
Refer to the Dependency Management section to add the Spring AI BOM to your build file. |