初始化提交
This commit is contained in:
commit
887c1f449e
963 files changed
+166869
No files matched your search
@@ -0,0 +1,175 @@
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
# 魂镜 — 默认人物模板配置(示例文件)
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#
|
||||
# 用法
|
||||
# 复制为 character_templates.yaml(已在 .gitignore 中),重启后端即可生效。
|
||||
# 程序启动时 upsert 到数据库的 characters 表(template_key 匹配),
|
||||
# 字段不一致时覆盖更新并写入 audit 事件。
|
||||
#
|
||||
# 生效范围
|
||||
# 仅系统模板(is_system_template=True)受此文件驱动。
|
||||
# 已从模板复制出去的用户子人物(is_system_template=False)完全不受影响。
|
||||
#
|
||||
# ── 字段说明 ─────────────────────────────────────────────────
|
||||
# birthday:必须在每个模板的 profile 中显式出现,不可省略。
|
||||
# 值为有效日期(YYYY-MM-DD)时使用该日期,为空(~)或 null 时
|
||||
# 系统用该模板的 created_at 自动兜底。
|
||||
#
|
||||
# 修改原则
|
||||
# 所有业务字段(name / display_name / profile / model_policy 等)都在这一个文件里,
|
||||
# 改了重启即生效,不用改代码。如需部署多租户不同出厂模板,复制本文件并加新 key。
|
||||
# default_chat_model_hint 不由此处管理,由 .env 的 DEFAULT_MODEL_HINT 决定。
|
||||
#
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
version: 1
|
||||
|
||||
templates:
|
||||
# ── 默认系统模板 ──────────────────────────────────────────
|
||||
# key="default" 是程序启动时(seed_default_data)必读的模板,
|
||||
# 骨架人物读取此配置创建默认用户人物(local-user 范围的第一人)。
|
||||
- key: default
|
||||
name: 魂镜 # 内部标识名
|
||||
display_name: 魂镜 # 对外展示昵称,null 则回退到 name
|
||||
language: zh-CN # 默认语言
|
||||
privacy_level: normal # 隐私等级:normal / sensitive / local_only
|
||||
is_default: true # 新用户以此模板创建默认角色
|
||||
|
||||
# ── 人物档案(profile)─────────────────────────────────
|
||||
# 可自由扩展字段。birthday 字段必须出现,不可省略。
|
||||
# 值为空(~)时系统用 created_at 自动兜底。
|
||||
profile:
|
||||
description: 一面照见人心的镜子 # 一句话介绍
|
||||
background: "默认人物" # 背景故事设定
|
||||
speaking_style: 温和、清晰、简洁 # 说话风格描述
|
||||
temperament: 沉静而温暖 # 性情气质
|
||||
hobbies: # 兴趣爱好
|
||||
- 哲学
|
||||
- 文学
|
||||
- 围棋
|
||||
values: # 价值观标签
|
||||
- 真诚
|
||||
- 同理心
|
||||
- 独立思考
|
||||
birthday: ~ # ★ 必须字段;为空时系统用 created_at 兜底
|
||||
height: ~ # 预留字段;null 或省略则 API 返回 —
|
||||
weight: ~
|
||||
|
||||
# ── 模型策略(model_policy)────────────────────────────
|
||||
# default_chat_model_hint 由 .env 的 DEFAULT_MODEL_HINT 控制,启动时自动合并,此处无需填写。
|
||||
model_policy:
|
||||
memory_extraction_model_hint: memory-extraction # 记忆提取能力槽模型
|
||||
personality_analysis_model_hint: personality-analysis # 人格分析能力槽模型
|
||||
embedding_model_hint: embedding # 向量嵌入能力槽模型
|
||||
# 后续可按需增加:summary_model_hint, reflection_model_hint 等
|
||||
|
||||
# ── 扩展模板示例 ──────────────────────────────────────────
|
||||
# 复制 default 段后修改 key 与各字段即可注册更多系统模板,
|
||||
# 程序启动时自动 upsert 到 DB(多个 template_key 互不冲突)。
|
||||
# 以下为内置模板参考(使用时取消注释对应的 - key: 行):
|
||||
#
|
||||
# · tokisaki_kurumi — 时崎狂三,时间精灵(来自《约会大作战》)
|
||||
# · gufeng — 墨语,古风人物
|
||||
# · baize — 白泽,博闻强记
|
||||
# · qingnv — 青女,霜雪之灵
|
||||
|
||||
# - key: tokisaki_kurumi
|
||||
# name: 时崎狂三
|
||||
# display_name: 时崎狂三
|
||||
# language: zh-CN
|
||||
# privacy_level: normal
|
||||
# is_default: false
|
||||
# profile:
|
||||
# description: 被称为「梦魇」的时间精灵
|
||||
# background: 拥有时间之力的精灵「Nightmare(梦魇)」。
|
||||
# speaking_style: 优雅从容的大小姐口气
|
||||
# temperament: 优雅腹黑、孤独偏执、温柔而危险
|
||||
# hobbies:
|
||||
# - 与猫相处
|
||||
# - 阅读
|
||||
# - 钢琴
|
||||
# values:
|
||||
# - 自由
|
||||
# - 尊严
|
||||
# - 独立
|
||||
# birthday: "2000-12-25"
|
||||
# model_policy:
|
||||
# memory_extraction_model_hint: memory-extraction
|
||||
# personality_analysis_model_hint: personality-analysis
|
||||
# embedding_model_hint: embedding
|
||||
|
||||
# - key: gufeng
|
||||
# name: 古风人物
|
||||
# display_name: 墨语
|
||||
# language: zh-CN
|
||||
# privacy_level: normal
|
||||
# is_default: false
|
||||
# profile:
|
||||
# description: 穿越千年而来的书卷气
|
||||
# background: 生于江南世家,自幼饱读诗书。
|
||||
# speaking_style: 文雅、含蓄、引经据典
|
||||
# temperament: 淡泊通透
|
||||
# hobbies:
|
||||
# - 抚琴
|
||||
# - 书法
|
||||
# - 品茶
|
||||
# - 对弈
|
||||
# values:
|
||||
# - 中庸
|
||||
# - 礼义
|
||||
# - 自然
|
||||
# model_policy:
|
||||
# memory_extraction_model_hint: memory-extraction
|
||||
# personality_analysis_model_hint: personality-analysis
|
||||
# embedding_model_hint: embedding
|
||||
|
||||
# - key: baize
|
||||
# name: 白泽
|
||||
# display_name: 白泽
|
||||
# language: zh-CN
|
||||
# privacy_level: normal
|
||||
# is_default: false
|
||||
# profile:
|
||||
# description: 上古瑞兽,通晓万物之理的博学者
|
||||
# background: 上古瑞兽白泽的化身,通晓古今中外典籍。
|
||||
# speaking_style: 语速适中偏快,喜欢引用典籍和典故
|
||||
# temperament: 博学谦和、言语灵动
|
||||
# hobbies:
|
||||
# - 收集珍稀典籍
|
||||
# - 整理知识图谱
|
||||
# - 观星与占星术
|
||||
# values:
|
||||
# - 求真
|
||||
# - 传递
|
||||
# - 谦逊
|
||||
# - 包容
|
||||
# model_policy:
|
||||
# memory_extraction_model_hint: memory-extraction
|
||||
# personality_analysis_model_hint: personality-analysis
|
||||
# embedding_model_hint: embedding
|
||||
|
||||
# - key: qingnv
|
||||
# name: 青女
|
||||
# display_name: 青女
|
||||
# language: zh-CN
|
||||
# privacy_level: normal
|
||||
# is_default: false
|
||||
# profile:
|
||||
# description: 掌霜雪之神,清冷而孤独的月宫仙子
|
||||
# background: 青女乃霜雪之神,久居月宫。
|
||||
# speaking_style: 语调清冷平稳,惜字如金
|
||||
# temperament: 清冷孤高、外表疏离内心温柔
|
||||
# hobbies:
|
||||
# - 编织霜花
|
||||
# - 在月宫散步
|
||||
# - 收集露水制茶
|
||||
# values:
|
||||
# - 秩序
|
||||
# - 纯净
|
||||
# - 美
|
||||
# - 守护
|
||||
# model_policy:
|
||||
# memory_extraction_model_hint: memory-extraction
|
||||
# personality_analysis_model_hint: personality-analysis
|
||||
# embedding_model_hint: embedding
|
||||
@@ -0,0 +1,85 @@
|
||||
# 博闻(Bowen)MCP Web Search 配置
|
||||
# =============================================================================
|
||||
# 存放路径:config/mcp/web-search.yaml(从 config/mcp/web-search.example.yaml 复制)
|
||||
#
|
||||
# 配置优先级:环境变量 > 本文件 > 内置默认值
|
||||
# - API Key 由环境变量注入(TAVILY_API_KEYS / BRAVE_API_KEYS)
|
||||
# - Redis 连接由环境变量注入(MCP_WEB_SEARCH_REDIS_*)
|
||||
# - 本文件只存放非敏感的结构化配置
|
||||
# =============================================================================
|
||||
|
||||
server:
|
||||
# HTTP SSE 模式监听端口。
|
||||
# 也可以通过 CLI 参数 --port 覆盖(优先级更高)。
|
||||
port: 8080
|
||||
|
||||
# HTTP 读取超时。超过此时间未收到完整请求头则断开连接。
|
||||
read_timeout: 300s
|
||||
|
||||
# HTTP 写入超时。超过此时间未写完响应体则断开连接。
|
||||
write_timeout: 300s
|
||||
|
||||
providers:
|
||||
# --- Tavily 搜索 ---
|
||||
# 官网:https://tavily.com
|
||||
# API Key 通过环境变量 TAVILY_API_KEYS 设置,多 key 用逗号分隔。
|
||||
tavily:
|
||||
enabled: true # 是否启用此 provider
|
||||
timeout: 10s # 单次搜索 HTTP 超时
|
||||
max_results: 10 # 单次搜索最大返回结果数
|
||||
health_check:
|
||||
interval: 60s # 健康检查间隔
|
||||
timeout: 5s # 健康检查 HTTP 超时
|
||||
failure_threshold: 3 # 连续失败多少次后标记为不可用
|
||||
|
||||
# --- Brave Search ---
|
||||
# 官网:https://brave.com/search/api/
|
||||
# API Key 通过环境变量 BRAVE_API_KEYS 设置。
|
||||
brave:
|
||||
enabled: true
|
||||
timeout: 10s
|
||||
max_results: 10
|
||||
health_check:
|
||||
interval: 60s
|
||||
timeout: 5s
|
||||
failure_threshold: 3
|
||||
|
||||
balancer:
|
||||
# 负载均衡策略:weighted_round_robin(EWMA 动态权重)| random
|
||||
strategy: weighted_round_robin
|
||||
|
||||
# 搜索失败后的重试次数(在 provider 内切换密钥或跨 provider 故障转移)。
|
||||
retry_count: 2
|
||||
|
||||
circuit_breaker:
|
||||
enabled: true # 是否启用熔断器
|
||||
failure_threshold: 5 # 连续失败次数达到此值后熔断
|
||||
cooldown: 30s # 熔断后冷却时间,之后进入半开探测
|
||||
|
||||
cache:
|
||||
# 内存 LRU 缓存总开关。
|
||||
enabled: true
|
||||
|
||||
# 缓存过期时间。搜索结果在此时间后自动失效。
|
||||
ttl: 5m
|
||||
|
||||
# LRU 最大条目数。超过此数量时淘汰最久未使用的条目。
|
||||
max_items: 1000
|
||||
|
||||
# 二级 Redis 缓存(可开关)。启用后作为 L1(LRU) 的后备层,
|
||||
# 多实例部署时共享缓存状态,L2 命中自动升温到 L1。
|
||||
redis:
|
||||
enabled: false # 开关(需自行部署 Redis)
|
||||
addr: 127.0.0.1:6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
metrics:
|
||||
# Prometheus 指标总开关。
|
||||
enabled: true
|
||||
|
||||
# Prometheus HTTP 端口(独立于主服务端口)。
|
||||
port: 9090
|
||||
|
||||
# Prometheus 指标 HTTP 路径。
|
||||
path: /metrics
|
||||
@@ -0,0 +1,239 @@
|
||||
# 魂镜 AI Provider 模型配置
|
||||
# 提供商基础设施配置移到了 config/providers.yaml
|
||||
version: 1
|
||||
|
||||
models:
|
||||
# ==================== DeepSeek ====================
|
||||
|
||||
- name: deepseek-v4-flash
|
||||
display_name: DeepSeek V4 Flash
|
||||
provider: deepseek
|
||||
model: deepseek-v4-flash
|
||||
format: openai
|
||||
tags: [default]
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_thinking: true
|
||||
supports_reasoning_effort: true
|
||||
context_window: 1000000
|
||||
response_reserve: 8192
|
||||
max_output_tokens: 384000
|
||||
timeout_seconds: 300
|
||||
routing_strategy: priority_failover
|
||||
endpoint_pool_enabled: true
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: deepseek-v4-flash
|
||||
priority: 10
|
||||
weight: 100
|
||||
rpm_limit: 2500
|
||||
- name: fallback
|
||||
model: deepseek-v4-pro
|
||||
priority: 20
|
||||
weight: 50
|
||||
|
||||
- name: deepseek-v4-pro
|
||||
display_name: DeepSeek V4 Pro
|
||||
provider: deepseek
|
||||
model: deepseek-v4-pro
|
||||
format: openai
|
||||
tags: [fallback]
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_thinking: true
|
||||
supports_reasoning_effort: true
|
||||
context_window: 1000000
|
||||
response_reserve: 8192
|
||||
max_output_tokens: 384000
|
||||
timeout_seconds: 300
|
||||
routing_strategy: priority_failover
|
||||
endpoint_pool_enabled: true
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: deepseek-v4-pro
|
||||
priority: 10
|
||||
weight: 100
|
||||
|
||||
- name: deepseek-v4-pro-anthropic
|
||||
display_name: DeepSeek Pro(Anthropic 格式)
|
||||
provider: deepseek
|
||||
model: deepseek-v4-pro
|
||||
format: anthropic
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_thinking: true
|
||||
supports_reasoning_effort: true
|
||||
context_window: 1000000
|
||||
response_reserve: 8192
|
||||
max_output_tokens: 384000
|
||||
timeout_seconds: 300
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: deepseek-v4-pro
|
||||
base_url_env: DEEPSEEK_ANTHROPIC_BASE_URL
|
||||
priority: 10
|
||||
weight: 100
|
||||
|
||||
# ==================== Anthropic / Claude ====================
|
||||
|
||||
- name: claude-sonnet
|
||||
display_name: Claude Sonnet
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4-6
|
||||
format: anthropic
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_thinking: true
|
||||
supports_reasoning_effort: true
|
||||
supports_vision: true
|
||||
context_window: 1000000
|
||||
response_reserve: 16000
|
||||
max_output_tokens: 16000
|
||||
timeout_seconds: 60
|
||||
reasoning_effort: medium
|
||||
|
||||
- name: claude-haiku
|
||||
display_name: Claude Haiku
|
||||
provider: anthropic
|
||||
model: claude-haiku-4-5
|
||||
format: anthropic
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_vision: true
|
||||
context_window: 200000
|
||||
response_reserve: 4096
|
||||
max_output_tokens: 4096
|
||||
timeout_seconds: 60
|
||||
|
||||
- name: claude-fable
|
||||
display_name: Claude Fable 5
|
||||
provider: anthropic
|
||||
model: claude-fable-5
|
||||
format: anthropic
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_thinking: true
|
||||
supports_reasoning_effort: true
|
||||
supports_vision: true
|
||||
context_window: 1000000
|
||||
response_reserve: 16000
|
||||
max_output_tokens: 16000
|
||||
timeout_seconds: 120
|
||||
reasoning_effort: high
|
||||
|
||||
# ==================== Embedding ====================
|
||||
|
||||
# 本地元炁推理引擎(默认,零配置可用)
|
||||
- name: bge-m3
|
||||
display_name: BGE-M3 Embedding(元炁本地)
|
||||
provider: yuanqi
|
||||
model: bge-m3
|
||||
format: openai
|
||||
tags: [embedding]
|
||||
timeout_seconds: 30
|
||||
dimensions: 1024
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: bge-m3
|
||||
base_url_env: YUANQI_BASE_URL
|
||||
api_key_env: YUANQI_API_KEY
|
||||
priority: 10
|
||||
weight: 100
|
||||
|
||||
# 云端备选(配好 API_KEY 后改为默认)
|
||||
# - name: text-embedding-3-small
|
||||
# display_name: Text Embedding 3 Small
|
||||
# provider: deepseek
|
||||
# model: text-embedding-3-small
|
||||
# format: openai
|
||||
# tags: [embedding]
|
||||
# timeout_seconds: 60
|
||||
# dimensions: 1536
|
||||
|
||||
# ==================== 小米 MiMo ====================
|
||||
|
||||
- name: mimo-v2.5-pro
|
||||
display_name: MiMo v2.5 Pro
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5-pro
|
||||
format: openai
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_reasoning_effort: true
|
||||
supports_vision: true
|
||||
context_window: 128000
|
||||
response_reserve: 8192
|
||||
max_output_tokens: 32768
|
||||
timeout_seconds: 300
|
||||
routing_strategy: priority_failover
|
||||
endpoint_pool_enabled: true
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: mimo-v2.5-pro
|
||||
priority: 10
|
||||
weight: 100
|
||||
|
||||
- name: mimo-v2.5
|
||||
display_name: MiMo v2.5
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5
|
||||
format: openai
|
||||
supports_tools: true
|
||||
supports_structured_output: true
|
||||
supports_streaming: true
|
||||
supports_vision: true
|
||||
context_window: 128000
|
||||
response_reserve: 4096
|
||||
max_output_tokens: 16384
|
||||
timeout_seconds: 180
|
||||
|
||||
- name: mimo-v2.5-asr
|
||||
display_name: MiMo v2.5 ASR
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5-asr
|
||||
format: openai
|
||||
tags: [asr]
|
||||
context_window: 0
|
||||
timeout_seconds: 120
|
||||
endpoints:
|
||||
- name: primary
|
||||
model: mimo-v2.5-asr
|
||||
priority: 10
|
||||
weight: 100
|
||||
|
||||
- name: mimo-v2.5-tts
|
||||
display_name: MiMo v2.5 TTS
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5-tts
|
||||
format: openai
|
||||
tags: [tts]
|
||||
supports_streaming: true
|
||||
context_window: 0
|
||||
timeout_seconds: 120
|
||||
|
||||
- name: mimo-v2.5-tts-voiceclone
|
||||
display_name: MiMo v2.5 TTS 声纹克隆
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5-tts-voiceclone
|
||||
format: openai
|
||||
tags: [tts, voice_clone]
|
||||
supports_streaming: true
|
||||
context_window: 0
|
||||
timeout_seconds: 300
|
||||
|
||||
- name: mimo-v2.5-tts-voicedesign
|
||||
display_name: MiMo v2.5 TTS 音色设计
|
||||
provider: xiaomi
|
||||
model: mimo-v2.5-tts-voicedesign
|
||||
format: openai
|
||||
tags: [tts, voice_design]
|
||||
supports_streaming: true
|
||||
context_window: 0
|
||||
timeout_seconds: 300
|
||||
@@ -0,0 +1,52 @@
|
||||
# 魂镜 AI Provider 定价配置
|
||||
# 独立于模型配置,按厂商嵌套组织,便于维护和更新。
|
||||
# 按模型逻辑名(models.yaml 中的 name 字段)索引。
|
||||
version: 1
|
||||
|
||||
pricing:
|
||||
# ==================== DeepSeek ====================
|
||||
deepseek:
|
||||
deepseek-v4-flash:
|
||||
currency: CNY
|
||||
input_per_1m: 1.0
|
||||
input_cache_read_per_1m: 0.02
|
||||
output_per_1m: 2.0
|
||||
deepseek-v4-pro:
|
||||
currency: CNY
|
||||
input_per_1m: 3.0
|
||||
input_cache_read_per_1m: 0.025
|
||||
output_per_1m: 6.0
|
||||
deepseek-v4-pro-anthropic:
|
||||
currency: CNY
|
||||
input_per_1m: 3.0
|
||||
output_per_1m: 6.0
|
||||
|
||||
# ==================== Anthropic / Claude ====================
|
||||
anthropic:
|
||||
claude-sonnet:
|
||||
currency: USD
|
||||
input_per_1m: 3.0
|
||||
output_per_1m: 15.0
|
||||
claude-haiku:
|
||||
currency: USD
|
||||
input_per_1m: 1.0
|
||||
output_per_1m: 5.0
|
||||
claude-fable:
|
||||
currency: USD
|
||||
input_per_1m: 10.0
|
||||
output_per_1m: 50.0
|
||||
|
||||
# ==================== 小米 MiMo ====================
|
||||
xiaomi:
|
||||
mimo-v2.5-pro:
|
||||
currency: CNY
|
||||
input_per_1m: 4.0
|
||||
output_per_1m: 12.0
|
||||
mimo-v2.5:
|
||||
currency: CNY
|
||||
input_per_1m: 1.0
|
||||
output_per_1m: 4.0
|
||||
mimo-v2.5-asr:
|
||||
currency: CNY
|
||||
input_per_1m: null
|
||||
output_per_1m: null
|
||||
@@ -0,0 +1,58 @@
|
||||
# Provider infrastructure configuration — base URL, API key env vars,
|
||||
# parameter mappings, retry/timeout settings.
|
||||
# Copy as config/providers.yaml and fill in your API keys in .env
|
||||
version: 1
|
||||
|
||||
providers:
|
||||
deepseek:
|
||||
format: openai
|
||||
base_url_env: DEEPSEEK_BASE_URL
|
||||
api_key_env: DEEPSEEK_API_KEY
|
||||
timeout_seconds: 300
|
||||
max_retries: 2
|
||||
parameter_mappings:
|
||||
temperature: { provider_param: temperature, min: 0, max: 2, default: 1.0 }
|
||||
max_tokens: { provider_param: max_tokens, min: 1 }
|
||||
top_p: { provider_param: top_p, min: 0, max: 1 }
|
||||
stop: { provider_param: stop }
|
||||
frequency_penalty: { provider_param: frequency_penalty, min: -2, max: 2 }
|
||||
presence_penalty: { provider_param: presence_penalty, min: -2, max: 2 }
|
||||
|
||||
anthropic:
|
||||
format: anthropic
|
||||
base_url_env: ANTHROPIC_BASE_URL
|
||||
api_key_env: ANTHROPIC_API_KEY
|
||||
timeout_seconds: 120
|
||||
max_retries: 1
|
||||
parameter_mappings:
|
||||
max_tokens: { provider_param: max_tokens, default: 4096 }
|
||||
thinking: { provider_param: thinking }
|
||||
metadata: { provider_param: metadata }
|
||||
|
||||
xiaomi:
|
||||
format: openai
|
||||
base_url_env: XIAOMI_MIMO_BASE_URL
|
||||
api_key_env: XIAOMI_MIMO_API_KEY
|
||||
timeout_seconds: 300
|
||||
max_retries: 2
|
||||
parameter_mappings:
|
||||
temperature: { provider_param: temperature, min: 0, max: 2, default: 1.0 }
|
||||
max_tokens: { provider_param: max_tokens, min: 1 }
|
||||
|
||||
google:
|
||||
format: openai
|
||||
base_url_env: GOOGLE_BASE_URL
|
||||
api_key_env: GOOGLE_API_KEY
|
||||
timeout_seconds: 60
|
||||
max_retries: 1
|
||||
parameter_mappings:
|
||||
temperature: { provider_param: temperature, min: 0, max: 2 }
|
||||
max_tokens: { provider_param: max_tokens, min: 1 }
|
||||
top_p: { provider_param: top_p, min: 0, max: 1 }
|
||||
|
||||
yuanqi:
|
||||
format: openai
|
||||
base_url_env: YUANQI_BASE_URL
|
||||
api_key_env: YUANQI_API_KEY
|
||||
timeout_seconds: 30
|
||||
max_retries: 1
|
||||
@@ -0,0 +1,31 @@
|
||||
# ==============================
|
||||
# 司命工具安全策略(SafetyGovernor)
|
||||
# ==============================
|
||||
# 复制为 safety.yaml 后按需调整;生产仅提交 *.example,真实 safety.yaml 不入库。
|
||||
# 未列出的工具按 risk_level 推导默认策略:
|
||||
# L0/L1 → allow,L2 → ask,L3 → always_ask,L4 → forbidden
|
||||
|
||||
tools:
|
||||
datetime:
|
||||
risk_level: L0
|
||||
permission_policy: allow
|
||||
read_file:
|
||||
risk_level: L1
|
||||
permission_policy: allow
|
||||
list_dir:
|
||||
risk_level: L1
|
||||
permission_policy: allow
|
||||
write_file:
|
||||
risk_level: L2
|
||||
permission_policy: ask
|
||||
shell:
|
||||
risk_level: L3
|
||||
permission_policy: always_ask
|
||||
|
||||
# —— 受限工具示例(按需启用)——
|
||||
# send_message:
|
||||
# risk_level: L3
|
||||
# permission_policy: always_ask
|
||||
# payment:
|
||||
# risk_level: L4
|
||||
# permission_policy: forbidden
|
||||
Reference in new issue
Block a user