refactor: 删除不再使用的缓存和测试文件
This commit is contained in:
parent
e23ed4242c
commit
6510fab54b
32
cache.ts
32
cache.ts
@ -1,32 +0,0 @@
|
||||
import { z } from "zod"
|
||||
|
||||
const groupAgentConfig = z
|
||||
.object({
|
||||
isGroupChat: z.boolean().describe("是否是群聊问答"),
|
||||
startTime: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("开始时间,格式为 YYYY-MM-DD HH:mm:ss"),
|
||||
endTime: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("结束时间,格式为 YYYY-MM-DD HH:mm:ss"),
|
||||
userQueryResponse: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("如果不是群聊问答的对用户Query的回复"),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
if (data.isGroupChat) {
|
||||
return data.startTime && data.endTime
|
||||
} else {
|
||||
return data.userQueryResponse
|
||||
}
|
||||
},
|
||||
{
|
||||
message:
|
||||
"isGroupChat 为 true 时需要 startTime 和 endTime,为 false 时需要 userQueryResponse",
|
||||
path: ["isGroupChat"],
|
||||
}
|
||||
)
|
@ -1,5 +0,0 @@
|
||||
|
||||
POST http://localhost:3000/bot?app=egg
|
||||
Content-Type: application/json
|
||||
|
||||
{"open_id":"ou_470ac13b8b50fc472d9d8ee71e03de26","user_id":"zhaoyingbo","open_message_id":"om_3e369929b05b706754f89cd7d54018f3","open_chat_id":"oc_ba33dc55b3dd76bf31e0adfec5e13300","tenant_key":"2ee61fe50f4f1657","token":"c-4f54593c6ff3033652cb70160322905d5598576f","action":{"value":{"cardGroup":"groupAgent","cardName":"groupSelector","groupOptions":[{"text":{"content":"MIAI-FE 人工智能部-前端组","tag":"plain_text"},"value":"oc_ef98c2a9229657f99d4ef573a30fe91c|MIAI-FE 人工智能部-前端组"},{"text":{"content":"方糖の家","tag":"plain_text"},"value":"oc_433b1cb7a9dbb7ebe70a4e1a59cb8bb1|方糖の家"},{"text":{"content":"复现平台需求评审及前后端联调","tag":"plain_text"},"value":"oc_85ec841519b1d4e281ad385e3d045847|复现平台需求评审及前后端联调"},{"text":{"content":"场景复现平台前端上线通知","tag":"plain_text"},"value":"oc_e9750782ba3833afd35e7d29afa25741|场景复现平台前端上线通知"},{"text":{"content":"FE-CloudML","tag":"plain_text"},"value":"oc_07bb9ac6df70d0ae2d267fa0bfbcfb88|FE-CloudML"},{"text":{"content":"Yingbo Zhao","tag":"plain_text"},"value":"oc_51c982ebfc203937d5e8f0a33324bd53|Yingbo Zhao"},{"text":{"content":"小煎蛋测试群","tag":"plain_text"},"value":"oc_8c789ce8f4ecc6695bb63ca6ec4c61ea|小煎蛋测试群"},{"text":{"content":"RAG引擎部署落地","tag":"plain_text"},"value":"oc_09f4c9e07ed199004b4d1276143059dd|RAG引擎部署落地"}],"requestId":"897864dd-8200-42c1-a088-64bab3286095","xAuthor":"AI创新应用组","xIcon":"🔥","xName":"Group Agent"},"tag":"select_static","option":"oc_ef98c2a9229657f99d4ef573a30fe91c|MIAI-FE 人工智能部-前端组"}}
|
@ -1,4 +1,4 @@
|
||||
import llm from "../utils/llm"
|
||||
import llm from "../../utils/llm"
|
||||
|
||||
const userInput = "下个月份的活动"
|
||||
|
@ -1,54 +0,0 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import llm from "../utils/llm"
|
||||
describe("timeParser", () => {
|
||||
const testCases = [
|
||||
{
|
||||
input: "过去五天赵英博说了什么",
|
||||
expected: { s: "2024-11-26 00:00:00", e: "2024-11-30 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "昨天的会议记录",
|
||||
expected: { s: "2024-11-30 00:00:00", e: "2024-11-30 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "上周的销售数据",
|
||||
expected: { s: "2024-11-18 00:00:00", e: "2024-11-24 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "今天的天气",
|
||||
expected: { s: "2024-12-01 00:00:00", e: "2024-12-01 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "上个月的财务报表",
|
||||
expected: { s: "2024-11-01 00:00:00", e: "2024-11-30 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "今年的计划",
|
||||
expected: { s: "2024-01-01 00:00:00", e: "2024-12-31 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "明天的安排",
|
||||
expected: { s: "2024-12-02 00:00:00", e: "2024-12-02 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "下周的会议",
|
||||
expected: { s: "2024-12-02 00:00:00", e: "2024-12-08 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "下个月的活动",
|
||||
expected: { s: "2024-12-01 00:00:00", e: "2024-12-31 23:59:59" },
|
||||
},
|
||||
{
|
||||
input: "明年的目标",
|
||||
expected: { s: "2025-01-01 00:00:00", e: "2025-12-31 23:59:59" },
|
||||
},
|
||||
]
|
||||
|
||||
testCases.forEach(({ input, expected }, index) => {
|
||||
test(`Test case ${index + 1}: ${input}`, async () => {
|
||||
const result = await llm.timeParser(input, `testRequestId${index}`)
|
||||
expect(result).toEqual(expected)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user