feat(file-check): 更新文件检核工具 API Key 配置及相关文档
This commit is contained in:
1 parent
634dee4b81
commit
55cf7ff734
74 files changed
+1525
-1182
No files matched your search
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* 出货聊天:数字菜单解析、动作按钮合并、决策文本识别(纯函数)。
|
||||
*
|
||||
* 菜单行格式示例:「1. 上传库存文件」→ action: upload
|
||||
* resolveShippingActionButtons:优先 API 按钮,其次 HTML 指令,最后内容推断
|
||||
* features/chat/shipping/shippingMenu.ts
|
||||
* 用途:发货聊天数字菜单解析、动作按钮合并与决策文本识别(纯函数)。
|
||||
* 依赖:shippingText.extractShippingActionsDirective、types/shipping.types。
|
||||
* 逻辑:useChatShippingSendHandler 在发送前调用;优先 API 按钮,其次 HTML 指令,最后内容推断。
|
||||
*/
|
||||
import { extractShippingActionsDirective } from './shippingText';
|
||||
import type { ShippingActionButton, ShippingMenuAction } from '../types/shipping.types';
|
||||
|
||||
/**
|
||||
* 将 human_options 动作 id 列表转为带 Tailwind 样式的按钮 class。
|
||||
*/
|
||||
export function shippingActionButtonClass(variant?: string): string {
|
||||
if (variant === 'primary') {
|
||||
return 'rounded-xl bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60';
|
||||
@@ -73,6 +76,9 @@ export function normalizeApiShippingButtons(
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并 API 按钮、HTML 指令与内容推断,得到最终 action_buttons 与 cleanedText。
|
||||
*/
|
||||
export function resolveShippingActionButtons(
|
||||
content: string,
|
||||
apiButtons: Array<{ id: string; label: string; message: string; variant?: string }> | null,
|
||||
@@ -95,6 +101,9 @@ export function resolveShippingActionButtons(
|
||||
return { buttons: [], cleanedText: directive.cleanedText, fromDirective: false };
|
||||
}
|
||||
|
||||
/**
|
||||
* 从用户文本与助手上下文识别 submit_decision 所需的 action id。
|
||||
*/
|
||||
export function resolveShippingDecisionFromText(text: string, assistantContext: string): string | null {
|
||||
const normalized = text.trim();
|
||||
const direct: Record<string, string> = {
|
||||
|
||||
Reference in new issue
Block a user