{"id":375,"date":"2026-04-28T20:07:54","date_gmt":"2026-04-28T12:07:54","guid":{"rendered":"https:\/\/flycloud.io\/?p=375"},"modified":"2026-10-07T20:32:49","modified_gmt":"2026-10-07T12:32:49","slug":"%e4%bd%bf%e7%94%a8-vertex-ai-agent-builder-%e6%9e%84%e5%bb%ba%e4%bc%81%e4%b8%9a-ai-agent","status":"publish","type":"post","link":"https:\/\/flycloud.io\/en\/2026\/04\/28\/%e4%bd%bf%e7%94%a8-vertex-ai-agent-builder-%e6%9e%84%e5%bb%ba%e4%bc%81%e4%b8%9a-ai-agent\/","title":{"rendered":"\u4f7f\u7528 Vertex AI Agent Builder \u6784\u5efa\u4f01\u4e1a AI Agent"},"content":{"rendered":"<h2 class=\"wp-block-heading\" id=\"0\">1. \u51c6\u5907\u5de5\u4f5c<\/h2>\n\n\n\n<p>\u6b64\u81ea\u5b66\u578b Codelab \u5c06\u6307\u5bfc\u60a8\u4f7f\u7528 Google Cloud \u7684 Vertex AI Agent Builder \u6784\u5efa AI \u667a\u80fd\u4f53\u3002\u6bcf\u4e2a\u6b65\u9aa4\u90fd\u4f1a\u91cd\u70b9\u4ecb\u7ecd Agent Builder \u7684\u67d0\u9879\u7279\u5b9a\u529f\u80fd\uff0c\u5e76\u8bf4\u660e\u5176\u7528\u9014\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\"><strong>\u524d\u63d0\u6761\u4ef6<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bf9 <a href=\"https:\/\/cloud.google.com\/ai\/generative-ai?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Google Cloud \u4e0a\u7684\u751f\u6210\u5f0f AI<\/a> \u6709\u57fa\u672c\u7684\u4e86\u89e3<\/li>\n\n\n\n<li>\u5bf9 <a href=\"https:\/\/cloud.google.com\/dialogflow\/vertex\/docs\/concept\/agents?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">AI \u667a\u80fd\u4f53\u6982\u5ff5<\/a>\u6709\u57fa\u672c\u7684\u4e86\u89e3<\/li>\n\n\n\n<li>\u57fa\u672c\u4e86\u89e3 <a href=\"https:\/\/codeassist.google\/products\/business?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Gemini CodeAssist<\/a>\uff08\u53ef\u9009\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-youll-learn\"><strong>\u5b66\u4e60\u5185\u5bb9<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u4f55\u4f7f\u7528 Vertex AI Agent Builder \u521b\u5efa\u7b80\u5355\u7684 AI \u667a\u80fd\u4f53<\/li>\n\n\n\n<li>\u5982\u4f55\u901a\u8fc7\u9644\u52a0\u6570\u636e\u5b58\u50a8\u533a\u6765\u4e3a\u521b\u5efa\u7684\u667a\u80fd\u4f53\u63d0\u4f9b\u4f9d\u636e<\/li>\n\n\n\n<li>\u5982\u4f55\u5c06 AI \u667a\u80fd\u4f53\u96c6\u6210\u5230\u60a8\u7684\u7f51\u7ad9\u4e2d\uff08\u53ef\u9009\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-youll-need\"><strong>\u6240\u9700\u6761\u4ef6<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u597d\u5947\u5fc3<\/li>\n\n\n\n<li>\u4e00\u53f0\u53ef\u6b63\u5e38\u8fd0\u884c\u7684\u8ba1\u7b97\u673a\u548c\u7a33\u5b9a\u7684 Wi-Fi \u8fde\u63a5<\/li>\n\n\n\n<li>\u5df2\u5173\u8054\u7ed3\u7b97\u529f\u80fd\u7684 Google Cloud \u9879\u76ee\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u8fd8\u6ca1\u6709 Google Cloud \u9879\u76ee\uff0c\u53ef\u4ee5\u6309\u7167<a href=\"https:\/\/developers.google.cn\/workspace\/guides\/create-project?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u76f8\u5173\u8bf4\u660e<\/a>\u521b\u5efa\u4e00\u4e2a\u3002\u60a8\u8fd8\u53ef\u4ee5\u67e5\u770b <a href=\"http:\/\/cloud.google.com\/free?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Google Cloud \u514d\u8d39\u5c42\u7ea7\u670d\u52a1<\/a>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1\">2. \u8bbe\u8ba1\u60a8\u7684\u9996\u4e2a AI \u667a\u80fd\u4f53<\/h2>\n\n\n\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u81ea\u5df1\u7684 AI \u667a\u80fd\u4f53\u4e86\u3002\u4f46\u5728\u6df1\u5165\u5f00\u53d1\u4e4b\u524d\uff0c\u52a1\u5fc5\u8981\u5148\u4e3a\u4ee3\u7406\u8bbe\u5b9a\u660e\u786e\u7684\u613f\u666f\u3002\u4e0d\u59a8\u95ee\u95ee\u81ea\u5df1\u4ee5\u4e0b\u5173\u952e\u95ee\u9898\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5b83\u8981\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f<\/strong>\u5b83\u4f1a\u81ea\u52a8\u5316\u5904\u7406\u4efb\u52a1\u3001\u63d0\u4f9b\u4fe1\u606f\u3001\u63d0\u4f9b\u5a31\u4e50\u5185\u5bb9\uff0c\u8fd8\u662f\u4fc3\u8fdb\u521b\u610f\u63a2\u7d22\uff1f<\/li>\n\n\n\n<li><strong>\u5b83\u7684\u4e3b\u8981\u529f\u80fd\u662f\u4ec0\u4e48\uff1f<\/strong>\u5b83\u4f1a\u6267\u884c\u4efb\u52a1\u8fd8\u662f\u59d4\u6258\u4efb\u52a1\uff1f\u662f\u751f\u6210\u6587\u672c\uff0c\u8fd8\u662f\u751f\u6210\u4e0d\u540c\u5a92\u4f53\u7684\u7ec4\u5408\uff1f<\/li>\n\n\n\n<li><strong>\u6709\u4f55\u9650\u5236\uff1f<\/strong>\u5b83\u662f\u5426\u80fd\u591f\u5b8c\u5168\u81ea\u4e3b\u5730\u5b8c\u6210\u6240\u6709\u4efb\u52a1\uff1f<\/li>\n\n\n\n<li><strong>\u5b83\u5e94\u8be5\u5177\u6709\u4ec0\u4e48\u6027\u683c\u6216\u89d2\u8272\uff1f<\/strong>\u662f\u6b63\u5f0f\u3001\u975e\u6b63\u5f0f\u3001\u5e7d\u9ed8\u3001\u5b9e\u7528\u8fd8\u662f\u4fe1\u606f\u4e30\u5bcc\uff1f<\/li>\n\n\n\n<li><strong>\u6210\u6548\u6307\u6807\u662f\u4ec0\u4e48\uff1f<\/strong>\u60a8\u5c06\u5982\u4f55\u8861\u91cf\u4ee3\u7406\u7684\u6709\u6548\u6027\uff1f<\/li>\n<\/ul>\n\n\n\n<p>\u4e3a\u52a0\u5feb\u6d41\u7a0b\uff0c\u4ee5\u4e0b\u662f\u60a8\u4eca\u5929\u5c06\u521b\u5efa\u7684\u65c5\u884c\u793e\u7684\u8fd9\u4e9b\u95ee\u9898\u7684\u7b54\u6848\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5b83\u8981\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f<\/strong><\/li>\n\n\n\n<li>\u89c4\u5212\u884c\u7a0b\u53ef\u80fd\u65e2\u8017\u65f6\u53c8\u4ee4\u4eba\u4e0d\u77e5\u6240\u63aa\u3002\u6b64\u65c5\u884c\u667a\u80fd\u4f53\u5c06\u5e2e\u52a9\u7528\u6237\u53d1\u73b0\u76ee\u7684\u5730\u3001\u89c4\u5212\u884c\u7a0b\u3001\u9884\u8ba2\u822a\u73ed\u548c\u4f4f\u5bbf\u3002<\/li>\n\n\n\n<li><strong>\u5b83\u7684\u4e3b\u8981\u529f\u80fd\u662f\u4ec0\u4e48\uff1f<\/strong><\/li>\n\n\n\n<li>\u667a\u80fd\u4f53\u5e94\u80fd\u591f<\/li>\n\n\n\n<li>\u56de\u7b54\u6709\u5173\u76ee\u7684\u5730\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u7b7e\u8bc1\u8981\u6c42<\/li>\n\n\n\n<li>\u89c4\u5212\u9002\u5408\u7528\u6237\u65e5\u7a0b\u5b89\u6392\u548c\u76ee\u6807\u7684\u884c\u7a0b<\/li>\n\n\n\n<li>\u9884\u8ba2\u673a\u7968\u548c\u4f4f\u5bbf<\/li>\n\n\n\n<li><strong>\u6709\u4f55\u9650\u5236\uff1f<\/strong><\/li>\n\n\n\n<li>\u667a\u80fd\u4f53\u53ef\u80fd\u65e0\u6cd5\u56de\u7b54\u590d\u6742\u7684\u67e5\u8be2\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff09<\/li>\n\n\n\n<li>\u667a\u80fd\u4f53\u5c06\u65e0\u6cd5\u751f\u6210\u89c6\u89c9\u56fe\u50cf<\/li>\n\n\n\n<li>\u667a\u80fd\u4f53\u7684\u77e5\u8bc6\u5c06\u53d7\u9650\u4e8e\u5e95\u5c42\u6a21\u578b<\/li>\n\n\n\n<li><strong>\u5b83\u5e94\u8be5\u5177\u6709\u4ec0\u4e48\u6027\u683c\u6216\u89d2\u8272\uff1f<\/strong><\/li>\n\n\n\n<li>\u6b64\u667a\u80fd\u4f53\u5e94\u77e5\u8bc6\u6e0a\u535a\u3001\u4e50\u4e8e\u52a9\u4eba\u4e14\u5bf9\u65c5\u6e38\u5145\u6ee1\u70ed\u60c5\u3002\u5b83\u5e94\u8be5\u80fd\u591f\u6e05\u6670\u7b80\u6d01\u5730\u4f20\u8fbe\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u6210\u6548\u6307\u6807\u662f\u4ec0\u4e48\uff1f<\/strong><\/li>\n\n\n\n<li>\u6b64\u4ee3\u7406\u7684\u6210\u529f\u4e0e\u5426\u53ef\u6839\u636e\u7528\u6237\u5bf9\u5176\u5efa\u8bae\uff08\u63a2\u7d22\u3001\u89c4\u5212\u3001\u9884\u8ba2\uff09\u7684\u6ee1\u610f\u5ea6\u6765\u8861\u91cf<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2\">3. \u4f7f\u7528 Vertex AI Agent Builder \u6784\u5efa AI \u667a\u80fd\u4f53<\/h2>\n\n\n\n<p>\u501f\u52a9 Vertex AI Agent Builder\uff0c\u53ea\u9700\u51e0\u4e2a\u6b65\u9aa4\u5373\u53ef\u521b\u5efa AI \u667a\u80fd\u4f53\u3002<\/p>\n\n\n\n<p><strong>\u7b2c 1 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u524d\u5f80 <a href=\"https:\/\/console.cloud.google.com\/gen-app-builder\/engines?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Vertex AI Agent Builder<\/a>\u3002<\/li>\n\n\n\n<li>\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u6b22\u8fce\u9875\u9762\u3002<img decoding=\"async\" srcset=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_36.png?hl=zh-cn 36w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_48.png?hl=zh-cn 48w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_72.png?hl=zh-cn 72w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_96.png?hl=zh-cn 96w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_480.png?hl=zh-cn 480w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_720.png?hl=zh-cn 720w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_856.png?hl=zh-cn 856w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_960.png?hl=zh-cn 960w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_1440.png?hl=zh-cn 1440w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_1920.png?hl=zh-cn 1920w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba_2880.png?hl=zh-cn 2880w\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/833886ce0d2645ba.png?hl=zh-cn\" alt=\"833886ce0d2645ba.png\"><\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u7ee7\u7eed\u5e76\u6fc0\u6d3b API<\/strong> \u6309\u94ae\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c 2 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7cfb\u7edf\u4f1a\u5c06\u60a8\u91cd\u5b9a\u5411\u5230\u5e94\u7528\u521b\u5efa\u9875\u9762\u3002<img decoding=\"async\" srcset=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_36.png?hl=zh-cn 36w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_48.png?hl=zh-cn 48w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_72.png?hl=zh-cn 72w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_96.png?hl=zh-cn 96w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_480.png?hl=zh-cn 480w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_720.png?hl=zh-cn 720w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_856.png?hl=zh-cn 856w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_960.png?hl=zh-cn 960w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_1440.png?hl=zh-cn 1440w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_1920.png?hl=zh-cn 1920w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb_2880.png?hl=zh-cn 2880w\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f2d45cc76d62edeb.png?hl=zh-cn\" alt=\"f2d45cc76d62edeb.png\"><\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u521b\u5efa\u65b0\u5e94\u7528<\/strong>\u6309\u94ae\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c 3 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9009\u62e9<strong>\u5bf9\u8bdd\u5f0f\u4ee3\u7406<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u521b\u5efa<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/732d2cd9e10c9a79.png?hl=zh-cn\" alt=\"732d2cd9e10c9a79.png\"\/><\/figure>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u70b9\u51fb<strong>\u521b\u5efa<\/strong>\u540e\uff0c\u7cfb\u7edf\u4f1a\u6253\u5f00\u4e00\u4e2a\u65b0\u6807\u7b7e\u9875\uff0c\u5176\u4e2d\u663e\u793a <strong>Dialogflow \u5bf9\u8bdd\u667a\u80fd\u4f53<\/strong>\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u7cfb\u7edf\u8981\u6c42\u60a8<strong>\u9009\u62e9 Google Cloud \u9879\u76ee<\/strong>\uff0c\u8bf7\u9009\u62e9\u4e0e<strong>\u6b63\u786e\u7684 Gmail<\/strong> \u8d26\u53f7\u5173\u8054\u7684 Google Cloud \u9879\u76ee\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u60a8\u662f\u5728\u65b0\u8d26\u53f7\u4e2d\u5b8c\u6210\u672c\u5b9e\u9a8c\uff0c\u7cfb\u7edf\u4f1a\u8981\u6c42\u60a8\u542f\u7528 Dialogflow API\uff0c\u8bf7\u70b9\u51fb<strong>\u542f\u7528 API<\/strong> \u4ee5\u542f\u7528\u8be5 API\u3002<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/238281df06301db0.png?hl=zh-cn\" alt=\"238281df06301db0.png\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u70b9\u51fb\u8be5\u6309\u94ae\u4e0d\u8d77\u4f5c\u7528\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u524d\u5f80 <a href=\"https:\/\/console.cloud.google.com\/apis\/api\/dialogflow.googleapis.com?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">API \u9875\u9762 <\/a>\u624b\u52a8\u542f\u7528\u8be5 API\u3002<\/li>\n\n\n\n<li>\u5728\u65b0\u6253\u5f00\u7684 Dialogflow \u9875\u9762\u4e2d\uff0c\u70b9\u51fb<strong>\u521b\u5efa\u4ee3\u7406<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/42515e46bc63506d.png?hl=zh-cn\" alt=\"42515e46bc63506d.png\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u73b0\u5728\uff0c\u7cfb\u7edf\u4f1a\u63d0\u4f9b\u4e00\u4e9b<strong>\u7528\u4e8e\u521b\u5efa\u4ee3\u7406\u7684\u9009\u9879<\/strong>\uff0c\u8bf7\u9009\u62e9<strong>\u81ea\u884c\u6784\u5efa<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/8af6bf0853f20768.png?hl=zh-cn\" alt=\"8af6bf0853f20768.png\"\/><\/figure>\n\n\n\n<p><strong>\u7b2c 4 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9009\u62e9<strong>\u663e\u793a\u540d\u79f0<\/strong>\uff08\u4f8b\u5982\u201c\u65c5\u6e38\u52a9\u624b\u201d\uff09<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u201c\u4f4d\u7f6e\u201d\uff0c\u8bf7\u9009\u62e9 <strong>global (Global serving, data-at-rest in US)<\/strong> \u4f5c\u4e3a<strong>\u533a\u57df<\/strong><\/li>\n\n\n\n<li>\u4fdd\u7559\u5176\u4ed6\u914d\u7f6e\uff0c<strong>\u9ed8\u8ba4<\/strong><\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u521b\u5efa<\/strong>\u6309\u94ae<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/4e0dea29e5d8acde.png?hl=zh-cn\" alt=\"4e0dea29e5d8acde.png\"\/><\/figure>\n\n\n\n<p><strong>\u7b2c 5 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9009\u62e9 <strong>Playbook \u540d\u79f0<\/strong>\uff08\u4f8b\u5982\u201c\u4fe1\u606f\u4ee3\u7406\u201d\uff09<\/li>\n\n\n\n<li>\u6dfb\u52a0<strong>\u76ee\u6807<\/strong>\uff08\u4f8b\u5982\uff0c\u5e2e\u52a9\u5ba2\u6237\u89e3\u7b54\u4e0e\u65c5\u6e38\u76f8\u5173\u7684\u95ee\u9898\uff09<\/li>\n\n\n\n<li>\u5b9a\u4e49\u4e00\u4e2a <strong>Instruction<\/strong>\uff08\u4f8b\u5982 &#8211; \u95ee\u5019\u7528\u6237\uff0c\u7136\u540e\u8be2\u95ee\u4ed6\u4eec\u9700\u8981\u600e\u6837\u7684\u5e2e\u52a9\uff09<\/li>\n\n\n\n<li>\u4e00\u5207\u90fd\u786e\u5b9a\u540e\uff0c\u6309<strong>\u4fdd\u5b58<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/f8bfd605ddd97cf8.png?hl=zh-cn\" alt=\"f8bfd605ddd97cf8.png\"\/><\/figure>\n\n\n\n<p><strong>\u7b2c 6 \u6b65<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u70b9\u51fb<strong>\u5207\u6362\u6a21\u62df\u5668<\/strong>\u56fe\u6807 <img decoding=\"async\" srcset=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_36.png?hl=zh-cn 36w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_48.png?hl=zh-cn 48w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_72.png?hl=zh-cn 72w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_96.png?hl=zh-cn 96w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_480.png?hl=zh-cn 480w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_720.png?hl=zh-cn 720w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_856.png?hl=zh-cn 856w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_960.png?hl=zh-cn 960w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_1440.png?hl=zh-cn 1440w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_1920.png?hl=zh-cn 1920w,https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e_2880.png?hl=zh-cn 2880w\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/72588cbe8734f54e.png?hl=zh-cn\" alt=\"72588cbe8734f54e.png\"><\/li>\n\n\n\n<li>\u9009\u62e9\u60a8\u521a\u521a\u521b\u5efa\u7684\u4ee3\u7406\uff08\u4f8b\u5982 <em>Info Agent<\/em>\uff09<\/li>\n\n\n\n<li>\u4e3a\u667a\u80fd\u4f53\u9009\u62e9\u5e95\u5c42\u751f\u6210\u5f0f AI \u6a21\u578b\uff08\u4f8b\u5982 <em>gemini-1.5-flash<\/em>\uff09<\/li>\n\n\n\n<li>\u901a\u8fc7\u4e0e\u4ee3\u7406\u5bf9\u8bdd\u6765\u6d4b\u8bd5\u4ee3\u7406\uff08\u5373\u5728\u201cEnter User Input\u201d\u6587\u672c\u6846\u4e2d\u8f93\u5165\u5185\u5bb9\uff09<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/3ac3cf54a1e2098.png?hl=zh-cn\" alt=\"3ac3cf54a1e2098.png\"\/><\/figure>\n\n\n\n<p>\u606d\u559c\uff01\u60a8\u521a\u521a\u4f7f\u7528 Vertex AI Agent Builder \u6210\u529f\u521b\u5efa\u4e86\u4e00\u4e2a AI \u667a\u80fd\u4f53\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3\">4. \u5c06\u6570\u636e\u5b58\u50a8\u533a\u9644\u52a0\u5230\u4ee3\u7406<\/h2>\n\n\n\n<p>\u5c1d\u8bd5\u5411\u667a\u80fd\u4f53\u8be2\u95ee\u5982\u4f55\u524d\u5f80\u74e6\u574e\u8fbe\uff08\u4f8b\u5982\u201c\u524d\u5f80\u74e6\u574e\u8fbe\u7684\u6700\u4f73\u65b9\u5f0f\u662f\u4ec0\u4e48\uff1f\u201d\uff09\uff0c\u60a8\u4f1a\u6536\u5230\u5982\u4e0b\u56de\u7b54\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/5baa2dbabe2941a2.png?hl=zh-cn\" alt=\"5baa2dbabe2941a2.png\"\/><\/figure>\n\n\n\n<p>\u867d\u7136\u8fd9\u5728\u4e8b\u5b9e\u4e0a\u662f\u6b63\u786e\u7684\uff0c\u4f46\u5982\u679c\u4ee3\u7406\u4e0d\u662f\u7b80\u5355\u5730\u8bf4\u201c\u6211\u65e0\u6cd5\u63d0\u4f9b\u4fe1\u606f\u201d\u5e76\u7ed3\u675f\u5bf9\u8bdd\uff0c\u800c\u662f\u5efa\u8bae\u7c7b\u4f3c\u7684\u5730\u65b9\uff0c\u5bf9\u7528\u6237\u4f1a\u66f4\u6709\u5e2e\u52a9\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u80fd\u4f1a\u4fc3\u4f7f\u7528\u6237\u901a\u8fc7\u4ee3\u7406\u5b9e\u9645\u9884\u8ba2\u884c\u7a0b\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u8ba9\u667a\u80fd\u4f53\u63a8\u8350\u7c7b\u4f3c\u5730\u70b9\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6570\u636e\u5b58\u50a8\u533a\u5411\u667a\u80fd\u4f53\u63d0\u4f9b\u66f4\u591a\u4fe1\u606f\u3002\u5982\u679c\u667a\u80fd\u4f53\u65e0\u6cd5\u6839\u636e\u5176\u5185\u7f6e\u77e5\u8bc6\u56de\u7b54\u7528\u6237\u95ee\u9898\uff0c\u5219\u53ef\u5c06\u5176\u4f5c\u4e3a\u989d\u5916\u7684\u77e5\u8bc6\u5e93\u8fdb\u884c\u53c2\u8003\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u5982\u679c\u60a8\u60f3\u5173\u95ed\u6a21\u62df\u5668\uff0c\u8bf7\u518d\u6b21<strong>\u70b9\u51fb\u5207\u6362\u6a21\u62df\u5668\u56fe\u6807<\/strong><\/p>\n\n\n\n<p>\u521b\u5efa\u6570\u636e\u5b58\u50a8\u533a\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u70b9\u51fb\u201cAgent Basics\u201d\u9875\u9762\u5e95\u90e8\u7684 <strong>+ \u6570\u636e\u5b58\u50a8\u533a<\/strong>\u6309\u94ae\u5373\u53ef\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/6c3ef19fefc46af7.png?hl=zh-cn\" alt=\"6c3ef19fefc46af7.png\"\/><\/figure>\n\n\n\n<p>\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5de5\u5177\u540d\u79f0<\/strong>\uff1aAlternative Location<\/li>\n\n\n\n<li><strong>\u7c7b\u578b<\/strong>\uff1a\u6570\u636e\u5b58\u50a8\u533a<\/li>\n\n\n\n<li><strong>\u8bf4\u660e<\/strong>\uff1a\u5982\u679c\u7528\u6237\u8bf7\u6c42\u5305\u542b\u4e0d\u5b58\u5728\u7684\u4f4d\u7f6e\uff0c\u8bf7\u4f7f\u7528\u6b64\u5de5\u5177<\/li>\n<\/ul>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u8bf7\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/p>\n\n\n\n<p>\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5b58\u50a8\u533a\u5de5\u5177\uff0c\u4f9b\u4ee3\u7406\u4e0e\u6570\u636e\u5b58\u50a8\u533a\u901a\u4fe1\uff0c\u4f46\u60a8\u4ecd\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u4fe1\u606f\u7684\u5b9e\u9645\u6570\u636e\u5b58\u50a8\u533a\u3002\u4e3a\u6b64\uff0c\u8bf7\u70b9\u51fb<strong>\u6dfb\u52a0\u6570\u636e\u5b58\u50a8\u533a\u548c\u521b\u5efa\u6570\u636e\u5b58\u50a8\u533a<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/65c790a87de8fba8.png?hl=zh-cn\" alt=\"65c790a87de8fba8.png\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/7648d478a6f35cf0.png?hl=zh-cn\" alt=\"7648d478a6f35cf0.png\"\/><\/figure>\n\n\n\n<p>\u70b9\u51fb<strong>\u521b\u5efa\u65b0\u7684\u6570\u636e\u5b58\u50a8\u533a<\/strong>\u540e\uff0c\u60a8\u5c06\u88ab\u91cd\u5b9a\u5411\u5230 Vertex AI Agent Builder \u9875\u9762\uff0c\u5982\u4e0b\u6240\u793a<\/p>\n\n\n\n<p>\u9009\u62e9\u201c\u5728 Cloud Storage \u4e2d\u201d\u9009\u9879<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/bff5455fac531509.png?hl=zh-cn\" alt=\"bff5455fac531509.png\"\/><\/figure>\n\n\n\n<p>\u5b8c\u6210\u6b64\u6b65\u9aa4\u540e\uff0c<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u70b9\u51fb <strong>FILE<\/strong>\uff08\u8fd9\u4e00\u70b9<strong>\u975e\u5e38\u91cd\u8981<\/strong>\uff0c\u5426\u5219\u5bfc\u5165\u4f1a\u5931\u8d25\uff09<\/li>\n\n\n\n<li>\u952e\u5165 <strong>ai-workshops\/agents\/data\/wakanda.txt<\/strong><\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u7ee7\u7eed<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/d1983baa579eb78c.png?hl=zh-cn\" alt=\"d1983baa579eb78c.png\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u60a8\u597d\u5947\uff0c\u4ee5\u4e0b\u662f\u6240\u63d0\u4f9b\u6587\u672c\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/p>\n\n\n\n<p>\uec03<code>Places that are similar to Wakanda<\/code><\/p>\n\n\n\n<p><code>- Oribi Gorge in South Africa: The rock formations here are reminiscent of the Warrior Falls in Wakanda.<\/code><\/p>\n\n\n\n<p><code>- Iguazu Falls: Located on the border of Argentina and Brazil, these massive waterfalls were a major inspiration for the Warrior Falls.<\/code><\/p>\n\n\n\n<p><code>- Immerse yourself in Wakandan culture: Read the Black Panther comics, watch the movies, and explore online resources to learn more about Wakandan culture, language, and technology.<\/code><\/p>\n\n\n\n<p><code>- Visit a Disney theme park: While there isn't a dedicated Wakanda land yet, you might be able to meet Black Panther at Disneyland or on a Marvel Day at Sea Disney cruise.<\/code><\/p>\n\n\n\n<p>\uec02<\/p>\n\n\n\n<p>\u5728\u4e0b\u4e00\u9875\u4e0a\uff0c\u4e3a\u6570\u636e\u5b58\u50a8\u533a\u547d\u540d\uff08\u4f8b\u5982\u201cWakanda Alternative\u201d\uff09\uff0c\u7136\u540e\u70b9\u51fb<strong>\u521b\u5efa<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/93eb71e8d019ae24.png?hl=zh-cn\" alt=\"93eb71e8d019ae24.png\"\/><\/figure>\n\n\n\n<p>\u6700\u540e\u4e00\u6b65\u662f<strong>\u9009\u62e9<\/strong>\u60a8\u521a\u521a\u521b\u5efa\u7684\u6570\u636e\u6e90\uff0c\u7136\u540e\u70b9\u51fb<strong>\u521b\u5efa<\/strong>\u3002\u60a8\u53ef\u4ee5\u70b9\u51fb\u6570\u636e\u5b58\u50a8\u533a\u6765\u67e5\u770b\u6570\u636e\u5b58\u50a8\u533a\u5bfc\u5165\u8fdb\u5ea6\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/de1ac9256cc96f29.png?hl=zh-cn\" alt=\"de1ac9256cc96f29.png\"\/><\/figure>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u5bfc\u5165\u6d3b\u52a8\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u6210\u529f\u5b8c\u6210\uff0c\u5728\u6b64\u671f\u95f4\uff0c\u60a8\u53ef\u4ee5\u70b9\u51fb<a href=\"https:\/\/cloud.google.com\/generative-ai-app-builder\/docs\/create-datastore-ingest?hl=zh-cn#datastores-engines\" target=\"_blank\" rel=\"noreferrer noopener\">\u6b64\u5904<\/a>\u8be6\u7ec6\u4e86\u89e3\u53ef\u7528\u4e8e Vertex AI \u667a\u80fd\u4f53\u7684\u5176\u4ed6\u6570\u636e\u5b58\u50a8\u533a\u9009\u9879<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/9b5c4a2831728a6b.png?hl=zh-cn\" alt=\"9b5c4a2831728a6b.png\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c\u8bf7\u8fd4\u56de <strong>Dialogflow \u6807\u7b7e\u9875<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u5237\u65b0<\/strong>\u3002\u60a8\u5e94\u8be5\u4f1a\u5728<strong>\u53ef\u7528\u7684\u6570\u636e\u5b58\u50a8\u533a<\/strong>\u9875\u9762\u4e0b\u770b\u5230\u5df2\u521b\u5efa\u7684\u6570\u636e\u5b58\u50a8\u533a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/a44373b78bd95ff0.png?hl=zh-cn\" alt=\"a44373b78bd95ff0.png\"\/><\/figure>\n\n\n\n<p>\u4e3a\u4e86\u9632\u6b62\u4ee3\u7406\u51fa\u73b0\u5e7b\u89c9\uff0c\u8bf7\u5728\u6570\u636e\u5b58\u50a8\u533a\u7684\u63a5\u5730\u914d\u7f6e\u4e2d\u5c06\u8bbe\u7f6e\u8bbe\u4e3a <strong>Very Low<\/strong>\uff0c\u8fd9\u6837\u53ef\u4ee5\u5bf9\u4ee3\u7406\u7f16\u9020\u5185\u5bb9\u65bd\u52a0\u66f4\u4e25\u683c\u7684\u9650\u5236\u3002\u76ee\u524d\uff0c\u8bf7\u4fdd\u6301\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u4f46\u60a8\u53ef\u4ee5\u968f\u65f6\u63a2\u7d22\u4e0d\u540c\u7684\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/c1605bd076258050.png?hl=zh-cn\" alt=\"c1605bd076258050.png\"\/><\/figure>\n\n\n\n<p>\u73b0\u5728\uff0c\u9009\u62e9\u6dfb\u52a0\u7684\u6570\u636e\u5b58\u50a8\u533a\uff0c\u70b9\u51fb<strong>\u786e\u8ba4<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/40082aebe8b82d7c.png?hl=zh-cn\" alt=\"40082aebe8b82d7c.png\"\/><\/figure>\n\n\n\n<p>\u73b0\u5728\uff0c\u8fd4\u56de<a href=\"https:\/\/vertexaiconversation.cloud.google.com\/projects?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u4ee3\u7406\u57fa\u7840\u77e5\u8bc6<\/a>\u9875\u9762\uff0c\u5728\u5267\u672c\u914d\u7f6e\u7684\u5e95\u90e8\uff0c\u60a8\u4f1a\u770b\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5b58\u50a8\u533a\uff08\u4f8b\u5982\u201c\u5907\u9009\u4f4d\u7f6e\u201d\uff09\u53ef\u4f9b\u4f7f\u7528\uff0c\u9009\u4e2d\u8be5\u6570\u636e\u5b58\u50a8\u533a\uff08\u4f8b\u5982\u201c\u5907\u9009\u4f4d\u7f6e\u201d\uff09\uff0c\u7136\u540e\u70b9\u51fb\u9875\u9762\u9876\u90e8\u7684\u201c\u4fdd\u5b58\u201d\u6309\u94ae\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/1b6b82fd7f30a598.png?hl=zh-cn\" alt=\"1b6b82fd7f30a598.png\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/e09af18697b0fd7f.png?hl=zh-cn\" alt=\"e09af18697b0fd7f.png\"\/><\/figure>\n\n\n\n<p>\u5c31\u8981\u5927\u529f\u544a\u6210\u4e86\uff01\u6700\u540e\u4e00\u6b65\u662f\u5728\u667a\u80fd\u4f53\u7684\u6307\u4ee4\u4e2d\u6dfb\u52a0\u201c<strong>\u5907\u9009\u4f4d\u7f6e<\/strong>\u201d\u5de5\u5177\u3002\u6dfb\u52a0\u4e00\u884c\uff0c<strong>&#8211; \u5982\u679c\u7528\u6237\u7684\u8bf7\u6c42\u5305\u542b\u4e0d\u5b58\u5728\u7684\u5730\u7406\u4f4d\u7f6e\uff0c\u8bf7\u4f7f\u7528 ${TOOL: Alternative Location}<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/3134d9eadca34e21.png?hl=zh-cn\" alt=\"3134d9eadca34e21.png\"\/><\/figure>\n\n\n\n<p>\u4e00\u5207\u5c31\u7eea\u3002\u6211\u4eec\u518d\u6b21\u6253\u5f00\u5207\u6362\u6a21\u62df\u5668\uff0c\u5e76\u63d0\u51fa\u76f8\u540c\u7684\u95ee\u9898\uff08\u5373\u201c\u524d\u5f80\u74e6\u574e\u8fbe\u7684\u6700\u4f73\u65b9\u5f0f\u662f\u4ec0\u4e48\uff1f\u201d\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/6cdee598391fc82a.png?hl=zh-cn\" alt=\"6cdee598391fc82a.png\"\/><\/figure>\n\n\n\n<p>\u606d\u559c\uff01\u60a8\u7684\u4ee3\u7406\u73b0\u5728\u4f1a\u4f7f\u7528\u6587\u672c\u6587\u4ef6\u4e2d\u63d0\u4f9b\u7684\u4fe1\u606f\u6765\u63a8\u8350\u5730\u70b9\u3002<\/p>\n\n\n\n<p>\u8fd9\u6837\uff0c\u6211\u4eec\u5c31\u5b8c\u6210\u4e86\u6784\u5efa\u81ea\u5df1\u7684\u667a\u80fd\u4f53\u6784\u5efa\u5668 AI \u667a\u80fd\u4f53\u7684\u4efb\u52a1\u3002\u5982\u679c\u60a8\u60f3\u8fdb\u4e00\u6b65\u63a2\u7d22\u5982\u4f55\u81ea\u5b9a\u4e49\u667a\u80fd\u4f53\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u4f53\u9a8c\uff0c\u8bf7\u67e5\u770b\u4e0b\u9762\u7684\u201c\u5176\u4ed6\u6d3b\u52a8\u201d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4\">5. \u5176\u4ed6\u6d3b\u52a8 &#8211; \u4f7f AI \u667a\u80fd\u4f53\u4e0a\u7ebf<\/h2>\n\n\n\n<p>\u5728\u524d\u9762\u7684\u6b65\u9aa4\u4e2d\uff0c\u60a8\u5f00\u53d1\u4e86\u4e00\u4e2a AI \u667a\u80fd\u4f53\uff0c\u5e76\u4f7f\u7528\u76f8\u5173\u53c2\u8003\u6570\u636e\u4e3a\u5176\u63d0\u4f9b\u4f9d\u636e\u3002\u5728\u4e0b\u4e00\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u89e3\u51b3\u4e00\u4e2a\u5173\u952e\u95ee\u9898\uff1a\u5982\u4f55\u5c06\u6b64\u4ee3\u7406\u5d4c\u5165\u60a8\u7684\u7f51\u7ad9\u4e2d\uff0c\u4ee5\u4fbf\u4e0e\u8bbf\u95ee\u8005\u8fdb\u884c\u5b9e\u65f6\u4e92\u52a8\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u516c\u5f00\u4ee3\u7406\u3002\u60a8\u53ef\u4ee5\u5bfc\u51fa\u8be5\u89c6\u9891\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u53d1\u5e03\u3002\u60a8\u53ef\u4ee5\u6d4f\u89c8<a href=\"https:\/\/cloud.google.com\/dialogflow\/cx\/docs\/concept\/integration\/dialogflow-messenger?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u6587\u6863<\/a>\uff0c\u4e86\u89e3\u53ef\u80fd\u7684\u9009\u9879\u3002<\/p>\n\n\n\n<p>\u5728 Dialogflow \u6807\u7b7e\u9875\u7684\u53f3\u4e0a\u89d2\uff0c\u70b9\u51fb<strong>\u6ea2\u51fa\u83dc\u5355<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u53d1\u5e03\u4ee3\u7406<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/a1b109fa9d7cb51d.png?hl=zh-cn\" alt=\"a1b109fa9d7cb51d.png\"\/><\/figure>\n\n\n\n<p>\u5c06\u6240\u6709\u914d\u7f6e\u4fdd\u7559\u4e3a<strong>\u9ed8\u8ba4<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u542f\u7528\u672a\u7ecf\u8eab\u4efd\u9a8c\u8bc1\u7684 API<\/strong>\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u542f\u7528\u672a\u7ecf\u8eab\u4efd\u9a8c\u8bc1\u7684 API \u4ec5\u7528\u4e8e\u6f14\u793a\u76ee\u7684\uff0c\u4e0d\u5efa\u8bae\u5c06\u6b64\u914d\u7f6e\u7528\u4e8e\u751f\u4ea7\u5de5\u4f5c\u8d1f\u8f7d\u3002\u5982\u679c\u60a8\u6709\u5174\u8da3\u4e86\u89e3\u5982\u4f55\u5b89\u5168\u5730\u53d1\u5e03\u5185\u5bb9\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/cloud.google.com\/dialogflow\/cx\/docs\/concept\/integration\/dialogflow-messenger?hl=zh-cn#authenticated_setup\" target=\"_blank\" rel=\"noreferrer noopener\">\u6b64\u6587\u6863<\/a>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/ef0f24db780a185e.png?hl=zh-cn\" alt=\"ef0f24db780a185e.png\"\/><\/figure>\n\n\n\n<p>\u70b9\u51fb\u540e\uff0c\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u4e00\u5c0f\u6bb5 CSS \u4ee3\u7801\u6bb5\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/c40d12f6207bf5b4.png?hl=zh-cn\" alt=\"c40d12f6207bf5b4.png\"\/><\/figure>\n\n\n\n<p>\u53ea\u9700<strong>\u590d\u5236\u4ee3\u7801\u6bb5<\/strong>\u3002\u60a8\u7a0d\u540e\u4f1a\u5c06\u6b64\u4ee3\u7801\u6bb5\u96c6\u6210\u5230\u7f51\u7ad9\u4e2d\u3002<\/p>\n\n\n\n<p>\u60a8\u5c06\u4f7f\u7528 Cloud Editor \u73af\u5883\u6765\u521b\u5efa\u7f51\u7ad9\u3002\u4ee5\u4e0b\u662f\u6253\u5f00 Cloud \u7f16\u8f91\u5668\u7684\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728\u53e6\u4e00\u4e2a\u6807\u7b7e\u9875\u4e2d\u6253\u5f00 Google Cloud \u63a7\u5236\u53f0\u3002<\/li>\n\n\n\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u6fc0\u6d3b <strong>Cloud Shell<\/strong>\u201d\u6309\u94ae<\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u6253\u5f00\u7f16\u8f91\u5668<\/strong>\u6309\u94ae\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u5982\u679c\u7cfb\u7edf\u63d0\u793a\u60a8\u6388\u6743 Cloud Shell\uff0c\u8bf7\u70b9\u51fb<strong>\u6388\u6743<\/strong>\u7ee7\u7eed\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/d23192eca480f00c.png?hl=zh-cn\" alt=\"d23192eca480f00c.png\"\/><\/figure>\n\n\n\n<p>\u5728\u4e0b\u4e00\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528 <a href=\"https:\/\/blog.google\/technology\/developers\/gemini-code-assist-free\/?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Gemini Code Assist<\/a> \u521b\u5efa\u4e00\u4e2a\u793a\u4f8b Python Flask Web \u5e94\u7528\uff0c\u4ee5\u4e0e\u60a8\u7684\u4ee3\u7406\u4ee3\u7801\u6bb5\u96c6\u6210\u3002<\/p>\n\n\n\n<p>\u6253\u5f00 Cloud Shell \u7f16\u8f91\u5668\u540e\uff0c\u70b9\u51fb <strong>Gemini Code Assist<\/strong>\uff0c\u7136\u540e<strong>\u767b\u5f55\u60a8\u7684 Google Cloud<\/strong> \u9879\u76ee\u3002\u5982\u679c\u7cfb\u7edf\u8981\u6c42\u60a8\u542f\u7528\u8be5 API\uff0c\u8bf7\u70b9\u51fb<strong>\u542f\u7528<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/93112cce3e8d963b.png?hl=zh-cn\" alt=\"93112cce3e8d963b.png\"\/><\/figure>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u8ba9 Gemini Code Assist \u521b\u5efa\u4e00\u4e2a Flask \u5e94\u7528\uff0c\u5e76\u5c06 AI \u667a\u80fd\u4f53\u4ee3\u7801\u6bb5\u96c6\u6210\u5230\u5176\u4e2d\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u60a8\u53ef\u4ee5\u4f7f\u7528\u7684\u63d0\u793a\u793a\u4f8b<\/p>\n\n\n\n<p>\uec03<code>Here<\/code> <code>is<\/code> <code>my<\/code> <code>Travel<\/code> <code>buddy<\/code> <code>Vertex<\/code> <code>AI<\/code> <code>agent<\/code> <code>builder<\/code> <code>agent<\/code> <code>publish<\/code> <code>code<\/code> <code>snippet,<\/code><\/p>\n\n\n\n<p><code>&lt;REPLACE IT WITH YOUR AI AGENT PUBLISH CODE SNIPPET&gt;<\/code><\/p>\n\n\n\n<p><code>can<\/code> <code>you<\/code> <code>create<\/code> <code>a<\/code> <code>sample<\/code> <code>flask<\/code> <code>app<\/code> <code>to<\/code> <code>use<\/code> <code>it<\/code><\/p>\n\n\n\n<p><code>\uec02<\/code><\/p>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u8fd9\u91cc\u6211\u4eec\u8981\u6c42\u521b\u5efa\u4e00\u4e2a Python Flask \u5e94\u7528\u3002\u5982\u679c\u60a8\u504f\u597d\u4efb\u4f55\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u6216\u6846\u67b6\uff0c\u8bf7\u968f\u610f\u4f7f\u7528\u3002Gemini Code Assist \u80fd\u591f\u751f\u6210\u4e0d\u540c\u7f16\u7a0b\u8bed\u8a00\u7684\u4ee3\u7801\u3002\u5982\u9700\u4e86\u89e3\u8be6\u60c5\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/cloud.google.com\/gemini\/docs\/codeassist\/supported-languages?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u652f\u6301\u7684\u8bed\u8a00\u3001IDE \u548c\u63a5\u53e3<\/a>\u3002<\/p>\n\n\n\n<p>\u60a8\u4f1a\u770b\u5230\uff0c\u63d0\u4f9b\u7684\u4ee3\u7801\u6bb5\u5df2\u4e0e AI \u667a\u80fd\u4f53\u96c6\u6210\u3002\u5982\u9700\u6d4b\u8bd5\u6240\u63d0\u4f9b\u7684\u4ee3\u7801\u662f\u5426\u6709\u6548\u4e14\u53ef\u6309\u9884\u671f\u8fd0\u884c\uff0c\u60a8\u53ef\u4ee5\u6309\u7167 Gemini Code Assist \u63d0\u4f9b\u7684\u8bf4\u660e\u8fd0\u884c\u8f93\u51fa\u56de\u7b54\u4e2d\u7684\u76f8\u5e94\u4ee3\u7801\u90e8\u5206\u3002<\/p>\n\n\n\n<p>\u8f93\u51fa\u54cd\u5e94\u4ee3\u7801\u6bb5\u793a\u4f8b &#8211;<\/p>\n\n\n\n<p>\uec03<code>from<\/code> <code>flask<\/code> <code>import<\/code> <code>Flask,<\/code> <code>render_template_string<\/code><\/p>\n\n\n\n<p><code>app<\/code> <code>=<\/code> <code>Flask(__name__)<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>HTML<\/code> <code>template<\/code> <code>string<\/code> <code>with<\/code> <code>the<\/code> <code>provided<\/code> <code>Dialogflow<\/code> <code>Messenger<\/code> <code>code<\/code><\/p>\n\n\n\n<p><code>html_template<\/code> <code>=<\/code> <code>\"\"\"<\/code><\/p>\n\n\n\n<p><code>&lt;!DOCTYPE<\/code> <code>html&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;html<\/code> <code>lang=\"en\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;head&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;meta<\/code> <code>charset=\"UTF-8\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;meta<\/code> <code>name=\"viewport\"<\/code> <code>content=\"width=device-width,<\/code> <code>initial-scale=1.0\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;title&gt;Travel<\/code> <code>Buddy<\/code> <code>Chatbot&lt;\/title&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;link<\/code> <code>rel=\"stylesheet\"<\/code> <code>href=\"https:\/\/www.gstatic.com\/dialogflow-console\/fast\/df-messenger\/prod\/v1\/themes\/df-messenger-default.css\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;script<\/code> <code>src=\"https:\/\/www.gstatic.com\/dialogflow-console\/fast\/df-messenger\/prod\/v1\/df-messenger.js\"&gt;&lt;\/script&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;style&gt;<\/code><\/p>\n\n\n\n<p><code>df-messenger<\/code> <code>{<\/code><\/p>\n\n\n\n<p><code>z-index:<\/code> <code>999;<\/code><\/p>\n\n\n\n<p><code>position:<\/code> <code>fixed;<\/code><\/p>\n\n\n\n<p><code>--df-messenger-font-color:<\/code> <code>#000;<\/code><\/p>\n\n\n\n<p><code>--df-messenger-font-family:<\/code> <code>Google<\/code> <code>Sans;<\/code><\/p>\n\n\n\n<p><code>--df-messenger-chat-background:<\/code> <code>#f3f6fc;<\/code><\/p>\n\n\n\n<p><code>--df-messenger-message-user-background:<\/code> <code>#d3e3fd;<\/code><\/p>\n\n\n\n<p><code>--df-messenger-message-bot-background:<\/code> <code>#fff;<\/code><\/p>\n\n\n\n<p><code>bottom:<\/code> <code>16px;<\/code><\/p>\n\n\n\n<p><code>right:<\/code> <code>16px;<\/code><\/p>\n\n\n\n<p><code>}<\/code><\/p>\n\n\n\n<p><code>body<\/code> <code>{<\/code><\/p>\n\n\n\n<p><code>font-family:<\/code> <code>sans-serif;<\/code><\/p>\n\n\n\n<p><code>margin:<\/code> <code>20px;<\/code><\/p>\n\n\n\n<p><code>}<\/code><\/p>\n\n\n\n<p><code>&lt;\/style&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;\/head&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;body&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;h1&gt;Welcome<\/code> <code>to<\/code> <code>Travel<\/code> <code>Buddy!&lt;\/h1&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;p&gt;Start<\/code> <code>chatting<\/code> <code>with<\/code> <code>our<\/code> <code>AI<\/code> <code>Travel<\/code> <code>buddy,<\/code> <code>in<\/code> <code>the<\/code> <code>bottom<\/code> <code>right<\/code> <code>corner.&lt;\/p&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;df-messenger<\/code><\/p>\n\n\n\n<p><code>project-id=\"&lt;SAMPLE&gt;\"<\/code><\/p>\n\n\n\n<p><code>agent-id=\"&lt;SAMPLE&gt;\"<\/code><\/p>\n\n\n\n<p><code>language-code=\"en\"<\/code><\/p>\n\n\n\n<p><code>max-query-length=\"-1\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;df-messenger-chat-bubble<\/code><\/p>\n\n\n\n<p><code>chat-title=\"Travel<\/code> <code>Buddy\"&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;\/df-messenger-chat-bubble&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;\/df-messenger&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;\/body&gt;<\/code><\/p>\n\n\n\n<p><code>&lt;\/html&gt;<\/code><\/p>\n\n\n\n<p><code>\"\"\"<\/code><\/p>\n\n\n\n<p><code>@app.route(\"\/\")<\/code><\/p>\n\n\n\n<p><code>def<\/code> <code>index():<\/code><\/p>\n\n\n\n<p><code>\"\"\"Renders<\/code> <code>the<\/code> <code>HTML<\/code> <code>template<\/code> <code>with<\/code> <code>the<\/code> <code>Dialogflow<\/code> <code>Messenger.\"\"\"<\/code><\/p>\n\n\n\n<p><code>return<\/code> <code>render_template_string(html_template)<\/code><\/p>\n\n\n\n<p><code>if<\/code> <code>__name__<\/code> <code>==<\/code> <code>\"__main__\":<\/code><\/p>\n\n\n\n<p><code>app.run(debug=True)<\/code><\/p>\n\n\n\n<p><code>\uec02<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/3dd3246c5fceb1d4.png?hl=zh-cn\" alt=\"3dd3246c5fceb1d4.png\"\/><\/figure>\n\n\n\n<p>\u6839\u636e\u7ed9\u5b9a\u7684\u8bf4\u660e<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u590d\u5236\u63d0\u4f9b\u7684\u793a\u4f8b Flask \u5e94\u7528\u4ee3\u7801\u6bb5\uff0c<\/li>\n\n\n\n<li>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a <strong>app.py<\/strong> \u7684\u65b0\u6587\u4ef6\uff0c\u7136\u540e\u4fdd\u5b58\u8be5\u6587\u4ef6\u3002<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/4e58cfcf95f65d38.png?hl=zh-cn\" alt=\"4e58cfcf95f65d38.png\"\/><\/figure>\n\n\n\n<p>\u5728\u4e0b\u4e00\u6b65\u4e2d\uff0c\u7cfb\u7edf\u4f1a\u8981\u6c42\u5b89\u88c5 Flask \u4ee5\u8fd0\u884c\u6b64\u4ee3\u7801\u6bb5\uff0c\u4f46\u76ee\u524d\u4e0d\u9700\u8981\u8fd9\u6837\u505a\uff0c\u56e0\u4e3a Cloud Shell \u9ed8\u8ba4\u5df2\u5b89\u88c5\u6240\u6709\u5e38\u7528\u5b9e\u7528\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/b657b535710fd8f3.png?hl=zh-cn\" alt=\"b657b535710fd8f3.png\"\/><\/figure>\n\n\n\n<p>\u4fdd\u5b58\u6587\u4ef6\uff08Ctrl + S \u6216 CMD + S\uff09\uff0c\u7136\u540e\u70b9\u51fb<strong>\u6253\u5f00\u7ec8\u7aef<\/strong>\uff0c\u60a8\u5c06\u5728\u5176\u4e2d\u8fd0\u884c\u63d0\u4f9b\u7684\u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n\n\n\n<p>\uec03<code>python app.py<\/code><\/p>\n\n\n\n<p><code>\uec02<\/code><\/p>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u8bf7\u786e\u4fdd\u60a8\u4f4d\u4e8e\u6b63\u786e\u7684\u6587\u4ef6\u5939\u4e2d\uff0c\u5373\u5305\u542b <strong>app.py<\/strong> \u6587\u4ef6\u7684\u6587\u4ef6\u5939<\/p>\n\n\n\n<p>Python Flask \u5e94\u7528\u5c06\u5728\u7aef\u53e3 <strong>5000<\/strong> \u4e0a\u8fd0\u884c\u3002\u5982\u9700\u67e5\u770b\u6b64 Web \u5e94\u7528\u7684\u9884\u89c8\uff0c\u8bf7\u70b9\u51fb Cloud Shell \u4e2d\u7684<strong>\u7f51\u9875\u9884\u89c8<\/strong>\u56fe\u6807\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u70b9\u51fb<strong>\u66f4\u6539\u7aef\u53e3\uff0c\u8f93\u5165 5000<\/strong>\uff0c\u7136\u540e\u70b9\u51fb<strong>\u66f4\u6539\u5e76\u9884\u89c8<\/strong>\u4ee5\u4fdd\u5b58\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/59ed7b08133b82bf.png?hl=zh-cn\" alt=\"59ed7b08133b82bf.png\"\/><\/figure>\n\n\n\n<p>\u7cfb\u7edf\u4f1a\u663e\u793a\u4e00\u4e2a\u793a\u4f8b\u7f51\u7ad9\uff0c\u5e76\u4e14 AI \u667a\u80fd\u4f53\u5df2\u53ef\u4f9b\u4f7f\u7528\u3002\u53ea\u9700\u70b9\u51fb AI \u667a\u80fd\u4f53\uff0c\u5373\u53ef\u5f00\u59cb\u4e0e\u5176\u5bf9\u8bdd\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/devsite\/codelabs\/building-ai-agents-vertexai\/img\/35a4b5abdd299efe.png?hl=zh-cn\" alt=\"35a4b5abdd299efe.png\"\/><\/figure>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u968f\u610f\u4f7f\u7528\u4e0d\u540c\u7684\u63d0\u793a\u6765\u6d4b\u8bd5\u6b64\u529f\u80fd\u3002\u60a8\u8fd8\u53ef\u4ee5\u8ba9 Gemini Code Assist \u7f8e\u5316\u60a8\u7684\u7f51\u7ad9\uff0c\u6216\u5411 AI \u667a\u80fd\u4f53\u6dfb\u52a0\u66f4\u591a\u4f9d\u636e\u6570\u636e\uff0c\u4f7f\u5176\u66f4\u5177\u8d44\u6e90\u6027\u3002<\/p>\n\n\n\n<p>\u51c6\u5907\u5c31\u7eea\u540e\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u5728 Google Cloud \u4e0a\u6258\u7ba1\u6b64 AI \u4ee3\u7406\uff0c\u4ee5\u4fbf\u4efb\u4f55\u4eba\u968f\u65f6\u968f\u5730\u90fd\u80fd\u8bbf\u95ee\u5b83\u3002\u5728\u672c Codelab \u7684\u5269\u4f59\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u4ee5\u5bb9\u5668\u7684\u5f62\u5f0f\u5728 Cloud Run \u4e2d\u90e8\u7f72\u6b64\u793a\u4f8b Flask \u5e94\u7528\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u8fd9\u4e0d\u4ec5\u9650\u4e8e Cloud Run\uff08\u5982\u679c\u60a8\u4e0d\u77e5\u9053\u4ec0\u4e48\u662f Cloud Run\uff0c\u4e5f\u53ef\u4ee5\u63d0\u51fa\u6b64\u95ee\u9898\uff09\uff0c\u60a8\u8fd8\u53ef\u4ee5\u8ba9 Gemini \u4ee3\u7801\u8f85\u52a9\u5de5\u5177\u5e2e\u52a9\u60a8\u6309\u7167\u6700\u4f73\u5b9e\u8df5\u5728 Google Cloud \u6216\u4efb\u4f55\u5176\u4ed6\u4f4d\u7f6e\u90e8\u7f72\u6b64\u5e94\u7528\uff0c\u5b83\u4e5f\u53ef\u4ee5\u5728\u8fd9\u65b9\u9762\u4e3a\u60a8\u63d0\u4f9b\u5e2e\u52a9\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de <strong>Cloud Shell \u7ec8\u7aef<\/strong>\uff0c\u7136\u540e\u6309 <strong>Ctrl+C<\/strong> \u7ec8\u6b62\u8be5\u8fdb\u7a0b\u3002\u518d\u6b21\u70b9\u51fb<strong>\u6253\u5f00\u7f16\u8f91\u5668<\/strong>\uff0c\u7136\u540e\u8ba9 Gemini Code Assist \u5e2e\u52a9\u6211\u4eec\u5c06\u5e94\u7528\u5bb9\u5668\u5316\u5e76\u5c06\u5176\u90e8\u7f72\u5230 <strong>Cloud Run<\/strong> \u4e2d\u3002<\/p>\n\n\n\n<p>\uec03<code>Can<\/code> <code>you<\/code> <code>help<\/code> <code>me<\/code> <code>deploy<\/code> <code>this<\/code> <code>sample<\/code> <code>flask<\/code> <code>app<\/code> <code>to<\/code> <code>cloud<\/code> <code>run<\/code> <code>service<\/code><\/p>\n\n\n\n<p><code>\uec02<\/code><\/p>\n\n\n\n<p>\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u8bf4\u660e\u548c\u547d\u4ee4\uff0c\u53ef\u7528\u4e8e\u5728 Cloud Run \u670d\u52a1\u4e2d\u6258\u7ba1\u6211\u4eec\u7684\u5e94\u7528\uff0c\u8ba9\u6211\u4eec\u6309\u7167\u8bf4\u660e\u64cd\u4f5c<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u8f93\u51fa\u54cd\u5e94\u793a\u4f8b<\/p>\n\n\n\n<p><strong>\u90e8\u7f72\u5230 Cloud Run \u7684\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u524d\u63d0\u6761\u4ef6<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Google Cloud \u8d26\u53f7<\/strong>\uff1a\u60a8\u9700\u8981\u4e00\u4e2a\u5df2\u542f\u7528\u7ed3\u7b97\u529f\u80fd\u7684 Google Cloud \u8d26\u53f7\u3002<\/li>\n\n\n\n<li><strong>gcloud CLI<\/strong>\uff1a\u5728\u672c\u5730\u673a\u5668\u4e0a\u5b89\u88c5\u5e76\u521d\u59cb\u5316 Google Cloud SDK (gcloud CLI)\u3002\u60a8\u5c06\u4f7f\u7528\u6b64\u5de5\u5177\u4ece\u7ec8\u7aef\u4e0e Google Cloud \u8fdb\u884c\u4ea4\u4e92\u3002<\/li>\n\n\n\n<li><strong>Docker<\/strong>\uff1a\u5728\u672c\u5730\u673a\u5668\u4e0a\u5b89\u88c5 Docker\u3002Cloud Run \u4f7f\u7528 Docker \u5c06\u60a8\u7684\u5e94\u7528\u5bb9\u5668\u5316\u3002<\/li>\n\n\n\n<li><strong>\u9879\u76ee\u8bbe\u7f6e<\/strong>\uff1a\u786e\u4fdd\u60a8\u5df2\u5728 gcloud CLI \u4e2d\u9009\u62e9 Google Cloud \u9879\u76ee\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 <code>gcloud config list project<\/code> \u8fdb\u884c\u68c0\u67e5\uff0c\u5e76\u4f7f\u7528 <code>gcloud config set project YOUR_PROJECT_ID<\/code> \u8fdb\u884c\u8bbe\u7f6e<\/li>\n<\/ul>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u7531\u4e8e\u6211\u4eec\u5c06\u5728 Cloud Shell \u4e2d\u5b8c\u6210\u6574\u4e2a\u6d3b\u52a8\uff0c\u56e0\u6b64\u65e0\u9700\u8bbe\u7f6e\u9879\u76ee<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u521b\u5efa<\/strong> **<code>requirements.txt<\/code>\uff1a**<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6b64\u6587\u4ef6\u5217\u51fa\u4e86\u5e94\u7528\u6240\u9700\u7684\u6240\u6709 Python \u8f6f\u4ef6\u5305\u3002\u5728\u9879\u76ee\u76ee\u5f55\uff08<code>main.py<\/code> \u6240\u5728\u7684\u4f4d\u7f6e\uff09\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a <code>requirements.txt<\/code> \u7684\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u884c<\/li>\n<\/ul>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u521b\u5efa<\/strong> **<code>Dockerfile<\/code>\uff1a**<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Dockerfile<\/code> \u7528\u4e8e\u5b9a\u4e49\u5982\u4f55\u4e3a\u5e94\u7528\u6784\u5efa Docker \u6620\u50cf\u3002\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a <code>Dockerfile<\/code>\uff08\u65e0\u6269\u5c55\u540d\uff09\u7684\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n\n\n\n<p>\uec03<code>#<\/code> <code>Use<\/code> <code>an<\/code> <code>official<\/code> <code>Python<\/code> <code>runtime<\/code> <code>as<\/code> <code>a<\/code> <code>parent<\/code> <code>imageFROM<\/code> <code>python:3.9-slim-buster<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Set<\/code> <code>the<\/code> <code>working<\/code> <code>directory<\/code> <code>to<\/code> <code>\/appWORKDIR<\/code> <code>\/app<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Copy<\/code> <code>the<\/code> <code>current<\/code> <code>directory<\/code> <code>contents<\/code> <code>into<\/code> <code>the<\/code> <code>container<\/code> <code>at<\/code> <code>\/app<\/code><\/p>\n\n\n\n<p><code>COPY<\/code> <code>.<\/code> <code>\/app<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Install<\/code> <code>any<\/code> <code>needed<\/code> <code>packages<\/code> <code>specified<\/code> <code>in<\/code> <code>requirements.txt<\/code><\/p>\n\n\n\n<p><code>RUN<\/code> <code>pip<\/code> <code>install<\/code> <code>--no-cache-dir<\/code> <code>-r<\/code> <code>requirements.txt<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Make<\/code> <code>port<\/code> <code>5000<\/code> <code>available<\/code> <code>to<\/code> <code>the<\/code> <code>world<\/code> <code>outside<\/code> <code>this<\/code> <code>container<\/code><\/p>\n\n\n\n<p><code>EXPOSE<\/code> <code>5000<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Define<\/code> <code>environment<\/code> <code>variable<\/code><\/p>\n\n\n\n<p><code>ENV<\/code> <code>NAME<\/code> <code>World<\/code><\/p>\n\n\n\n<p><code>#<\/code> <code>Run<\/code> <code>app.py<\/code> <code>when<\/code> <code>the<\/code> <code>container<\/code> <code>launches<\/code><\/p>\n\n\n\n<p><code>CMD<\/code> <code>[\"python\",<\/code> <code>\".py\"]<\/code><\/p>\n\n\n\n<p>\uec02<\/p>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u6784\u5efa Docker \u6620\u50cf<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6253\u5f00\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u9879\u76ee\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n\n\n\n<p>gcloud builds submit \u2013tag gcr.io\/bgr-workshop-23rd\/travel-buddy<\/p>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li><strong>\u90e8\u7f72\u5230 Cloud Run<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6784\u5efa\u5e76\u4e0a\u4f20\u6620\u50cf\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u5176\u90e8\u7f72\u5230 Cloud Run\uff1a<\/li>\n<\/ul>\n\n\n\n<p>\uec03<code>gcloud<\/code> <code>run<\/code> <code>deploy<\/code> <code>travel-buddy<\/code> <code>--image<\/code> <code>gcr.io\/bgr-workshop-23rd\/travel-buddy<\/code> <code>--region<\/code> <code>us-central1<\/code><\/p>\n\n\n\n<p>\uec02<\/p>\n\n\n\n<p>\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u60a8\u5c06\u770b\u5230\u5df2\u96c6\u6210 AI \u667a\u80fd\u4f53\u7684\u5e94\u7528\u5df2\u9762\u5411\u6700\u7ec8\u7528\u6237\u53d1\u5e03\u3002<\/p>\n\n\n\n<p>\u606d\u559c\uff0c\u795d\u60a8\u5b66\u4e60\u6109\u5feb\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5\">6. \u6e05\u7406<\/h2>\n\n\n\n<p>\u4e3a\u907f\u514d\u7cfb\u7edf\u56e0\u672c Codelab \u4e2d\u4f7f\u7528\u7684\u8d44\u6e90\u5411\u60a8\u7684 Google Cloud \u8d26\u53f7\u6536\u53d6\u8d39\u7528\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728 Google Cloud \u63a7\u5236\u53f0\u4e2d\uff0c\u524d\u5f80<a href=\"https:\/\/console.cloud.google.com\/iam-admin\/projects?_ga=2.137741431.690084714.1674832835-1977883585.1670853686&amp;hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u7ba1\u7406\u8d44\u6e90<\/a>\u9875\u9762\u3002<\/li>\n\n\n\n<li>\u5728\u9879\u76ee\u5217\u8868\u4e2d\uff0c\u9009\u62e9\u8981\u5220\u9664\u7684\u9879\u76ee\uff0c\u7136\u540e\u70b9\u51fb<strong>\u5220\u9664<\/strong>\u3002<\/li>\n\n\n\n<li>\u5728\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165\u9879\u76ee ID\uff0c\u7136\u540e\u70b9\u51fb<strong>\u5173\u505c<\/strong>\u4ee5\u5220\u9664\u9879\u76ee\u3002<\/li>\n\n\n\n<li>\u6216\u8005\uff0c\u60a8\u4e5f\u53ef\u4ee5\u5728\u63a7\u5236\u53f0\u4e2d\u524d\u5f80 <a href=\"https:\/\/console.cloud.google.com\/run?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">Cloud Run<\/a>\uff0c\u9009\u62e9\u521a\u521a\u90e8\u7f72\u7684\u670d\u52a1\uff0c\u7136\u540e\u5c06\u5176\u5220\u9664\u3002<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>1. \u51c6\u5907\u5de5\u4f5c \u6b64\u81ea\u5b66\u578b Codelab \u5c06\u6307\u5bfc\u60a8\u4f7f\u7528 Google Cloud \u7684 Vertex AI Agent Builder \u6784\u5efa AI \u667a\u80fd\u4f53\u3002\u6bcf\u4e2a\u6b65\u9aa4\u90fd\u4f1a\u91cd\u70b9\u4ecb\u7ecd Agent Builder \u7684\u67d0\u9879\u7279\u5b9a\u529f\u80fd\uff0c\u5e76\u8bf4\u660e\u5176\u7528\u9014\u3002 \u524d\u63d0\u6761\u4ef6 \u5b66\u4e60\u5185\u5bb9 \u6240\u9700\u6761\u4ef6 \u6ce8\u610f\uff1a\u5982\u679c\u60a8\u8fd8\u6ca1\u6709 Google Cloud \u9879\u76ee\uff0c\u53ef\u4ee5\u6309\u7167\u76f8\u5173\u8bf4\u660e\u521b\u5efa\u4e00\u4e2a\u3002\u60a8\u8fd8\u53ef\u4ee5\u67e5\u770b Google Cloud \u514d\u8d39\u5c42\u7ea7\u670d\u52a1\u3002 &hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-ai","category-gcp"],"_links":{"self":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":1,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/375\/revisions\/376"}],"wp:attachment":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}