- 移除IWorkflowTriggerService接口及其实现,改用Mediator模式直接发送命令 - 更新AiBotHandler移除workflowTrigger依赖,使用新命令模式触发工作流 - 修改ApproveTaskEndpoint和RejectTaskEndpoint返回bool类型并使用Send.OkAsync - 更新appsettings.json中AI助手的默认指令配置 - 在BuildFlowHostModule.cs中移除旧的工作流触发服务注册 - 添加SSE流式响应路径前缀配置以支持RAG聊天流 - 重构ChatAgentService使用HTTP客户端工厂和运行时配置解析 - 实现AiChatOutputSanitizer用于清洗AI输出中的模板内容 - 更新EmbeddingService使用运行时配置解析器动态创建客户端 - 调整RAG查询处理器中的系统提示指令内容 - 添加构建流按钮操作的单元测试验证发布和禁用功能 - 扩展即时消息集成测试覆盖文件消息元数据处理场景 - 更新平台权限种子数据添加按钮发布和禁用权限 - 实现AI模型运行时配置解析器支持动态模型切换
34 lines
924 B
C#
34 lines
924 B
C#
using System.Text.Json;
|
|
using BuildFlow.Infrastructure.AI;
|
|
using Microsoft.Extensions.AI;
|
|
using Xunit;
|
|
|
|
namespace BuildFlow.Rag.Tests;
|
|
|
|
/// <summary>
|
|
/// OpenAI 兼容请求载荷测试。确保本地推理模型默认关闭 reasoning 空转阶段。
|
|
/// </summary>
|
|
public class OpenAiCompatibleChatRequestPayloadTests
|
|
{
|
|
[Fact]
|
|
public void BuildJsonShouldDisableReasoningEffort()
|
|
{
|
|
var config = new AiModelRuntimeConfig(
|
|
"qwen/qwen3.6-27b",
|
|
"http://localhost:1234/v1",
|
|
"lm-studio",
|
|
null,
|
|
128,
|
|
0);
|
|
|
|
var json = OpenAiCompatibleChatRequestPayload.BuildJson(
|
|
config,
|
|
[new ChatMessage(ChatRole.User, "你好")],
|
|
"直接回答。");
|
|
|
|
using var document = JsonDocument.Parse(json);
|
|
|
|
Assert.Equal("none", document.RootElement.GetProperty("reasoning_effort").GetString());
|
|
}
|
|
}
|