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!spring-doc.cn

Refer to the Dependency Management section to add the Spring AI BOM to your build file.
Property Description Default

spring.ai.retry.max-attemptsspring-doc.cn

Maximum number of retry attempts.spring-doc.cn

10spring-doc.cn

spring.ai.retry.backoff.initial-intervalspring-doc.cn

Initial sleep duration for the exponential backoff policy.spring-doc.cn

2 sec.spring-doc.cn

spring.ai.retry.backoff.multiplierspring-doc.cn

Backoff interval multiplier.spring-doc.cn

5spring-doc.cn

spring.ai.retry.backoff.max-intervalspring-doc.cn

Maximum backoff duration.spring-doc.cn

3 min.spring-doc.cn

spring.ai.retry.on-client-errorsspring-doc.cn

If false, throw a NonTransientAiException, and do not attempt retry for 4xx client error codesspring-doc.cn

falsespring-doc.cn

spring.ai.retry.exclude-on-http-codesspring-doc.cn

List of HTTP status codes that should not trigger a retry (e.g. to throw NonTransientAiException).spring-doc.cn

emptyspring-doc.cn

spring.ai.retry.on-http-codesspring-doc.cn

List of HTTP status codes that should trigger a retry (e.g. to throw TransientAiException).spring-doc.cn

emptyspring-doc.cn

Property Description Default

spring.ai.openai.base-urlspring-doc.cn

The URL to connect tospring-doc.cn

https://api.openai.comspring-doc.cn

spring.ai.openai.api-keyspring-doc.cn

The API Keyspring-doc.cn

-spring-doc.cn

spring.ai.openai.organization-idspring-doc.cn

Optionally you can specify which organization used for an API request.spring-doc.cn

-spring-doc.cn

spring.ai.openai.project-idspring-doc.cn

Optionally, you can specify which project is used for an API request.spring-doc.cn

-spring-doc.cn

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.enabledspring-doc.cn

Enable OpenAI embedding model.spring-doc.cn

truespring-doc.cn

spring.ai.openai.embedding.base-urlspring-doc.cn

Optional overrides the spring.ai.openai.base-url to provide embedding specific urlspring-doc.cn

-spring-doc.cn

spring.ai.openai.chat.embeddings-pathspring-doc.cn

The path to append to the base-urlspring-doc.cn

/v1/embeddingsspring-doc.cn

spring.ai.openai.embedding.api-keyspring-doc.cn

Optional overrides the spring.ai.openai.api-key to provide embedding specific api-keyspring-doc.cn

-spring-doc.cn

spring.ai.openai.embedding.organization-idspring-doc.cn

Optionally you can specify which organization used for an API request.spring-doc.cn

-spring-doc.cn

spring.ai.openai.embedding.project-idspring-doc.cn

Optionally, you can specify which project is used for an API request.spring-doc.cn

-spring-doc.cn

spring.ai.openai.embedding.metadata-modespring-doc.cn

Document content extraction mode.spring-doc.cn

EMBEDspring-doc.cn

spring.ai.openai.embedding.options.modelspring-doc.cn

The model to usespring-doc.cn

text-embedding-ada-002 (other options: text-embedding-3-large, text-embedding-3-small)spring-doc.cn

spring.ai.openai.embedding.options.encodingFormatspring-doc.cn

The format to return the embeddings in. Can be either float or base64.spring-doc.cn

-spring-doc.cn

spring.ai.openai.embedding.options.userspring-doc.cn

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.spring-doc.cn

-spring-doc.cn

spring.ai.openai.embedding.options.dimensionsspring-doc.cn

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.spring-doc.cn

-spring-doc.cn

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.