更新pom.xml以添加reactor-netty-http依赖,修改ChatApplication以启用LlmApiProperties配置,优化ChatServiceImpl以处理LLM服务的JSON响应,添加内容提取和清理方法,更新application.yml以配置LLM服务的基本URL和日志级别。
This commit is contained in:
28
src/main/java/com/yundage/chat/config/LlmApiProperties.java
Normal file
28
src/main/java/com/yundage/chat/config/LlmApiProperties.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user