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.openai.base-url |
The URL to connect to |
https://api.openai.com |
spring.ai.openai.api-key |
The API Key |
- |
spring.ai.openai.organization-id |
Optionally you can specify which organization used for an API request. |
- |
spring.ai.openai.project-id |
Optionally, you can specify which project is used for an API request. |
- |
For users that belong to multiple organizations (or are accessing their projects through their legacy user API key), optionally, you can specify which organization and project is used for an API request. Usage from these API requests will count as usage for the specified organization and project. |
Property | Description | Default |
---|---|---|
spring.ai.openai.embedding.enabled |
Enable OpenAI embedding model. |
true |
spring.ai.openai.embedding.base-url |
Optional overrides the spring.ai.openai.base-url to provide embedding specific url |
- |
spring.ai.openai.chat.embeddings-path |
The path to append to the base-url |
|
spring.ai.openai.embedding.api-key |
Optional overrides the spring.ai.openai.api-key to provide embedding specific api-key |
- |
spring.ai.openai.embedding.organization-id |
Optionally you can specify which organization used for an API request. |
- |
spring.ai.openai.embedding.project-id |
Optionally, you can specify which project is used for an API request. |
- |
spring.ai.openai.embedding.metadata-mode |
Document content extraction mode. |
EMBED |
spring.ai.openai.embedding.options.model |
The model to use |
text-embedding-ada-002 (other options: text-embedding-3-large, text-embedding-3-small) |
spring.ai.openai.embedding.options.encodingFormat |
The format to return the embeddings in. Can be either float or base64. |
- |
spring.ai.openai.embedding.options.user |
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. |
- |
spring.ai.openai.embedding.options.dimensions |
The number of dimensions the resulting output embeddings should have. Only supported in |
- |
You can override the common spring.ai.openai.base-url and spring.ai.openai.api-key for the ChatModel and EmbeddingModel implementations.
The spring.ai.openai.embedding.base-url and spring.ai.openai.embedding.api-key properties if set take precedence over the common properties.
Similarly, the spring.ai.openai.embedding.base-url and spring.ai.openai.embedding.api-key properties if set take precedence over the common properties.
This is useful if you want to use different OpenAI accounts for different models and different model endpoints.
|
All properties prefixed with spring.ai.openai.embedding.options can be overridden at runtime by adding a request specific Runtime Options to the EmbeddingRequest call.
|
Refer to the Dependency Management section to add the Spring AI BOM to your build file. |
The spring-ai-openai dependency provides access also to the OpenAiChatModel .
For more information about the OpenAiChatModel refer to the OpenAI Chat Client section.
|