Compare commits
No commits in common. "078f46c0281ec0951fd3daa80511a2dd3317488b" and "70b646700b1c06f5caf2ab8a7c384492d3d9f5cb" have entirely different histories.
078f46c028
...
70b646700b
|
|
@ -13,7 +13,5 @@ public class AiServiceConfig {
|
||||||
|
|
||||||
private int timeout = 5000;
|
private int timeout = 5000;
|
||||||
|
|
||||||
private String tenantId = "default@ash@2026";
|
private String tenantId = "szmp@ash@2026";
|
||||||
|
|
||||||
private String apiKey = "tDXu09--IZutcI2h06DCR5WkK9Oi9waTKyUxhaxl5oE";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public class RestTemplateConfig {
|
||||||
public RestTemplate restTemplate() {
|
public RestTemplate restTemplate() {
|
||||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||||
factory.setConnectTimeout(5000);
|
factory.setConnectTimeout(5000);
|
||||||
factory.setReadTimeout(60000);
|
factory.setReadTimeout(30000);
|
||||||
return new RestTemplate(factory);
|
return new RestTemplate(factory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import java.util.List;
|
||||||
@ConfigurationProperties(prefix = "transfer")
|
@ConfigurationProperties(prefix = "transfer")
|
||||||
public class TransferConfig {
|
public class TransferConfig {
|
||||||
|
|
||||||
private boolean enabled = true;
|
|
||||||
private List<String> keywords;
|
private List<String> keywords;
|
||||||
private double confidenceThreshold;
|
private double confidenceThreshold;
|
||||||
private int maxFailRounds;
|
private int maxFailRounds;
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@ public class TransferService {
|
||||||
private final TransferConfig transferConfig;
|
private final TransferConfig transferConfig;
|
||||||
|
|
||||||
public boolean shouldTransferToManual(String message, double confidence, int messageCount, LocalDateTime sessionCreatedAt) {
|
public boolean shouldTransferToManual(String message, double confidence, int messageCount, LocalDateTime sessionCreatedAt) {
|
||||||
if (!transferConfig.isEnabled()) {
|
|
||||||
log.info("转人工功能已关闭,不转人工");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (containsKeywords(message)) {
|
if (containsKeywords(message)) {
|
||||||
log.info("触发转人工: 关键词匹配");
|
log.info("触发转人工: 关键词匹配");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,6 @@ public class AiServiceClientImpl implements AiServiceClient {
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
headers.set("X-Tenant-Id", aiServiceConfig.getTenantId());
|
headers.set("X-Tenant-Id", aiServiceConfig.getTenantId());
|
||||||
headers.set("X-API-Key", aiServiceConfig.getApiKey());
|
|
||||||
|
|
||||||
HttpEntity<ChatRequest> entity = new HttpEntity<>(request, headers);
|
HttpEntity<ChatRequest> entity = new HttpEntity<>(request, headers);
|
||||||
|
|
||||||
ResponseEntity<ChatResponse> response = restTemplate.postForEntity(
|
ResponseEntity<ChatResponse> response = restTemplate.postForEntity(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
server:
|
server:
|
||||||
port: 8883
|
port: 8080
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
|
|
@ -24,23 +24,21 @@ wecom:
|
||||||
callback-url: /wecom/callback
|
callback-url: /wecom/callback
|
||||||
|
|
||||||
transfer:
|
transfer:
|
||||||
enabled: false
|
|
||||||
keywords:
|
keywords:
|
||||||
- 人工
|
- 人工
|
||||||
- 转人工
|
- 转人工
|
||||||
- 投诉
|
- 投诉
|
||||||
- 客服
|
- 客服
|
||||||
- 人工客服
|
- 人工客服
|
||||||
confidence-threshold: 0.35
|
confidence-threshold: 0.6
|
||||||
max-fail-rounds: 3
|
max-fail-rounds: 3
|
||||||
max-session-duration: 180000000
|
max-session-duration: 180000000
|
||||||
max-message-rounds: 50
|
max-message-rounds: 50
|
||||||
|
|
||||||
ai-service:
|
ai-service:
|
||||||
url: http://ashai.com.cn:8182
|
url: http://localhost:8000
|
||||||
timeout: 30000
|
timeout: 5000
|
||||||
tenantId: szmp@ash@2026
|
tenantId: szmp@ash@2026
|
||||||
apiKey: tDXu09--IZutcI2h06DCR5WkK9Oi9waTKyUxhaxl5oE
|
|
||||||
|
|
||||||
channel:
|
channel:
|
||||||
default-channel: wechat
|
default-channel: wechat
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue