更新pom.xml以添加reactor-netty-http依赖,修改ChatApplication以启用LlmApiProperties配置,优化ChatServiceImpl以处理LLM服务的JSON响应,添加内容提取和清理方法,更新application.yml以配置LLM服务的基本URL和日志级别。

This commit is contained in:
zyh
2025-07-21 16:16:52 +08:00
parent eb5c54e4a7
commit f4b54e7dc0
7 changed files with 281 additions and 16 deletions

View File

@@ -0,0 +1,28 @@
package com.yundage.chat.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* LLM API配置属性类
*/
@ConfigurationProperties(prefix = "llm")
public class LlmApiProperties {
private String baseUrl;
private String apiKey; // 可选,预留未来认证使用
public String getBaseUrl() {
return baseUrl;
}
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}