|
16 | 16 |
|
17 | 17 | package org.springframework.ai.model.deepseek.autoconfigure; |
18 | 18 |
|
| 19 | +import java.time.Duration; |
| 20 | + |
| 21 | +import jakarta.annotation.Nullable; |
| 22 | + |
19 | 23 | import org.springframework.boot.context.properties.ConfigurationProperties; |
| 24 | +import org.springframework.boot.context.properties.NestedConfigurationProperty; |
| 25 | +import org.springframework.boot.http.client.HttpRedirects; |
20 | 26 | import org.springframework.boot.http.client.autoconfigure.HttpClientSettingsProperties; |
21 | 27 |
|
22 | 28 | /** |
|
25 | 31 | * @author Geng Rong |
26 | 32 | */ |
27 | 33 | @ConfigurationProperties(DeepSeekConnectionProperties.CONFIG_PREFIX) |
28 | | -public class DeepSeekConnectionProperties extends HttpClientSettingsProperties { |
| 34 | +public class DeepSeekConnectionProperties extends DeepSeekParentProperties { |
29 | 35 |
|
30 | 36 | public static final String CONFIG_PREFIX = "spring.ai.deepseek"; |
31 | 37 |
|
32 | | - private String apiKey; |
| 38 | + public static final String DEFAULT_BASE_URL = "https://api.deepseek.com"; |
| 39 | + |
| 40 | + @NestedConfigurationProperty |
| 41 | + private final HttpClientSettingsProperties http = new HttpClientSettingsProperties() { |
| 42 | + }; |
| 43 | + |
| 44 | + public DeepSeekConnectionProperties() { |
| 45 | + super.setBaseUrl(DEFAULT_BASE_URL); |
| 46 | + } |
| 47 | + |
| 48 | + @Nullable |
| 49 | + public HttpRedirects getRedirects() { |
| 50 | + return this.http.getRedirects(); |
| 51 | + } |
| 52 | + |
| 53 | + public void setRedirects(HttpRedirects redirects) { |
| 54 | + this.http.setRedirects(redirects); |
| 55 | + } |
33 | 56 |
|
34 | | - private String baseUrl = "https://api.deepseek.com"; |
| 57 | + @Nullable |
| 58 | + public Duration getConnectTimeout() { |
| 59 | + return this.http.getConnectTimeout(); |
| 60 | + } |
| 61 | + |
| 62 | + public void setConnectTimeout(Duration connectTimeout) { |
| 63 | + this.http.setConnectTimeout(connectTimeout); |
| 64 | + } |
35 | 65 |
|
36 | | - public String getApiKey() { |
37 | | - return this.apiKey; |
| 66 | + @Nullable |
| 67 | + public Duration getReadTimeout() { |
| 68 | + return this.http.getReadTimeout(); |
38 | 69 | } |
39 | 70 |
|
40 | | - public void setApiKey(String apiKey) { |
41 | | - this.apiKey = apiKey; |
| 71 | + public void setReadTimeout(Duration readTimeout) { |
| 72 | + this.http.setReadTimeout(readTimeout); |
42 | 73 | } |
43 | 74 |
|
44 | | - public String getBaseUrl() { |
45 | | - return this.baseUrl; |
| 75 | + public HttpClientSettingsProperties.Ssl getSsl() { |
| 76 | + return this.http.getSsl(); |
46 | 77 | } |
47 | 78 |
|
48 | | - public void setBaseUrl(String baseUrl) { |
49 | | - this.baseUrl = baseUrl; |
| 79 | + public HttpClientSettingsProperties getHttp() { |
| 80 | + return this.http; |
50 | 81 | } |
51 | 82 |
|
52 | 83 | } |
0 commit comments