getCurrentChatHistoryId(); if ($iHistoryId <= 0) return 'no_history'; BxDolDb::getInstance()->query(" INSERT INTO `sys_agents_chat_artifacts` (`history_id`, `field_name`, `field_value`, `updated_at`) VALUES (:h, :n, :v, :t) ON DUPLICATE KEY UPDATE `field_value` = VALUES(`field_value`), `updated_at` = VALUES(`updated_at`) ", [ 'h' => $iHistoryId, 'n' => $sName, 'v' => $sValue, 't' => time(), ]); return 'ok'; } }