Fix NLU flow: media_id, upload perm, catalog filter, nlu_description field
- WpWebhook: inject media_id into context before calling BotRouter so MediaTranscriber can download audio/image (was passing caption='') - BotRouter: use context['media_id'] for transcription (non-breaking fallback) - AiBot::processMedia: fix canUpload to include permType 1 (solo reporta) - AiBot::buildFlowCatalog: include text flows that have nlu_description set - DashboardController + index.php: add nlu_description field per flow card Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
bb4b5dab10
commit
1d9484a1e0
@@ -3383,6 +3383,7 @@ HTML;
|
||||
$flowIdx = 0;
|
||||
foreach ($flows as $fk => $flow) {
|
||||
$ft = $flow['type'] ?? 'text';
|
||||
$fNluDesc = self::h($flow['nlu_description'] ?? '');
|
||||
$fMsg = self::h($flow['message'] ?? '');
|
||||
$fFn = $flow['function'] ?? 'forward_to_ai';
|
||||
$fMenu = $flow['menu'] ?? '';
|
||||
@@ -3498,6 +3499,8 @@ HTML;
|
||||
<div class=\"item-card\" id=\"flow-card-{$flowIdx}\">
|
||||
<div class=\"item-head\">
|
||||
<span>ID: <input type=\"text\" name=\"flow_key[]\" value=\"" . self::h($fk) . "\" style=\"border:none;background:transparent;font-weight:700;color:#0b3d91;width:180px;font-size:13px\"></span>
|
||||
<span style=\"font-size:11px;color:#7a8291;font-weight:400;margin-left:8px\">🧠 NLU:</span>
|
||||
<input type=\"text\" name=\"flow_nlu_desc[]\" value=\"{$fNluDesc}\" placeholder=\"Descripción para IA (ej: Registrar pluviometría)\" style=\"border:none;background:#f0f4ff;border-radius:4px;padding:2px 8px;font-size:11px;color:#374151;flex:1;min-width:0\">
|
||||
<button type=\"button\" class=\"del\" onclick=\"this.closest('.item-card').remove()\">✕</button>
|
||||
</div>
|
||||
<div class=\"form-row\" style=\"align-items:flex-start;gap:10px\">
|
||||
@@ -4028,6 +4031,8 @@ function addFlowCard() {
|
||||
'<div class="item-card" id="' + cardId + '">' +
|
||||
' <div class="item-head">' +
|
||||
' <span>ID: <input type="text" name="flow_key[]" value="" style="border:none;background:transparent;font-weight:700;color:#0b3d91;width:180px;font-size:13px" placeholder="nuevo_flujo"></span>' +
|
||||
' <span style="font-size:11px;color:#7a8291;font-weight:400;margin-left:8px">🧠 NLU:</span>' +
|
||||
' <input type="text" name="flow_nlu_desc[]" value="" placeholder="Descripción para IA (ej: Registrar pluviometría)" style="border:none;background:#f0f4ff;border-radius:4px;padding:2px 8px;font-size:11px;color:#374151;flex:1;min-width:0">' +
|
||||
' <button type="button" class="del" onclick="this.closest(\'.item-card\').remove()">✕</button>' +
|
||||
' </div>' +
|
||||
' <div class="form-row" style="align-items:flex-start;gap:10px">' +
|
||||
|
||||
Reference in New Issue
Block a user