Files
prompts-core/README.md
2026-05-12 13:59:15 +08:00

31 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# prompts-core提示词服务[2026.5.12前,暂时弃置]
## 1. 功能范围(当前阶段)
- 仅做提示词配置的基础 CRUD最小可用版本
- 表:`prompts_model_prompt`
## 2. 接口
> 路由注册方式与参考项目一致:使用 `common/http.RouteRegister` 注册 controller。
- `POST /composeMessages`:按 `modelTypeId` 读取 `prompt_info + response_json_schema``modelName` 作为实际调用的网关模型;结合前端 `form(role/value)``userfiles` 调用 `model-gateway /task/createTask`,同步等待回调后直接返回最终 `messages`
- `GET /composeMessagesCallback/prompts-core``model-gateway` 成功回调接口(真实地址由 `callbackUrl + /bizName` 组成)
- `GET /getComposeTask`:按 `taskId` 查询拼接任务状态和结果
- `POST /createPrompt`:创建(默认启用)
- `PUT /updatePrompt`:更新
- `DELETE /deletePrompt`:删除
- `GET /getPrompt`:详情
- `POST /listPrompt`:列表分页
## 3. 数据库初始化
执行根目录 `update.sql`
## 4. 运行配置
配置文件:`config.yml`
### 新增说明
- `prompts_model_prompt` 去除了 `limit_length`
- 新增 `response_json_schema`
- 新增任务记录表 `prompts_compose_task`
- `callbackUrl` 必须填写 prompts-core 的绝对地址基路径,例如:`http://127.0.0.1:8002/composeMessagesCallback`
- `model-gateway` 实际回调地址为:`callbackUrl/{bizName}`,本项目固定为:`/composeMessagesCallback/prompts-core`