本地部署:顶层 docker-compose/config,域名 agent.ai.foresh.com(nginx-proxy VIRTUAL_HOST + external my-app-network,仅内网 expose 8080,config 只读挂载);配置后缀统一 .yaml→.yml(文件与全部引用,含 Dockerfile/AGENT_CONFIG/config.js/smoke)。smoke 25/25 通过
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// 配置加载:AGENT_CONFIG 指向 config.yaml(见 config.example.yaml)
|
||||
// 配置加载:AGENT_CONFIG 指向 config.yml(见 config.example.yml)
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const YAML = require('yaml');
|
||||
@@ -33,7 +33,7 @@ function deepMerge(base, extra) {
|
||||
}
|
||||
|
||||
function loadConfig(configPath) {
|
||||
const p = configPath || process.env.AGENT_CONFIG || path.join(__dirname, '..', 'config.yaml');
|
||||
const p = configPath || process.env.AGENT_CONFIG || path.join(__dirname, '..', 'config.yml');
|
||||
let raw = {};
|
||||
if (fs.existsSync(p)) {
|
||||
raw = YAML.parse(fs.readFileSync(p, 'utf8')) || {};
|
||||
|
||||
@@ -619,7 +619,7 @@ function strip(s) { return s.replace(/<[^>]+>/g, ''); }
|
||||
// web_search:调用内网 MCP 服务(JSON-RPC over HTTP,无状态,响应为 SSE 帧包裹的 JSON)。
|
||||
async function toolWebSearch(ctx, args) {
|
||||
const ws = ctx.cfg.web_search || {};
|
||||
if (!ws.url) return 'web_search 未配置:请在 config.yaml 的 web_search.url 中填写 MCP 服务地址';
|
||||
if (!ws.url) return 'web_search 未配置:请在 config.yml 的 web_search.url 中填写 MCP 服务地址';
|
||||
const query = args.query;
|
||||
if (!query) return 'web_search 缺少参数 query';
|
||||
const callId = Date.now();
|
||||
|
||||
Reference in New Issue
Block a user