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