mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-13 20:53:42 +08:00
fix(chat): 修复依赖版本升级导致缺少类错误
This commit is contained in:
@@ -26,11 +26,18 @@ public class ChatRequest {
|
||||
*/
|
||||
private String prompt;
|
||||
|
||||
|
||||
/**
|
||||
* 系统提示词
|
||||
*/
|
||||
private String sysPrompt;
|
||||
|
||||
|
||||
/**
|
||||
* 消息id
|
||||
*/
|
||||
private Long messageId;
|
||||
|
||||
/**
|
||||
* 是否开启流式对话
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spring-ai.version>1.0.0</spring-ai.version>
|
||||
<spring-ai.version>1.0.0-M7</spring-ai.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -167,12 +167,6 @@ public class ChatCostServiceImpl implements IChatCostService {
|
||||
chatMessageBo.setContent(chatRequest.getPrompt().trim());
|
||||
chatMessageBo.setModelName(chatRequest.getModel());
|
||||
|
||||
// // 基础消息信息,计费相关数据(tokens、费用、计费类型等)在扣费时统一设置
|
||||
// chatMessageBo.setTotalTokens(0); // 初始设为0,扣费时更新
|
||||
// chatMessageBo.setDeductCost(null);
|
||||
// chatMessageBo.setBillingType(null);
|
||||
// chatMessageBo.setRemark("用户消息");
|
||||
|
||||
try {
|
||||
chatMessageService.insertByBo(chatMessageBo);
|
||||
// 保存成功后,将生成的消息ID设置到ChatRequest中
|
||||
|
||||
@@ -43,7 +43,7 @@ public class OpenAIServiceImpl implements IChatService {
|
||||
this.chatClient = chatClientBuilder
|
||||
.defaultOptions(
|
||||
OpenAiChatOptions.builder().model("gpt-4o-mini").build())
|
||||
.defaultToolCallbacks(new SyncMcpToolCallbackProvider(mcpSyncClients))
|
||||
.defaultTools(new SyncMcpToolCallbackProvider(mcpSyncClients))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user