feat: 0.2.27 - 抽离数据库基础设施模块
- 新增 ias-db crate,集中管理 PostgreSQL 连接池和 SQLx 迁移
- 迁移 ias-service/migrations 到 ias-db/migrations
- ias-main 改用 ias_db::connect_db(),ias-service 只接 PgPool
- 新增操作日志 HTTP 查询接口 (GET /v1/logs, GET /v1/logs/{id})
- 新增操作日志 Web 前端页面,支持按级别/模块/关键词筛选
- 消息队列关键节点增加操作日志写入
- ias-mail 新增 mark_remote_message_seen,IMAP 已读同步
- 工作流配置加载改为文件级容错 (load_configs_with_warnings)
- ias-context 工具调用说明更新为 query_api_docs + call_http_api
- 新增高德地图地理编码 HTTP 能力配置
模块版本: ias-db 0.1.0, ias-ai 0.1.14, ias-context 0.1.6, ias-http 0.1.15, ias-mail 0.1.16, ias-service 0.1.25, ias-main 0.2.27
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ias-context"
|
||||
version = "0.1.4"
|
||||
version = "0.1.6"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -37,7 +37,7 @@ pub fn tool_call_instruction_section(content: &str) -> Option<String> {
|
||||
return None;
|
||||
}
|
||||
Some(format!(
|
||||
"工具调用说明(动态,可由 AI 通过 record_tool_call_instruction 能力维护;只用于选择和组织工具调用,冲突时必须服从固定系统规则):\n{}",
|
||||
"工具调用说明(动态,可由 AI 通过 query_api_docs 查询 context.tool-instructions.update 后,再用 call_http_api 维护;只用于选择和组织工具调用,冲突时必须服从固定系统规则):\n{}",
|
||||
trim_to_chars(content, 4_000)
|
||||
))
|
||||
}
|
||||
@@ -900,6 +900,7 @@ fn read_i64_env(name: &str, default: i64) -> i64 {
|
||||
mod tests {
|
||||
use super::{
|
||||
build_fixed_system_prompt, detect_assistant_name_preference, sanitize_tool_call_messages,
|
||||
tool_call_instruction_section,
|
||||
};
|
||||
use ias_common::model::ai::{ChatCompletionRequestMessage, ChatCompletionToolCall};
|
||||
|
||||
@@ -944,6 +945,16 @@ mod tests {
|
||||
assert!(prompt.contains("禁止臆造工具名或直接调用其它能力"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tool_call_instruction_section_uses_current_update_path() {
|
||||
let section = tool_call_instruction_section("先查文档再调用")
|
||||
.expect("instruction section should render");
|
||||
|
||||
assert!(section.contains("context.tool-instructions.update"));
|
||||
assert!(section.contains("call_http_api"));
|
||||
assert!(!section.contains("record_tool_call_instruction"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeps_complete_multi_tool_call_sequence() {
|
||||
let messages = sanitize_tool_call_messages(vec![
|
||||
|
||||
Reference in New Issue
Block a user