@wanji_dsh/dsh-sales 0.11.7 → 0.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.zh.md
CHANGED
|
@@ -34,7 +34,7 @@ DeepSeek Harness 内的销售辅助工作台。插件在左侧菜单注册“销
|
|
|
34
34
|
|
|
35
35
|
工作区自动选择并开启微信同步,回复区不显示技能工作区和刷新控件;支持页内暂停/重连、按任务确认初始化或重启、客户搜索、历史分页、图片/语音随可见消息自动加载、CRM显式绑定、独立草稿编辑与复制。语音显示播放器,由用户点击播放;未入库媒体显示中文同步状态,失败可重试。真实历史、草稿及已处理状态保存在私有消息库;新消息使旧Agent稿失效,人工编辑保留并提示复核。复制不会发送消息。
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
右键微信语音气泡并选择「转为文字」。已绑定钉钉的企业成员优先通过企业网关转写,百炼 API Key 由服务器持有。未绑定时,转写使用本机模型凭据服务。两种方式均调用百炼北京地域的 `qwen3-asr-flash`。默认识别 `DASHSCOPE_API_KEY`、已有的 `WANJI_QWEN_ASR_API_KEY` 或模型设置中同一百炼服务的唯一凭据引用。也可以用 `wechatAsrApiKeyRef` 指定凭据。缺少百炼凭据时,手动转写沿用已启用的 DSH 语音识别服务。
|
|
38
38
|
|
|
39
39
|
## 日志收集
|
|
40
40
|
|
|
@@ -276,6 +276,8 @@ Independent customer materials are opt-in via materialRetrievalEnabled, material
|
|
|
276
276
|
|
|
277
277
|
新版默认准备公司托管上报,无需在每台电脑填写 Langfuse 地址、配置文件或 Key。完成钉钉企业身份验证,并且公司服务器已启用生产观测策略后,销售助手会采集后续手动及自动起草的客户问题、最终回复、耗时和结果状态。普通 DSH 模型和公司共享模型均可使用。显式 `salesQuestionTracing:false` 停止采集,已有私有配置文件直连方式继续兼容。
|
|
278
278
|
|
|
279
|
+
同一设备的企业观测授权在 Host 内复用 60 秒,并发查询共用一次请求。设备凭据变化、解绑或接口返回 401/403 后刷新授权结果。生产服务器对每次上报继续验证设备身份和观测权限。
|
|
280
|
+
|
|
279
281
|
事件在本机脱敏后进入有界持久队列;服务端确认写入后才移除。绑定变更不会把旧账号事件上传给新账号;重试复用固定标识。此前未采集的微信历史不会补传。本期问答上报不等同于完整 CRM/录音/画像及模型 token 调用链观测。生产知识库测试功能仍关闭。
|
|
280
282
|
|
|
281
283
|
服务端接收服务、私有凭据和代理发布维护在同级 `wanji_langfuse/services/company-observations`,需要先部署该入口再分发新版插件;只更新本地源码不会让其他电脑立刻生效。
|
package/dist/client.js
CHANGED
|
@@ -8232,6 +8232,8 @@ function VoiceAttachment({ src, t, onError, voiceMenu }) {
|
|
|
8232
8232
|
var transcriptionErrors = {
|
|
8233
8233
|
WECHAT_VOICE_NOT_AVAILABLE: "wxTranscriptVoicePending",
|
|
8234
8234
|
WECHAT_TRANSCRIPTION_NOT_CONFIGURED: "wxTranscriptNotConfigured",
|
|
8235
|
+
WECHAT_TRANSCRIPTION_COMPANY_DENIED: "wxTranscriptCompanyDenied",
|
|
8236
|
+
WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE: "wxTranscriptCompanyUnavailable",
|
|
8235
8237
|
WECHAT_TRANSCRIPTION_AUTH_FAILED: "wxTranscriptAuthFailed",
|
|
8236
8238
|
WECHAT_TRANSCRIPTION_TIMEOUT: "wxTranscriptTimeout",
|
|
8237
8239
|
WECHAT_TRANSCRIPTION_EMPTY: "wxTranscriptEmpty",
|
|
@@ -10245,6 +10247,8 @@ var zh = {
|
|
|
10245
10247
|
wxTranscribeVoice: "\u8F6C\u4E3A\u6587\u5B57",
|
|
10246
10248
|
wxTranscribingVoice: "\u6B63\u5728\u8F6C\u5199\u8BED\u97F3\u2026",
|
|
10247
10249
|
wxTranscriptUnavailable: "\u8BED\u97F3\u8F6C\u5199\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8BED\u97F3\u8BC6\u522B\u670D\u52A1\u540E\u91CD\u8BD5\u3002",
|
|
10250
|
+
wxTranscriptCompanyDenied: "\u4F01\u4E1A\u8BED\u97F3\u6388\u6743\u672A\u901A\u8FC7\u3002\u8BF7\u68C0\u67E5\u9489\u9489\u7ED1\u5B9A\u540E\u91CD\u8BD5\u3002",
|
|
10251
|
+
wxTranscriptCompanyUnavailable: "\u4F01\u4E1A\u8BED\u97F3\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
|
|
10248
10252
|
wxTranscriptVoicePending: "\u8BED\u97F3\u5C1A\u672A\u540C\u6B65\u5230\u672C\u673A\u3002\u8BF7\u540C\u6B65\u540E\u91CD\u8BD5\u3002",
|
|
10249
10253
|
wxTranscriptNotConfigured: "\u8BED\u97F3\u8BC6\u522B\u672A\u914D\u7F6E\u3002\u8BF7\u5728\u6A21\u578B\u8BBE\u7F6E\u4E2D\u914D\u7F6E\u963F\u91CC\u4E91\u767E\u70BC API Key\u3002",
|
|
10250
10254
|
wxTranscriptAuthFailed: "\u8BED\u97F3\u8BC6\u522B\u9274\u6743\u5931\u8D25\u3002\u8BF7\u68C0\u67E5\u963F\u91CC\u4E91\u767E\u70BC API Key \u548C\u6A21\u578B\u6743\u9650\u3002",
|
|
@@ -10579,6 +10583,8 @@ var en = {
|
|
|
10579
10583
|
wxTranscribeVoice: "Transcribe",
|
|
10580
10584
|
wxTranscribingVoice: "Transcribing\u2026",
|
|
10581
10585
|
wxTranscriptUnavailable: "Could not transcribe. Check the speech recognition service and retry.",
|
|
10586
|
+
wxTranscriptCompanyDenied: "Company speech access was denied. Check your DingTalk binding and try again.",
|
|
10587
|
+
wxTranscriptCompanyUnavailable: "Company speech recognition is unavailable. Try again later.",
|
|
10582
10588
|
wxTranscriptVoicePending: "This voice message has not synced yet. Sync it and try again.",
|
|
10583
10589
|
wxTranscriptNotConfigured: "Configure an Alibaba Cloud Model Studio API key in model settings to transcribe voice messages.",
|
|
10584
10590
|
wxTranscriptAuthFailed: "Speech recognition was denied. Check the Alibaba Cloud Model Studio API key and model access.",
|
package/dist/host.js
CHANGED
|
@@ -15839,7 +15839,7 @@ import { homedir, release } from "node:os";
|
|
|
15839
15839
|
import { isAbsolute, join } from "node:path";
|
|
15840
15840
|
|
|
15841
15841
|
// src/update/version.ts
|
|
15842
|
-
var RUNNING_VERSION = true ? "0.11.
|
|
15842
|
+
var RUNNING_VERSION = true ? "0.11.9" : "0.0.0-dev";
|
|
15843
15843
|
|
|
15844
15844
|
// src/diagnostics.ts
|
|
15845
15845
|
var MAX_FILE_BYTES = 512 * 1024;
|
|
@@ -16082,13 +16082,13 @@ async function api(target, keys, path3, body, request2 = fetch) {
|
|
|
16082
16082
|
const stage = path3 === "/api/public/health" ? "health" : path3 === "/api/public/projects" ? "projects" : path3 === "/api/public/otel/v1/traces" ? "trace-upload" : "api";
|
|
16083
16083
|
try {
|
|
16084
16084
|
response = await diagnosticHttp("langfuse.http." + stage, () => request2(target.baseUrl + path3, { method: body === void 0 ? "GET" : "POST", redirect: "error", signal, headers, ...body === void 0 ? {} : { body: JSON.stringify(body) } }), signal);
|
|
16085
|
-
} catch {
|
|
16086
|
-
throw new Error("connection-failed");
|
|
16085
|
+
} catch (cause) {
|
|
16086
|
+
throw new Error("connection-failed", { cause: signal.aborted ? signal.reason : cause });
|
|
16087
16087
|
}
|
|
16088
16088
|
if (!response.ok) throw Object.assign(new Error(response.status === 401 || response.status === 403 ? "authentication-failed" : "upload-rejected"), { status: response.status });
|
|
16089
16089
|
if (Number(response.headers.get("content-length")) > 8 * 1024 * 1024) throw new Error("invalid-receipt");
|
|
16090
|
-
const value = await response.json().catch(() => {
|
|
16091
|
-
throw new Error("invalid-receipt");
|
|
16090
|
+
const value = await response.json().catch((cause) => {
|
|
16091
|
+
throw new Error("invalid-receipt", { cause: signal.aborted ? signal.reason : cause });
|
|
16092
16092
|
});
|
|
16093
16093
|
if (value?.rejected > 0 || value?.partialSuccess?.rejectedSpans > 0 || value?.partial_success?.rejected_spans > 0) throw new Error("upload-rejected");
|
|
16094
16094
|
return value;
|
|
@@ -16108,52 +16108,62 @@ async function preflight(target, secrets = keychainCredentials, request2 = fetch
|
|
|
16108
16108
|
// src/company/observations.ts
|
|
16109
16109
|
var endpoint = "https://wanjidazi.com/api/v1/sales-company/observations";
|
|
16110
16110
|
var credentialRef = "WANJI_DSH_COMPANY_DEVICE_TOKEN";
|
|
16111
|
+
var policyTtlMs = 6e4;
|
|
16111
16112
|
var COMPANY_OBSERVATION_TARGET = resolveTarget("managed-sales-production", {
|
|
16112
16113
|
baseUrl: PRODUCTION_LANGFUSE_BASE_URL,
|
|
16113
16114
|
projectId: PRODUCTION_LANGFUSE_PROJECT_ID,
|
|
16114
16115
|
credentialsRef: "wanji-langfuse-api-managed-sales-production"
|
|
16115
16116
|
});
|
|
16116
16117
|
function createCompanyObservationRelay(store, request2 = fetch) {
|
|
16118
|
+
let current;
|
|
16117
16119
|
async function credential() {
|
|
16118
16120
|
const value = await store()?.resolve(credentialRef);
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
const scope2 = (token) => createHash2("sha256").update(token).digest("hex");
|
|
16122
|
-
let cached;
|
|
16123
|
-
async function deviceScope() {
|
|
16124
|
-
const token = await credential();
|
|
16125
|
-
if (!token) {
|
|
16126
|
-
cached = void 0;
|
|
16121
|
+
if (value?.source !== "file" || !/^[A-Za-z0-9_-]{43}$/.test(value.value)) {
|
|
16122
|
+
current = void 0;
|
|
16127
16123
|
return;
|
|
16128
16124
|
}
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16140
|
-
|
|
16125
|
+
const scope2 = createHash2("sha256").update(value.value).digest("hex");
|
|
16126
|
+
if (current?.scope !== scope2) current = { scope: scope2, until: 0 };
|
|
16127
|
+
return { token: value.value, policy: current };
|
|
16128
|
+
}
|
|
16129
|
+
function invalidate(policy) {
|
|
16130
|
+
if (current === policy) current = void 0;
|
|
16131
|
+
}
|
|
16132
|
+
async function loadPolicy(token, state2) {
|
|
16133
|
+
const response = await request2(endpoint + "/policy", {
|
|
16134
|
+
method: "POST",
|
|
16135
|
+
redirect: "error",
|
|
16136
|
+
credentials: "omit",
|
|
16137
|
+
headers: { Authorization: "Bearer " + token },
|
|
16138
|
+
signal: AbortSignal.timeout(5e3)
|
|
16139
|
+
});
|
|
16141
16140
|
if (!response.ok) {
|
|
16141
|
+
if (response.status === 401 || response.status === 403) invalidate(state2);
|
|
16142
16142
|
await response.body?.cancel();
|
|
16143
|
-
if (response.status >= 500 && cached?.scope === scope2(token) && cached.until > Date.now()) return cached.scope;
|
|
16144
|
-
cached = void 0;
|
|
16145
16143
|
return;
|
|
16146
16144
|
}
|
|
16147
16145
|
const policy = await response.json();
|
|
16148
|
-
if (policy
|
|
16149
|
-
|
|
16150
|
-
|
|
16151
|
-
|
|
16152
|
-
|
|
16146
|
+
if (policy?.enabled !== true || policy.project_id !== PRODUCTION_LANGFUSE_PROJECT_ID || policy.device_scope !== state2.scope) return;
|
|
16147
|
+
if (current !== state2 || (await credential())?.policy !== state2 || current !== state2) return;
|
|
16148
|
+
state2.until = performance.now() + policyTtlMs;
|
|
16149
|
+
return state2.scope;
|
|
16150
|
+
}
|
|
16151
|
+
async function deviceScope() {
|
|
16152
|
+
const binding = await credential();
|
|
16153
|
+
if (!binding || current !== binding.policy) return;
|
|
16154
|
+
const { policy, token } = binding;
|
|
16155
|
+
if (policy.until > performance.now()) return policy.scope;
|
|
16156
|
+
policy.pending ??= loadPolicy(token, policy).catch(() => void 0).finally(() => {
|
|
16157
|
+
policy.pending = void 0;
|
|
16158
|
+
});
|
|
16159
|
+
const scope2 = await policy.pending;
|
|
16160
|
+
return current === policy ? scope2 : void 0;
|
|
16153
16161
|
}
|
|
16154
16162
|
async function submit(event, signal) {
|
|
16155
|
-
const
|
|
16156
|
-
if (!
|
|
16163
|
+
const binding = await credential();
|
|
16164
|
+
if (!binding || current !== binding.policy || event.question?.deviceScope !== binding.policy.scope)
|
|
16165
|
+
throw Error("company-observation-identity-changed");
|
|
16166
|
+
const { token, policy } = binding;
|
|
16157
16167
|
const response = await request2(endpoint, {
|
|
16158
16168
|
method: "POST",
|
|
16159
16169
|
redirect: "error",
|
|
@@ -16162,7 +16172,7 @@ function createCompanyObservationRelay(store, request2 = fetch) {
|
|
|
16162
16172
|
headers: { Authorization: "Bearer " + token, "Content-Type": "application/json" },
|
|
16163
16173
|
body: JSON.stringify({
|
|
16164
16174
|
event_id: event.id,
|
|
16165
|
-
device_scope:
|
|
16175
|
+
device_scope: policy.scope,
|
|
16166
16176
|
session_id: event.question.sessionId,
|
|
16167
16177
|
source: event.question.source,
|
|
16168
16178
|
started_at: event.startedAt,
|
|
@@ -16172,6 +16182,7 @@ function createCompanyObservationRelay(store, request2 = fetch) {
|
|
|
16172
16182
|
})
|
|
16173
16183
|
});
|
|
16174
16184
|
if (!response.ok) {
|
|
16185
|
+
if (response.status === 401 || response.status === 403) invalidate(policy);
|
|
16175
16186
|
await response.body?.cancel();
|
|
16176
16187
|
throw Error("company-observation-upload-pending");
|
|
16177
16188
|
}
|
|
@@ -19091,6 +19102,9 @@ async function transcribeWechatWav(audio, apiKey, signal) {
|
|
|
19091
19102
|
await response.body?.cancel();
|
|
19092
19103
|
throw new WechatTranscriptionError(response.status === 401 || response.status === 403 ? "WECHAT_TRANSCRIPTION_AUTH_FAILED" : "WECHAT_TRANSCRIPTION_UNAVAILABLE");
|
|
19093
19104
|
}
|
|
19105
|
+
return readWechatTranscript(response, signal);
|
|
19106
|
+
}
|
|
19107
|
+
async function readWechatTranscript(response, signal) {
|
|
19094
19108
|
const result = await readJson(response, 256 * 1024, signal);
|
|
19095
19109
|
const choice2 = result?.choices?.[0], content = choice2?.message?.content;
|
|
19096
19110
|
if (choice2?.finish_reason !== "stop" || typeof content !== "string") throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_UNAVAILABLE");
|
|
@@ -37578,14 +37592,15 @@ function serialize(span) {
|
|
|
37578
37592
|
return { resource: { attributes: attrs(span.resource.attributes) }, scopeSpans: [{ scope: { name: span.instrumentationScope.name, version: span.instrumentationScope.version }, spans: [{ traceId: c.traceId, spanId: c.spanId, ...span.parentSpanContext ? { parentSpanId: span.parentSpanContext.spanId } : {}, name: span.name, kind: span.kind + 1, startTimeUnixNano: nanos(span.startTime), endTimeUnixNano: nanos(span.endTime), attributes: attrs(span.attributes), status: span.status }] }] };
|
|
37579
37593
|
}
|
|
37580
37594
|
async function exportObservation(event, keys, extra2) {
|
|
37581
|
-
let
|
|
37595
|
+
let failure;
|
|
37596
|
+
let acknowledged = false;
|
|
37582
37597
|
const exporter = {
|
|
37583
37598
|
export(spans, callback) {
|
|
37584
37599
|
void api(event.target, keys, "/api/public/otel/v1/traces", { resourceSpans: spans.map(serialize) }).then(() => {
|
|
37585
37600
|
acknowledged = true;
|
|
37586
37601
|
callback({ code: import_core10.ExportResultCode.SUCCESS });
|
|
37587
37602
|
}, (error) => {
|
|
37588
|
-
|
|
37603
|
+
failure = error;
|
|
37589
37604
|
diagnostic("langfuse.trace-receipt", "failed", {}, error);
|
|
37590
37605
|
callback({ code: import_core10.ExportResultCode.FAILED });
|
|
37591
37606
|
});
|
|
@@ -37645,8 +37660,12 @@ async function exportObservation(event, keys, extra2) {
|
|
|
37645
37660
|
span.setAttribute("langfuse.observation.level", "ERROR");
|
|
37646
37661
|
}
|
|
37647
37662
|
span.end(new Date(Date.parse(event.startedAt) + event.elapsedMs));
|
|
37648
|
-
|
|
37649
|
-
|
|
37663
|
+
try {
|
|
37664
|
+
await provider.forceFlush();
|
|
37665
|
+
} catch (cause) {
|
|
37666
|
+
throw new Error("upload-failed", { cause: failure ?? cause });
|
|
37667
|
+
}
|
|
37668
|
+
if (failure || !acknowledged) throw new Error("upload-failed", { cause: failure });
|
|
37650
37669
|
} finally {
|
|
37651
37670
|
await provider.shutdown();
|
|
37652
37671
|
}
|
|
@@ -45207,6 +45226,29 @@ function createCompanyConnection({ credentials, settings, fetch: request2 = fetc
|
|
|
45207
45226
|
...typeof value.position === "string" ? { position: value.position } : {}
|
|
45208
45227
|
};
|
|
45209
45228
|
}),
|
|
45229
|
+
async transcribeVoice(audio, signal) {
|
|
45230
|
+
if (!verified && (await identity.refresh(signal)).status !== "bound") return;
|
|
45231
|
+
const secret = await token();
|
|
45232
|
+
if (!secret) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_DENIED");
|
|
45233
|
+
const response = await request2(COMPANY_ORIGIN + ROOT + "/voice/transcribe", {
|
|
45234
|
+
method: "POST",
|
|
45235
|
+
redirect: "error",
|
|
45236
|
+
credentials: "omit",
|
|
45237
|
+
signal,
|
|
45238
|
+
headers: { "Content-Type": "audio/wav", Authorization: "Bearer " + secret },
|
|
45239
|
+
body: Buffer.from(audio)
|
|
45240
|
+
});
|
|
45241
|
+
if (!response.ok) {
|
|
45242
|
+
await response.body?.cancel();
|
|
45243
|
+
if (response.status === 401 || response.status === 403) {
|
|
45244
|
+
verified = false;
|
|
45245
|
+
throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_DENIED");
|
|
45246
|
+
}
|
|
45247
|
+
if (response.status === 413 || response.status === 400) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
45248
|
+
throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE");
|
|
45249
|
+
}
|
|
45250
|
+
return readWechatTranscript(response, signal);
|
|
45251
|
+
},
|
|
45210
45252
|
begin: (hint, signal) => ordered(signal, async () => {
|
|
45211
45253
|
const previous = await token();
|
|
45212
45254
|
if (previous) await revoke(previous, signal);
|
|
@@ -45286,7 +45328,7 @@ function safeView(identity, service, ready) {
|
|
|
45286
45328
|
async function readAccountPhone(account) {
|
|
45287
45329
|
if (typeof account?.getProfile !== "function") return;
|
|
45288
45330
|
const result = await account.getProfile({
|
|
45289
|
-
version: true ? "0.11.
|
|
45331
|
+
version: true ? "0.11.9" : "0.0.0",
|
|
45290
45332
|
locale: Intl.DateTimeFormat().resolvedOptions().locale,
|
|
45291
45333
|
timezoneOffsetSeconds: -(/* @__PURE__ */ new Date()).getTimezoneOffset() * 60
|
|
45292
45334
|
});
|
|
@@ -45691,6 +45733,10 @@ function activate(ctx, rawConfig) {
|
|
|
45691
45733
|
}, async transcribeVoice(audio, signal, mode) {
|
|
45692
45734
|
if (audio.length > config.maxAudioBytes) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
45693
45735
|
if (mode === "manual") {
|
|
45736
|
+
const identity = companyIdentity();
|
|
45737
|
+
const companyText = await identity?.transcribeVoice?.(audio, signal);
|
|
45738
|
+
if (companyText !== void 0) return companyText;
|
|
45739
|
+
if (identity?.canUseSharedModel()) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE");
|
|
45694
45740
|
const apiKey = await resolveWechatAsrKey(config.wechatAsrApiKeyRef, optional.get?.("credentials"), optional.get?.("settings"));
|
|
45695
45741
|
signal.throwIfAborted();
|
|
45696
45742
|
if (apiKey) return transcribeWechatWav(audio, apiKey, signal);
|
|
@@ -22,6 +22,7 @@ export interface SalesCompanyIdentity {
|
|
|
22
22
|
refresh(signal: AbortSignal): Promise<VerifiedIdentity>;
|
|
23
23
|
begin(hint: CompanyBindingHint, signal: AbortSignal): Promise<VerifiedIdentity>;
|
|
24
24
|
unbind(signal: AbortSignal): Promise<void>;
|
|
25
|
+
transcribeVoice?(audio: Uint8Array, signal: AbortSignal): Promise<string | undefined>;
|
|
25
26
|
canUseSharedModel(): boolean;
|
|
26
27
|
}
|
|
27
28
|
type ModelSelection = {
|
|
@@ -14,7 +14,8 @@ type ProviderSettings = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare function resolveWechatAsrKey(ref: string, store?: CredentialStore, settings?: ProviderSettings): Promise<string | undefined>;
|
|
16
16
|
export declare class WechatTranscriptionError extends Error {
|
|
17
|
-
constructor(code: 'WECHAT_TRANSCRIPTION_NOT_CONFIGURED' | 'WECHAT_TRANSCRIPTION_AUTH_FAILED' | 'WECHAT_TRANSCRIPTION_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_INVALID_AUDIO');
|
|
17
|
+
constructor(code: 'WECHAT_TRANSCRIPTION_COMPANY_DENIED' | 'WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_NOT_CONFIGURED' | 'WECHAT_TRANSCRIPTION_AUTH_FAILED' | 'WECHAT_TRANSCRIPTION_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_INVALID_AUDIO');
|
|
18
18
|
}
|
|
19
19
|
export declare function transcribeWechatWav(audio: Uint8Array, apiKey: string, signal: AbortSignal): Promise<string>;
|
|
20
|
+
export declare function readWechatTranscript(response: Response, signal: AbortSignal): Promise<string>;
|
|
20
21
|
export {};
|
|
@@ -107,7 +107,16 @@ python3 plugins/sales-assistant/scripts/verify-dual-evaluation.py --run outputs/
|
|
|
107
107
|
|
|
108
108
|
三维各为 0–100 的整数,由程序按权重换算总分。高分占比为总分 ≥80 的数量除以有效评分数,低分占比为总分 <60 的数量除以有效评分数。三维缺项、评分错误和普通未出稿单列,0 分是有效结果。已出稿率、检索命中率和业务盲评分别统计。
|
|
109
109
|
|
|
110
|
-
线上评估器读取 `output.evaluation`
|
|
110
|
+
线上评估器读取 `output.evaluation` 中的冻结用例、最终正文及可用证据。评测规则匹配当前环境和口径标记。`grade-agent-reply-quality.mts` 在隔离 Host 内复评,`langfuse-reply-quality.mts` 上传冻结草稿、收集三维评分并写入按权重计算的总分。运行档案应保留题目和素材版本、候选构建、出稿状态、模型、分母及逐题记录。
|
|
111
|
+
|
|
112
|
+
常规评测使用独立 Langfuse 实例,脚本从 `WANJI_SALES_TEST_LANGFUSE_CONFIG` 或默认测试配置读取目标。生产补传使用 `--production-backfill`,同时显式给出题数,偏移量默认从 0 开始。上传与收集均适用,生产收集只查询选中题目的观测评分。生产批次串行,每秒最多开始一题。每题结束后原子保存回执,连续三题超时则保存进度并以非零状态退出。
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
node plugins/sales-assistant/scripts/langfuse-reply-quality.mts upload manifest.json test-receipt.json isolated-run
|
|
116
|
+
node plugins/sales-assistant/scripts/langfuse-reply-quality.mts --production-backfill upload manifest.json prod-receipt.json repair-run 20 0
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
中断后使用原回执和运行名重跑指定范围,已成功上传的草稿按稳定身份跳过查重和上传。回执中的 `batch` 标明本次选择的范围,`results` 累积同一次运行已经处理的题目。生产及隔离实例的回执各自绑定其项目和评测规则。
|
|
111
120
|
|
|
112
121
|
### 销售与产品共识口径
|
|
113
122
|
|
package/package.json
CHANGED