refactor(copy): 术语统一——收录版本、模型服务、智能体等(DEAI-2)
- 版本目标 → 收录版本(前后端用户可见字符串、能力描述、给模型的提示) - Agent 上游 / 上游 → 模型服务;界面上的 Agent / Agent 会话 → 智能体 / 智能体会话 - 身份歧义 / 识别有歧义 / 无法确定作品 → 没识别出作品;待识别(池) → 未识别 - 建档 → 加入媒体库;资产 → 文件;库根 → 媒体库目录;纳管 → 本工具 / 外部任务; 哨兵 → 标记文件 / 检查目录;站点快照 → 抓取;Feed / RSS 订阅 / 来源健康 → RSS - 代码标识符、API 字段名、迁移文件不改;glossary.md 同步;smoke 选择器跟随 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d282212a6b
commit
4480fc346d
212 files changed
+741
-715
No files matched your search
@@ -23,8 +23,8 @@ const PROVIDER_ID = { anthropic: "umt-anthropic", "openai-compatible": "umt-open
|
||||
*/
|
||||
export function resolveModelFromSettings(settings: ResolvedAgentSettings): ResolvedPiModel {
|
||||
if (settings.provider !== "anthropic" && settings.provider !== "openai-compatible")
|
||||
throw new Error(`provider ${settings.provider} 需要按上游装配(PiAgentRuntimeOptions.upstream)`);
|
||||
if (!settings.apiKey) throw new Error("未配置上游密钥");
|
||||
throw new Error(`provider ${settings.provider} 需要按模型服务装配(PiAgentRuntimeOptions.upstream)`);
|
||||
if (!settings.apiKey) throw new Error("未配置模型服务密钥");
|
||||
const providerId = PROVIDER_ID[settings.provider];
|
||||
const common = {
|
||||
id: settings.model,
|
||||
@@ -49,7 +49,7 @@ export function resolveModelFromSettings(settings: ResolvedAgentSettings): Resol
|
||||
models.setProvider(createProvider({ id: providerId, auth, models: [m], api: anthropicMessagesApi() }));
|
||||
model = m;
|
||||
} else {
|
||||
if (!settings.baseUrl) throw new Error("openai-compatible 上游必须配置 baseUrl(带 /v1)");
|
||||
if (!settings.baseUrl) throw new Error("openai-compatible 模型服务必须配置 baseUrl(带 /v1)");
|
||||
const m: Model<"openai-completions"> = {
|
||||
...common,
|
||||
api: "openai-completions",
|
||||
|
||||
@@ -400,7 +400,7 @@ class PiAgentRun implements AgentRunHandle {
|
||||
const err = record && "error" in record ? record.error : undefined;
|
||||
outcome = this.failed("error", redactString(err ? `${err.code}: ${err.message}` : "运行失败"));
|
||||
} else if (status === "suspended") {
|
||||
outcome = this.failed("error", "上游进入延迟模式(deferred),v0.1 不支持");
|
||||
outcome = this.failed("error", "模型服务进入延迟模式(deferred),v0.1 不支持");
|
||||
} else {
|
||||
outcome = { status: "completed", finalText: this.finalText, usage: this.usage };
|
||||
this.emit({ type: "run_completed", finalText: outcome.finalText, usage: this.usage });
|
||||
@@ -540,7 +540,7 @@ export function toolContent(
|
||||
if (!vision)
|
||||
return [
|
||||
{ type: "text", text },
|
||||
{ type: "text", text: "(截图未发送:当前上游模型不支持图片输入;用 browser.snapshot 读取页面文字)" },
|
||||
{ type: "text", text: "(截图未发送:当前模型不支持图片输入;用 browser.snapshot 读取页面文字)" },
|
||||
];
|
||||
return [
|
||||
{ type: "text", text },
|
||||
|
||||
@@ -329,7 +329,7 @@ export class PiUpstreamClient {
|
||||
private pickModel(modelId: string | null | undefined): { model: Model<Api>; inCatalog: boolean } {
|
||||
const all = this.models.getModels(this.providerId);
|
||||
const id = modelId ?? this.spec.model ?? all[0]?.id;
|
||||
if (!id) throw new UpstreamError("model", "该上游没有可用模型,请填写模型 id");
|
||||
if (!id) throw new UpstreamError("model", "该模型服务没有可用模型,请填写模型 id");
|
||||
const found = this.models.getModel(this.providerId, id);
|
||||
if (found) return { model: found, inCatalog: true };
|
||||
const template = all[0];
|
||||
@@ -369,7 +369,7 @@ export class PiUpstreamClient {
|
||||
throw classifyUpstreamError(err);
|
||||
}
|
||||
if (res.stopReason === "error" || res.stopReason === "aborted")
|
||||
throw classifyUpstreamError(new Error(res.errorMessage ?? "上游返回错误"));
|
||||
throw classifyUpstreamError(new Error(res.errorMessage ?? "模型服务返回错误"));
|
||||
}
|
||||
return { source, model: model.id, inCatalog };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user