feat: 超时配置
This commit is contained in:
parent
35f6b4d8cd
commit
f28cde1148
|
|
@ -0,0 +1,25 @@
|
|||
package cn.kazusa.ai.assistant.config;
|
||||
|
||||
import java.time.Duration;
|
||||
import org.springframework.boot.web.client.ClientHttpRequestFactories;
|
||||
import org.springframework.boot.web.client.ClientHttpRequestFactorySettings;
|
||||
import org.springframework.boot.web.client.RestClientCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author zouzhiwen
|
||||
*/
|
||||
@Configuration
|
||||
public class OllamaConfig {
|
||||
|
||||
@Bean
|
||||
public RestClientCustomizer restClientCustomizer() {
|
||||
return restClientBuilder -> {
|
||||
ClientHttpRequestFactorySettings settings = ClientHttpRequestFactorySettings.DEFAULTS
|
||||
.withConnectTimeout(Duration.ofSeconds(30))
|
||||
.withReadTimeout(Duration.ofMinutes(5));
|
||||
restClientBuilder.requestFactory(ClientHttpRequestFactories.get(settings));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ assistant:
|
|||
domains:
|
||||
- id: general
|
||||
name: 通用知识
|
||||
keywords: []
|
||||
keywords: [ ]
|
||||
- id: warehouse
|
||||
name: 仓库领域知识(订单、入库、移库、调拨、出库等)
|
||||
keywords: []
|
||||
keywords: [ ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue