1776654103
@@ -22,5 +22,7 @@
|
||||
"showIndentGuide": false,
|
||||
"spellcheck": false,
|
||||
"foldIndent": false,
|
||||
"userIgnoreFilters": null
|
||||
"userIgnoreFilters": [
|
||||
"calendar/"
|
||||
]
|
||||
}
|
||||
@@ -7,9 +7,8 @@
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"ctime": 1772680366639,
|
||||
"path": "work/移动杭研/开发记录/7.19.0/开发笔记.md",
|
||||
"title": "7.19.0 开发笔记"
|
||||
"ctime": 1775633245210,
|
||||
"path": "work/移动杭研/开发记录/7.20.0/开发笔记 7.20.0.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": false,
|
||||
"note-composer": false,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": false,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": true,
|
||||
"collapse-color-groups": false,
|
||||
"colorGroups": [],
|
||||
"collapse-display": false,
|
||||
"showArrow": false,
|
||||
@@ -17,6 +17,6 @@
|
||||
"repelStrength": 10,
|
||||
"linkStrength": 1,
|
||||
"linkDistance": 250,
|
||||
"scale": 0.09848280266864458,
|
||||
"scale": 0.13807120506649795,
|
||||
"close": true
|
||||
}
|
||||
@@ -1,68 +1,200 @@
|
||||
{
|
||||
"recentFiles": [
|
||||
{
|
||||
"basename": "0103-试用单前置校验信安附件问题-BBOSS张蕊",
|
||||
"path": "work/移动杭研/问题处理/2023-01/0103-试用单前置校验信安附件问题-BBOSS张蕊.md"
|
||||
"basename": "开发笔记 7.20.0",
|
||||
"path": "work/移动杭研/开发记录/7.20.0/开发笔记 7.20.0.md"
|
||||
},
|
||||
{
|
||||
"basename": "claude code buddy",
|
||||
"path": "000-inbox/claude code buddy.md"
|
||||
"basename": "okhttp3",
|
||||
"path": "000-inbox/okhttp3.md"
|
||||
},
|
||||
{
|
||||
"basename": "MCP 请求数统计",
|
||||
"path": "000-inbox/MCP 请求数统计.md"
|
||||
"basename": "MCP 学习",
|
||||
"path": "000-inbox/MCP 学习.md"
|
||||
},
|
||||
{
|
||||
"basename": "需求-命中率计算",
|
||||
"path": "000-inbox/需求-命中率计算.md"
|
||||
"basename": "DDD",
|
||||
"path": "000-inbox/DDD.md"
|
||||
},
|
||||
{
|
||||
"basename": "数据库信息",
|
||||
"path": "work/移动杭研/项目备忘/数据库信息.md"
|
||||
"basename": "个人大纲",
|
||||
"path": "kids-coding/个人大纲.md"
|
||||
},
|
||||
{
|
||||
"basename": "MCP Json 注解",
|
||||
"path": "resource/java/MCP Json 注解.md"
|
||||
},
|
||||
{
|
||||
"basename": "Maven",
|
||||
"path": "resource/java/Maven.md"
|
||||
},
|
||||
{
|
||||
"basename": "JPA 双表查询",
|
||||
"path": "resource/java/JPA 双表查询.md"
|
||||
},
|
||||
{
|
||||
"basename": "JPA 操作规范",
|
||||
"path": "resource/java/JPA 操作规范.md"
|
||||
},
|
||||
{
|
||||
"basename": "ibs-ai 项目梳理",
|
||||
"path": "work/移动杭研/AI 项目/ibs-ai 项目梳理.md"
|
||||
},
|
||||
{
|
||||
"basename": "图纸-IBS 智能体-v1-流量查询 demo",
|
||||
"path": "work/移动杭研/AI 项目/图纸-IBS 智能体-v1-流量查询 demo.md"
|
||||
},
|
||||
{
|
||||
"basename": "词性",
|
||||
"path": "resource/英语/词性.md"
|
||||
},
|
||||
{
|
||||
"basename": "句子",
|
||||
"path": "resource/英语/句子.md"
|
||||
},
|
||||
{
|
||||
"basename": "形容词最高级",
|
||||
"path": "resource/英语/形容词最高级.md"
|
||||
},
|
||||
{
|
||||
"basename": "曹胖学位英语-比较级最高级",
|
||||
"path": "resource/英语/曹胖学位英语-比较级最高级.md"
|
||||
},
|
||||
{
|
||||
"basename": "曹胖学位英语-冠词真题笔记",
|
||||
"path": "resource/英语/曹胖学位英语-冠词真题笔记.md"
|
||||
},
|
||||
{
|
||||
"basename": "python 环境",
|
||||
"path": "resource/python/python 环境.md"
|
||||
},
|
||||
{
|
||||
"basename": "0414-icws.jb51.net 高级配置查询问题",
|
||||
"path": "work/移动杭研/问题处理/2026-04/0414-icws.jb51.net 高级配置查询问题.md"
|
||||
},
|
||||
{
|
||||
"basename": "PowerShell 配置文件",
|
||||
"path": "resource/配置/PowerShell 配置文件.md"
|
||||
},
|
||||
{
|
||||
"basename": "CLAUDE.md",
|
||||
"path": "work/移动杭研/AI 项目/CLAUDE.md.md"
|
||||
},
|
||||
{
|
||||
"basename": "Qwen3.5(通义千问 3.5)系列的多模态图文大模型(Vision-Language Models)",
|
||||
"path": "resource/ai/大模型安装笔记/Qwen3.5(通义千问 3.5)系列的多模态图文大模型(Vision-Language Models).md"
|
||||
"basename": "domain_request 分支梳理",
|
||||
"path": "work/移动杭研/开发记录/7.18.0/domain_request 分支梳理.md"
|
||||
},
|
||||
{
|
||||
"basename": "LLM 三件套",
|
||||
"path": "resource/ai/大模型安装笔记/LLM 三件套.md"
|
||||
"basename": "开发笔记",
|
||||
"path": "work/移动杭研/开发记录/7.18.0/开发笔记.md"
|
||||
},
|
||||
{
|
||||
"basename": "lichunliang",
|
||||
"path": "work/移动杭研/项目备忘/lichunliang.md"
|
||||
"basename": "domain_request 分支梳理 2",
|
||||
"path": "work/移动杭研/开发记录/7.18.0/domain_request 分支梳理 2.md"
|
||||
},
|
||||
{
|
||||
"basename": "ESOP-域名配置需求-新增",
|
||||
"path": "work/移动杭研/业务梳理/运营工单/ESOP-域名配置需求-新增.md"
|
||||
"basename": "开发笔记",
|
||||
"path": "work/移动杭研/开发记录/7.19.0/开发笔记.md"
|
||||
},
|
||||
{
|
||||
"basename": "项目杂记",
|
||||
"path": "work/移动杭研/项目备忘/项目杂记.md"
|
||||
"basename": "资源收纳",
|
||||
"path": "resource/资源收纳.md"
|
||||
},
|
||||
{
|
||||
"basename": "0323-邮件发送异常",
|
||||
"path": "work/移动杭研/问题处理/2026-03/0323-邮件发送异常.md"
|
||||
"basename": "TG 备忘录",
|
||||
"path": "personal/TG 备忘录.md"
|
||||
},
|
||||
{
|
||||
"basename": "jinja",
|
||||
"path": "000-inbox/jinja.md"
|
||||
"basename": "路由器",
|
||||
"path": "personal/路由器.md"
|
||||
},
|
||||
{
|
||||
"basename": "n8n 安装",
|
||||
"path": "resource/组件/n8n 安装.md"
|
||||
"basename": "服务器-香港",
|
||||
"path": "personal/服务器-香港.md"
|
||||
},
|
||||
{
|
||||
"basename": "Docker 核心知识与实战笔记",
|
||||
"path": "resource/系统/Docker 核心知识与实战笔记.md"
|
||||
"basename": "阅读记录",
|
||||
"path": "personal/阅读/阅读记录.md"
|
||||
},
|
||||
{
|
||||
"basename": "VIP Cloud",
|
||||
"path": "resource/系统/VIP Cloud.md"
|
||||
"basename": "漫威电影",
|
||||
"path": "personal/影视/漫威电影.md"
|
||||
},
|
||||
{
|
||||
"basename": "直播源",
|
||||
"path": "personal/影视/直播源.md"
|
||||
},
|
||||
{
|
||||
"basename": "windows",
|
||||
"path": "resource/系统/windows.md"
|
||||
},
|
||||
{
|
||||
"basename": "getHitRatio接口分析",
|
||||
"path": "work/移动杭研/AI 项目/getHitRatio接口分析.md"
|
||||
},
|
||||
{
|
||||
"basename": "settings.local.json",
|
||||
"path": "work/移动杭研/AI 项目/settings.local.json.md"
|
||||
},
|
||||
{
|
||||
"basename": "Rime 快捷键",
|
||||
"path": "resource/工具/rime/Rime 快捷键.md"
|
||||
},
|
||||
{
|
||||
"basename": "Rime YAML Custom Patch 语法笔记",
|
||||
"path": "resource/工具/rime/Rime YAML Custom Patch 语法笔记.md"
|
||||
},
|
||||
{
|
||||
"basename": "Rime 小狼毫",
|
||||
"path": "resource/工具/rime/Rime 小狼毫.md"
|
||||
},
|
||||
{
|
||||
"basename": "x-callback-url",
|
||||
"path": "resource/工具/obsidian/x-callback-url.md"
|
||||
},
|
||||
{
|
||||
"basename": "逆水寒",
|
||||
"path": "personal/游戏/逆水寒.md"
|
||||
},
|
||||
{
|
||||
"basename": "梦幻西游法宝价格",
|
||||
"path": "personal/游戏/梦幻西游法宝价格.md"
|
||||
},
|
||||
{
|
||||
"basename": "梦幻西游",
|
||||
"path": "personal/游戏/梦幻西游.md"
|
||||
},
|
||||
{
|
||||
"basename": "工作经历",
|
||||
"path": "personal/履历/工作经历.md"
|
||||
},
|
||||
{
|
||||
"basename": "2022年",
|
||||
"path": "personal/履历/面试日程/2022年.md"
|
||||
},
|
||||
{
|
||||
"basename": "王欣",
|
||||
"path": "personal/家人/王欣.md"
|
||||
},
|
||||
{
|
||||
"basename": "田昊",
|
||||
"path": "personal/家人/田昊.md"
|
||||
},
|
||||
{
|
||||
"basename": "田秉衡",
|
||||
"path": "personal/家人/田秉衡.md"
|
||||
},
|
||||
{
|
||||
"basename": "牛雅清",
|
||||
"path": "personal/家人/牛雅清.md"
|
||||
},
|
||||
{
|
||||
"basename": "昌平医院",
|
||||
"path": "personal/个人/昌平医院.md"
|
||||
},
|
||||
{
|
||||
"basename": "装机系统",
|
||||
"path": "personal/个人/装机系统.md"
|
||||
}
|
||||
],
|
||||
"omittedPaths": [
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"id": "templater-obsidian",
|
||||
"name": "Templater",
|
||||
"version": "2.18.1",
|
||||
"version": "2.19.1",
|
||||
"description": "Create and use templates",
|
||||
"minAppVersion": "1.5.0",
|
||||
"minAppVersion": "1.12.2",
|
||||
"author": "SilentVoid",
|
||||
"authorUrl": "https://github.com/SilentVoid13",
|
||||
"helpUrl": "https://silentvoid13.github.io/Templater/",
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"excalidraw-export-padding": "number",
|
||||
"excalidraw-export-pngscale": "number",
|
||||
"excalidraw-export-embed-scene": "checkbox",
|
||||
"excalidraw-export-internal-links": "checkbox",
|
||||
"excalidraw-link-prefix": "text",
|
||||
"excalidraw-url-prefix": "text",
|
||||
"excalidraw-link-brackets": "checkbox",
|
||||
@@ -23,7 +24,6 @@
|
||||
"excalidraw-autoexport": "text",
|
||||
"excalidraw-embeddable-theme": "text",
|
||||
"excalidraw-open-md": "checkbox",
|
||||
"excalidraw-embed-md": "checkbox",
|
||||
"excalidraw-export-internal-links": "checkbox"
|
||||
"excalidraw-embed-md": "checkbox"
|
||||
}
|
||||
}
|
||||
@@ -4,17 +4,22 @@
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "55f11863890640cb",
|
||||
"id": "61d6e3de70affb43",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "cb080f356dbc4a8c",
|
||||
"id": "136349dfabcba548",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {},
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "calendar/diary/2026-04-20.md",
|
||||
"mode": "source",
|
||||
"source": false,
|
||||
"backlinks": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "新标签页"
|
||||
"title": "2026-04-20"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -50,7 +55,7 @@
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "172.21.16.174",
|
||||
"query": "path:resource/英语 ",
|
||||
"matchingCase": false,
|
||||
"explainSearch": true,
|
||||
"collapseAll": false,
|
||||
@@ -92,7 +97,7 @@
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 371.5
|
||||
"width": 381.5
|
||||
},
|
||||
"right": {
|
||||
"id": "ca733f6d5936ae40",
|
||||
@@ -109,12 +114,13 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "calendar/diary/2026-04-20.md",
|
||||
"followCursor": true,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "大纲"
|
||||
"title": "2026-04-20 的大纲"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -209,7 +215,7 @@
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 281.5
|
||||
"width": 275.5
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
@@ -223,54 +229,54 @@
|
||||
"templater-obsidian:Templater": true
|
||||
}
|
||||
},
|
||||
"active": "cb080f356dbc4a8c",
|
||||
"active": "c8718c0c63702202",
|
||||
"lastOpenFiles": [
|
||||
"000-inbox/开发笔记-%s.md",
|
||||
"000-inbox/开发笔记1.md",
|
||||
"000-inbox/开发笔记-.md",
|
||||
"000-inbox/开发笔记.md",
|
||||
"000-inbox/0403-165454.md",
|
||||
"000-inbox/0403-111.md",
|
||||
"000-inbox/04月03日 1641451.md",
|
||||
"000-inbox/04月03日 1641351.md",
|
||||
"000-inbox/04月03日 165100.md",
|
||||
"attachment/templates/移动杭研-问题记录.md",
|
||||
"work/移动杭研/问题处理/2023-01/0103-试用单前置校验信安附件问题-BBOSS张蕊.md",
|
||||
"attachment/templates/移动杭研-开发笔记.md",
|
||||
"attachment/templates/日常记录-闪念笔记.md",
|
||||
"attachment/templates/日常记录-日记模板.md",
|
||||
"attachment/templates/打开控制台.md",
|
||||
"calendar/diary/2026-04-17.md",
|
||||
"calendar/diary/2026-04-20.md",
|
||||
"work/移动杭研/开发记录/7.20.0/开发笔记 7.20.0.md",
|
||||
"000-inbox/okhttp3.md",
|
||||
"000-inbox/MCP 学习.md",
|
||||
"000-inbox/DDD.md",
|
||||
"kids-coding/个人大纲.md",
|
||||
"kids-coding",
|
||||
"000-inbox/04月17日 161753.md",
|
||||
"calendar/diary/2026-04-10.md",
|
||||
"calendar/diary/2026-04-18.md",
|
||||
"calendar/weeks/2026-W16.md",
|
||||
"calendar/diary/2026-04-16.md",
|
||||
"calendar/diary/2026-04-15.md",
|
||||
"calendar/diary/2026-04-14.md",
|
||||
"calendar/diary/2026-04-13.md",
|
||||
"calendar/diary/2026-04-19.md",
|
||||
"calendar/diary/2026-04-09.md",
|
||||
"resource/java/MCP Json 注解.md",
|
||||
"resource/java/Maven.md",
|
||||
"resource/java/JPA 双表查询.md",
|
||||
"resource/java/JPA 操作规范.md",
|
||||
"work/移动杭研/AI 项目/ibs-ai 项目梳理.md",
|
||||
"work/移动杭研/AI 项目/图纸-IBS 智能体-v1-流量查询 demo.md",
|
||||
"resource/英语/词性.md",
|
||||
"resource/英语/句子.md",
|
||||
"resource/英语/形容词最高级.md",
|
||||
"resource/python",
|
||||
"work/移动杭研/问题处理/2026-04",
|
||||
"attachment/images-paste/Pasted image 20260413135741.png",
|
||||
"attachment/images-uuid/30df1a7f789e4d9cba02297ffcc813be.png",
|
||||
"attachment/images-uuid/6995374f2632453e95171ac6b2ab325e.png",
|
||||
"attachment/images-paste/Pasted image 20260413135806.png",
|
||||
"attachment/images-paste/Pasted image 20260329170137.png",
|
||||
"attachment/images-paste/Pasted image 20260402090513.png",
|
||||
"work/移动杭研/开发记录/7.20.0",
|
||||
"attachment/scripts/openTerminal.js",
|
||||
"attachment/scripts",
|
||||
"000-inbox/04月03日 162825.md",
|
||||
"000-inbox/未命名.md",
|
||||
"000-inbox/04月03日 162801.md",
|
||||
"000-inbox/04月01.md",
|
||||
"000-inbox/claude code buddy.md",
|
||||
"000-inbox/MCP 请求数统计.md",
|
||||
"calendar/diary/2026-04-03.md",
|
||||
"calendar/diary/2026-04-02.md",
|
||||
"calendar/diary/2026-04-01.md",
|
||||
"calendar/diary/2026年/2026-03-31.md",
|
||||
"calendar/diary/2026年/2026-03-30.md",
|
||||
"attachment/Pasted image 20260402090513.png",
|
||||
"attachment/Pasted image 20260329165253.png",
|
||||
"attachment/Pasted image 20260329170137.png",
|
||||
"attachment/Pasted image 20260329165321.png",
|
||||
"attachment/Pasted image 20260329165301.png",
|
||||
"attachment/images-paste/image-20230226203841579.png",
|
||||
"attachment/Pasted image 20260329133947.png",
|
||||
"attachment/jsscripts/openTerminal.js",
|
||||
"attachment/jsscripts/新建文本文档.txt",
|
||||
"attachment/jsscripts",
|
||||
"attachment/images-paste/image-20260325102650978.png",
|
||||
"attachment/images-paste/image-20260325224014579.png",
|
||||
"attachment/images-paste/image-20260325224132102.png",
|
||||
"resource/ai/大模型安装笔记",
|
||||
"work/移动杭研/问题处理/2026-03",
|
||||
"resource/ai/prompts/cosmic 业务版本",
|
||||
"resource/ai/prompts/cosmic",
|
||||
"resource/ai/prompts/临时",
|
||||
"000-inbox/未命名.canvas"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
DDD
|
||||
@@ -0,0 +1,77 @@
|
||||
MCP 协议的实现,可以有2种方式,
|
||||
|
||||
1. stdio,把 jar 提供出去,别人本地配置引入即可使用,但这样的方式不太适合做统一网关服务。
|
||||
2. sse
|
||||
|
||||
项目采用 [DDD](DDD.md) 架构,首先聚焦 domain 层。
|
||||
|
||||
### 会话管理服务
|
||||
|
||||
```java
|
||||
private final ScheduledExecutorService cleanupScheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
```
|
||||
|
||||
其中 private 说明这个变量这能在类内部访问,声明为 final 则此变量只能赋值一次。`newSingleThreadScheduledExecutor` 代表只有一个工作线程。
|
||||
|
||||
> 一个带有定时功能的单线程定时队列。
|
||||
|
||||
```java
|
||||
private final Map<String, SessionConfigVO> activeSessions = new ConcurrentHashMap<>();
|
||||
```
|
||||
|
||||
考虑点在于这个会话是否会被多个线程操作处理。
|
||||
|
||||
```java
|
||||
public SessionManagementService() {
|
||||
cleanupScheduler.scheduleAtFixedRate(this::cleanupExpiredSessions, 5, 5, TimeUnit.MINUTES);
|
||||
log.info("会话管理服务已启动,会话超时时间: {} 分钟", SESSION_TIMEOUT_MINUTES);
|
||||
}
|
||||
```
|
||||
|
||||
可以在构造中执行一些方法。
|
||||
|
||||
### 实时通讯
|
||||
|
||||
> 对立面轮训
|
||||
|
||||
SSE(Server sent Events)
|
||||
|
||||
基于普通的 HTTP 长连接,Content-type: text/event-stream
|
||||
|
||||
消息格式,每条消息以 \n\n 结尾,
|
||||
|
||||

|
||||
|
||||
```
|
||||
SSE(协议)
|
||||
↑
|
||||
需要一个好的服务器框架来实现它
|
||||
↓
|
||||
Spring WebFlux(响应式 Web 框架) ← 最适合实现 SSE 的框架
|
||||
↑
|
||||
因为它是响应式(非阻塞),非常适合长连接
|
||||
↓
|
||||
在 WebFlux 里,用 Sinks + Flux<ServerSentEvent> 来产生和推送 SSE 事件
|
||||
```
|
||||
|
||||
```
|
||||
客户端发起 SSE 请求
|
||||
↓
|
||||
Netty EventLoop 接收请求(线程A)
|
||||
↓
|
||||
Controller 返回 sink.asFlux() → 注册“有新事件时推送”的回调
|
||||
↓
|
||||
线程A 立刻释放,去处理其他请求
|
||||
↓
|
||||
...(连接保持打开,线程A 忙别的)
|
||||
|
||||
你的服务层调用 sink.tryEmitNext(新消息)
|
||||
↓
|
||||
Reactor 通知 Netty:“这个连接有数据要写”
|
||||
↓
|
||||
EventLoop 线程(可能是线程B)被唤醒
|
||||
↓
|
||||
执行回调:把消息转成 "data: xxx\n\n" 格式 → 写入 Socket
|
||||
↓
|
||||
写完后,线程B 立刻释放,继续干别的
|
||||
```
|
||||
@@ -1 +0,0 @@
|
||||

|
||||
@@ -1,3 +0,0 @@
|
||||
```
|
||||
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = message['content'].replace('</think>', '').split('<think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>'}}{% endif %}
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
```java
|
||||
package cn.bugstack.ai.infrastructure.gateway;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.HeaderMap;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
import retrofit2.http.Url;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 资料:<a href="https://bugstack.cn/md/road-map/http.html">HTTP 框架案例</a>
|
||||
*/
|
||||
public interface GenericHttpGateway {
|
||||
|
||||
@POST
|
||||
Call<ResponseBody> post(
|
||||
@Url String url,
|
||||
@HeaderMap Map<String, Object> headers,
|
||||
@Body RequestBody body
|
||||
);
|
||||
|
||||
@GET
|
||||
Call<ResponseBody> get(
|
||||
@Url String url,
|
||||
@HeaderMap Map<String, Object> headers,
|
||||
@QueryMap Map<String, Object> queryParams
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 180 KiB |
|
Before Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 962 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 683 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 309 KiB |
|
Before Width: | Height: | Size: 343 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 588 KiB |
|
Before Width: | Height: | Size: 7.3 MiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 285 KiB |
|
Before Width: | Height: | Size: 512 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 704 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 368 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 625 KiB |
|
Before Width: | Height: | Size: 909 KiB |
|
Before Width: | Height: | Size: 520 KiB |
|
Before Width: | Height: | Size: 499 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 643 KiB |
|
Before Width: | Height: | Size: 679 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 348 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 2.9 MiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 973 KiB |
|
Before Width: | Height: | Size: 770 KiB |
|
Before Width: | Height: | Size: 906 KiB |
|
Before Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 489 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 649 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 435 B |