Skip to content

Commit 52ae0a0

Browse files
committed
refactor: Add RestClient timeout auto-configuration to selected model and vector-store starters
This commit adds the `spring-ai-autoconfigure-http-client` dependency to the following starters, which internally use RestClient.Builder: - spring-ai-starter-model-anthropic - spring-ai-starter-model-minimax - spring-ai-starter-model-mistral-ai - spring-ai-starter-model-moonshot - spring-ai-starter-model-ollama - spring-ai-starter-model-openai - spring-ai-starter-model-qianfan - spring-ai-starter-model-stability-ai - spring-ai-starter-model-watsonx-ai - spring-ai-starter-model-zhipuai - spring-ai-starter-vector-store-chroma This enables users to configure HTTP timeouts via `spring.ai.http.client.*` properties without defining a RestClientCustomizer bean manually. Signed-off-by: drow724 <[email protected]>
1 parent 72cf5e8 commit 52ae0a0

File tree

10 files changed

+56
-2
lines changed
  • spring-ai-spring-boot-starters
    • spring-ai-starter-model-anthropic
    • spring-ai-starter-model-deepseek
    • spring-ai-starter-model-minimax
    • spring-ai-starter-model-mistral-ai
    • spring-ai-starter-model-ollama
    • spring-ai-starter-model-openai
    • spring-ai-starter-model-stability-ai
    • spring-ai-starter-model-zhipuai
    • spring-ai-starter-vector-store-chroma
  • spring-ai-template-st

10 files changed

+56
-2
lines changed

spring-ai-spring-boot-starters/spring-ai-starter-model-anthropic/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-deepseek/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-minimax/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-mistral-ai/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-ollama/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-openai/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-stability-ai/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
<artifactId>spring-ai-stability-ai</artifactId>
5454
<version>${project.parent.version}</version>
5555
</dependency>
56+
57+
<dependency>
58+
<groupId>org.springframework.ai</groupId>
59+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
60+
<version>${project.parent.version}</version>
61+
</dependency>
5662
</dependencies>
5763

5864
</project>

spring-ai-spring-boot-starters/spring-ai-starter-model-zhipuai/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>spring-ai-autoconfigure-model-chat-memory</artifactId>
6666
<version>${project.parent.version}</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework.ai</groupId>
71+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
72+
<version>${project.parent.version}</version>
73+
</dependency>
6874
</dependencies>
6975

7076
</project>

spring-ai-spring-boot-starters/spring-ai-starter-vector-store-chroma/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
<artifactId>spring-ai-chroma-store</artifactId>
5656
<version>${project.parent.version}</version>
5757
</dependency>
58+
59+
<dependency>
60+
<groupId>org.springframework.ai</groupId>
61+
<artifactId>spring-ai-autoconfigure-http-client</artifactId>
62+
<version>${project.parent.version}</version>
63+
</dependency>
5864
</dependencies>
5965

6066
</project>

spring-ai-template-st/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717

1818
<project xmlns="http://maven.apache.org/POM/4.0.0"
19-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2020
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2121
<modelVersion>4.0.0</modelVersion>
2222
<parent>
@@ -74,4 +74,4 @@
7474
<scope>test</scope>
7575
</dependency>
7676
</dependencies>
77-
</project>
77+
</project>

0 commit comments

Comments
 (0)