{"id":291,"date":"2025-06-18T23:01:27","date_gmt":"2025-06-18T16:01:27","guid":{"rendered":"https:\/\/canhtacthongminh.vn\/?page_id=291"},"modified":"2026-04-05T21:22:35","modified_gmt":"2026-04-05T14:22:35","slug":"chuyen-gia-ai","status":"publish","type":"page","link":"https:\/\/canhtacthongminh.vn\/index.php\/chuyen-gia-ai\/","title":{"rendered":"Chuy\u00ean gia AI"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"vi\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Chuy\u00ean Gia AI Snippet<\/title>\n    <!-- Tailwind CSS \u0111\u1ec3 l\u00e0m \u0111\u1eb9p. B\u1ea1n c\u00f3 th\u1ec3 thay th\u1ebf b\u1eb1ng CSS c\u1ee7a ri\u00eang m\u00ecnh. -->\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\n    <!-- Font Quicksand, c\u00f3 th\u1ec3 thay \u0111\u1ed5i \u0111\u1ec3 h\u1ee3p v\u1edbi website c\u1ee7a b\u1ea1n -->\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Quicksand:wght@400;500;600;700&#038;display=swap\" rel=\"stylesheet\">\n    <style>\n        \/* CSS t\u00f9y ch\u1ec9nh \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o snippet ho\u1ea1t \u0111\u1ed9ng \u0111\u1ed9c l\u1eadp *\/\n        body {\n            font-family: 'Quicksand', sans-serif;\n            background-color: #f9fafb; \/* bg-gray-50 *\/\n        }\n        #ask-ai-button:disabled {\n            background-color: #9ca3af; \/* bg-gray-400 *\/\n            cursor: not-allowed;\n        }\n        \/* Style cho n\u1ed9i dung Markdown tr\u1ea3 v\u1ec1 *\/\n        .prose strong {\n            font-weight: 700;\n        }\n        .prose ul {\n            list-style-type: disc;\n            padding-left: 1.5rem;\n            margin-top: 1rem;\n            margin-bottom: 1rem;\n        }\n         .prose li {\n            margin-top: 0.5rem;\n        }\n    <\/style>\n<\/head>\n<body class=\"p-8\">\n\n<!-- === B\u1eaeT \u0110\u1ea6U \u0110O\u1ea0N M\u00c3 NH\u00daNG === -->\n<section id=\"ai-expert\" class=\"py-16 bg-white\">\n    <div class=\"container mx-auto max-w-4xl px-4 sm:px-6 lg:px-8\">\n        <div class=\"text-center mb-12\">\n            <h2 class=\"text-3xl lg:text-4xl font-bold text-green-800\">Tr\u00f2 Chuy\u1ec7n C\u00f9ng Chuy\u00ean Gia AI \u2728<\/h2>\n            <p class=\"mt-4 max-w-3xl mx-auto text-lg text-gray-600\">\n                B\u1ea1n c\u00f3 th\u1eafc m\u1eafc v\u1ec1 s\u00e2u b\u1ec7nh, k\u1ef9 thu\u1eadt canh t\u00e1c hay th\u1eddi v\u1ee5 cho c\u00e2y tr\u1ed3ng c\u1ee7a m\u00ecnh? H\u00e3y \u0111\u1eb7t c\u00e2u h\u1ecfi v\u00e0 \u0111\u1ec3 chuy\u00ean gia AI c\u1ee7a ch\u00fang t\u00f4i h\u1ed7 tr\u1ee3 b\u1ea1n.\n            <\/p>\n        <\/div>\n\n        <div class=\"bg-green-50 p-6 sm:p-8 rounded-lg shadow-lg\">\n            <div class=\"mb-4\">\n                <label for=\"ai-question\" class=\"block mb-2 text-sm font-medium text-gray-900\">C\u00e2u h\u1ecfi c\u1ee7a b\u1ea1n:<\/label>\n                <textarea id=\"ai-question\" rows=\"3\" class=\"bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5\" placeholder=\"V\u00ed d\u1ee5: L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 tr\u1ecb b\u1ec7nh \u0111\u1ea1o \u00f4n tr\u00ean l\u00faa m\u1ed9t c\u00e1ch h\u1eefu c\u01a1?\"><\/textarea>\n            <\/div>\n            <button id=\"ask-ai-button\" class=\"w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-8 rounded-full transition-colors duration-300\">\n                <span id=\"button-text\">G\u1eedi C\u00e2u H\u1ecfi<\/span>\n                <span id=\"button-loader\" class=\"hidden\">\u0110ang x\u1eed l\u00fd&#8230;<\/span>\n            <\/button>\n        <\/div>\n\n        <div id=\"ai-response-container\" class=\"mt-8 bg-gray-100 p-6 rounded-lg\" style=\"display: none;\">\n             <h3 class=\"font-bold text-gray-800 mb-4 border-b pb-2\">Chuy\u00ean gia AI tr\u1ea3 l\u1eddi:<\/h3>\n             <div id=\"ai-response-content\" class=\"text-gray-700 leading-relaxed prose max-w-none\">\n             <\/div>\n        <\/div>\n    <\/div>\n<\/section>\n<!-- === K\u1ebeT TH\u00daC \u0110O\u1ea0N M\u00c3 NH\u00daNG === -->\n\n<script>\ndocument.addEventListener('DOMContentLoaded', () => {\n    \/\/ L\u1ea5y c\u00e1c ph\u1ea7n t\u1eed HTML c\u1ea7n thi\u1ebft\n    const askAiButton = document.getElementById('ask-ai-button');\n    const aiQuestionInput = document.getElementById('ai-question');\n    const aiResponseContainer = document.getElementById('ai-response-container');\n    const aiResponseContent = document.getElementById('ai-response-content');\n    const buttonText = document.getElementById('button-text');\n    const buttonLoader = document.getElementById('button-loader');\n\n    \/\/ Th\u00eam s\u1ef1 ki\u1ec7n click cho n\u00fat \"G\u1eedi C\u00e2u H\u1ecfi\"\n    askAiButton.addEventListener('click', async () => {\n        const question = aiQuestionInput.value.trim();\n        if (!question) {\n            alert('Vui l\u00f2ng nh\u1eadp c\u00e2u h\u1ecfi c\u1ee7a b\u1ea1n.');\n            return;\n        }\n\n        \/\/ Thi\u1ebft l\u1eadp tr\u1ea1ng th\u00e1i \u0111ang t\u1ea3i\n        askAiButton.disabled = true;\n        buttonText.classList.add('hidden');\n        buttonLoader.classList.remove('hidden');\n        aiResponseContainer.style.display = 'block';\n        aiResponseContent.innerHTML = `<p>Chuy\u00ean gia \u0111ang suy ngh\u0129, vui l\u00f2ng ch\u1edd trong gi\u00e2y l\u00e1t...<\/p>`;\n        \n        \/\/ T\u1ea1o c\u00e2u l\u1ec7nh (prompt) cho Gemini\n        const prompt = `H\u00e3y \u0111\u00f3ng vai m\u1ed9t chuy\u00ean gia n\u00f4ng nghi\u1ec7p gi\u00e0u kinh nghi\u1ec7m t\u1ea1i Vi\u1ec7t Nam v\u1edbi nh\u1eefng t\u00ean th\u00e2n thu\u1ed9c c\u1ee7a ng\u01b0\u1eddi Vi\u1ec7t Nam. Tr\u1ea3 l\u1eddi c\u00e2u h\u1ecfi sau m\u1ed9t c\u00e1ch r\u00f5 r\u00e0ng, s\u00fac t\u00edch, chi ti\u1ebft v\u00e0 d\u1ec5 hi\u1ec3u cho ng\u01b0\u1eddi n\u00f4ng d\u00e2n k\u00e8m h\u00ecnh \u1ea3nh v\u00e0 video th\u1ef1c t\u1ebf \u1edf m\u1ed9t s\u1ed1 c\u00e1nh \u0111\u1ed3ng, v\u01b0\u1eddn tr\u00e1i c\u00e2y \u1edf nh\u1eefng khu v\u1ef1c c\u00f3 li\u00ean quan \u0111\u1ebfn v\u1ea5n \u0111\u1ec1 v\u00e0 hi\u1ec3n th\u1ecb tr\u1ef1c quan b\u1eb1ng h\u00ecnh \u1ea3nh cho ng\u01b0\u1eddi xem d\u1eabn ngu\u1ed3n t\u1eeb k\u00eanh youtube c\u1ee7a Canh t\u00e1c th\u00f4ng minh t\u1ea1i \u0111\u1ecba ch\u1ec9 https:\/\/www.youtube.com\/c\/CanhT%C3%A1cTh%C3%B4ngMinh . S\u1eed d\u1ee5ng c\u00e1c g\u1ea1ch \u0111\u1ea7u d\u00f2ng v\u00e0 \u0111\u1ecbnh d\u1ea1ng markdown \u0111\u1ec3 c\u00e2u tr\u1ea3 l\u1eddi d\u1ec5 \u0111\u1ecdc.\n\nC\u00e2u h\u1ecfi: \"${question}\"`;\n\n        try {\n            \/\/ !!! QUAN TR\u1eccNG: Thay th\u1ebf b\u1eb1ng API Key c\u1ee7a b\u1ea1n !!!\n            const apiKey = \"AIzaSyCODbMyrmX-sCdzylxoifmozdRaiNQRTSI\"; \n            const apiUrl = `https:\/\/generativelanguage.googleapis.com\/v1\/models\/gemini-1.5-flash:generateContent?key=${apiKey}`;\n            \n            const payload = {\n                contents: [{\n                    role: \"user\",\n                    parts: [{ text: prompt }]\n                }]\n            };\n\n            \/\/ G\u1ecdi API\n            const response = await fetch(apiUrl, {\n                method: 'POST',\n                headers: { 'Content-Type': 'application\/json' },\n                body: JSON.stringify(payload)\n            });\n\n            if (!response.ok) {\n                throw new Error(`API call failed with status: ${response.status}`);\n            }\n\n            const result = await response.json();\n            \n            \/\/ X\u1eed l\u00fd v\u00e0 hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3\n            if (result.candidates && result.candidates[0]?.content?.parts?.[0]?.text) {\n    let rawText = result.candidates[0].content.parts[0].text;\n    \n    \/\/ X\u1eed l\u00fd Markdown c\u01a1 b\u1ea3n th\u00e0nh HTML s\u1ea1ch h\u01a1n\n    let htmlContent = rawText\n        .replace(\/^### (.*$)\/gim, '<h3 class=\"text-lg font-bold mt-4\">$1<\/h3>')\n        .replace(\/^## (.*$)\/gim, '<h2 class=\"text-xl font-bold mt-6\">$1<\/h2>')\n        .replace(\/^\\* (.*$)\/gim, '<li class=\"ml-4 list-disc\">$1<\/li>')\n        .replace(\/^\\- (.*$)\/gim, '<li class=\"ml-4 list-disc\">$1<\/li>')\n        .replace(\/\\*\\*(.*?)\\*\\*\/g, '<strong>$1<\/strong>')\n        .replace(\/\\n\/g, '<br>');\n\n    aiResponseContent.innerHTML = `<div class=\"space-y-2\">${htmlContent}<\/div>`;\n}\n            } else {\n                 aiResponseContent.innerHTML = '<p>R\u1ea5t ti\u1ebfc, \u0111\u00e3 c\u00f3 l\u1ed7i x\u1ea3y ra ho\u1eb7c kh\u00f4ng nh\u1eadn \u0111\u01b0\u1ee3c ph\u1ea3n h\u1ed3i h\u1ee3p l\u1ec7. Vui l\u00f2ng th\u1eed l\u1ea1i sau.<\/p>';\n                 console.error('Unexpected API response structure:', result);\n            }\n\n        } catch (error) {\n            console.error('Error calling Gemini API:', error);\n            aiResponseContent.innerHTML = '<p>Kh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i \u0111\u1ebfn chuy\u00ean gia AI l\u00fac n\u00e0y. Vui l\u00f2ng ki\u1ec3m tra l\u1ea1i API Key v\u00e0 k\u1ebft n\u1ed1i m\u1ea1ng.<\/p>';\n        } finally {\n            \/\/ Kh\u00f4i ph\u1ee5c tr\u1ea1ng th\u00e1i n\u00fat b\u1ea5m\n            askAiButton.disabled = false;\n            buttonText.classList.remove('hidden');\n            buttonLoader.classList.add('hidden');\n        }\n    });\n});\n<\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Chuy\u00ean Gia AI Snippet Tr\u00f2 Chuy\u1ec7n C\u00f9ng Chuy\u00ean Gia AI \u2728 B\u1ea1n c\u00f3 th\u1eafc m\u1eafc v\u1ec1 s\u00e2u b\u1ec7nh, k\u1ef9 thu\u1eadt canh t\u00e1c hay th\u1eddi v\u1ee5 cho c\u00e2y tr\u1ed3ng c\u1ee7a m\u00ecnh? H\u00e3y \u0111\u1eb7t c\u00e2u h\u1ecfi v\u00e0 \u0111\u1ec3 chuy\u00ean gia AI c\u1ee7a ch\u00fang t\u00f4i h\u1ed7 tr\u1ee3 b\u1ea1n. C\u00e2u h\u1ecfi c\u1ee7a b\u1ea1n: G\u1eedi C\u00e2u H\u1ecfi \u0110ang x\u1eed l\u00fd&#8230; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/canhtacthongminh.vn\/index.php\/chuyen-gia-ai\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Chuy\u00ean gia AI&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-291","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/pages\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/comments?post=291"}],"version-history":[{"count":51,"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/pages\/291\/revisions"}],"predecessor-version":[{"id":527,"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/pages\/291\/revisions\/527"}],"wp:attachment":[{"href":"https:\/\/canhtacthongminh.vn\/index.php\/wp-json\/wp\/v2\/media?parent=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}