{"id":29064,"date":"2025-03-19T00:33:57","date_gmt":"2025-03-18T16:33:57","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=29064"},"modified":"2025-03-19T00:34:35","modified_gmt":"2025-03-18T16:34:35","slug":"pilottaigoujianqi","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/en\/pilottaigoujianqi\/","title":{"rendered":"PilottAI\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7\u591a\u667a\u80fd\u4f53\u5e94\u7528\u7684\u5f00\u6e90\u9879\u76ee"},"content":{"rendered":"<p>PilottAI \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u6846\u67b6\uff0c\u6258\u7ba1\u5728 GitHub \u4e0a\uff0c\u7531\u5f00\u53d1\u8005 anuj0456 \u521b\u5efa\u3002\u5b83\u4e13\u6ce8\u4e8e\u5e2e\u52a9\u7528\u6237\u6784\u5efa\u4f01\u4e1a\u7ea7\u7684\u591a\u667a\u80fd\u4f53\u7cfb\u7edf\uff0c\u652f\u6301\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u96c6\u6210\uff0c\u63d0\u4f9b\u4efb\u52a1\u7f16\u6392\u3001\u52a8\u6001\u6269\u5c55\u548c\u5bb9\u9519\u673a\u5236\u7b49\u529f\u80fd\u3002PilottAI \u7684\u76ee\u6807\u662f\u8ba9\u5f00\u53d1\u8005\u7528\u7b80\u5355\u4ee3\u7801\u6253\u9020\u53ef\u6269\u5c55\u7684 AI \u5e94\u7528\uff0c\u6bd4\u5982\u81ea\u52a8\u5904\u7406\u6587\u6863\u3001\u7ba1\u7406\u5ba2\u6237\u670d\u52a1\u6216\u5206\u6790\u6570\u636e\u3002\u5b83\u5b8c\u5168\u514d\u8d39\uff0c\u4ee3\u7801\u516c\u5f00\uff0c\u9002\u7528\u4e8e\u7a0b\u5e8f\u5458\u548c\u4f01\u4e1a\u7528\u6237\u3002\u5b98\u65b9\u6587\u6863\u8be6\u7ec6\uff0c\u6846\u67b6\u652f\u6301 Python 3.10+\uff0c\u4f7f\u7528 MIT \u8bb8\u53ef\u8bc1\u53d1\u5e03\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-29065\" title=\"PilottAI\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7\u591a\u667a\u80fd\u4f53\u5e94\u7528\u7684Python\u6846\u67b6-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/e6feee738b8f68e.png\" alt=\"PilottAI\uff1a\u6784\u5efa\u4f01\u4e1a\u7ea7\u591a\u667a\u80fd\u4f53\u5e94\u7528\u7684Python\u6846\u67b6-1\" width=\"796\" height=\"557\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/e6feee738b8f68e.png 796w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/e6feee738b8f68e-768x537.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/e6feee738b8f68e-18x12.png 18w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u5c42\u7ea7\u667a\u80fd\u4f53\u7cfb\u7edf<\/strong>\uff1a\u652f\u6301\u7ba1\u7406\u8005\u548c\u5de5\u4f5c\u8005\u667a\u80fd\u4f53\u5206\u5de5\uff0c\u4efb\u52a1\u667a\u80fd\u5206\u914d\u3002<\/li>\n<li><strong>\u5927\u8bed\u8a00\u6a21\u578b\u96c6\u6210<\/strong>\uff1a\u517c\u5bb9 OpenAI\u3001Anthropic\u3001Google \u7b49\u591a\u79cd LLM \u63d0\u4f9b\u5546\u3002<\/li>\n<li><strong>\u52a8\u6001\u6269\u5c55<\/strong>\uff1a\u6839\u636e\u4efb\u52a1\u91cf\u81ea\u52a8\u8c03\u6574\u667a\u80fd\u4f53\u6570\u91cf\u3002<\/li>\n<li><strong>\u5bb9\u9519\u673a\u5236<\/strong>\uff1a\u7cfb\u7edf\u51fa\u9519\u65f6\u81ea\u52a8\u6062\u590d\uff0c\u786e\u4fdd\u7a33\u5b9a\u8fd0\u884c\u3002<\/li>\n<li><strong>\u8d1f\u8f7d\u5747\u8861<\/strong>\uff1a\u5408\u7406\u5206\u914d\u4efb\u52a1\uff0c\u907f\u514d\u8fc7\u8f7d\u3002<\/li>\n<li><strong>\u4efb\u52a1\u7f16\u6392<\/strong>\uff1a\u652f\u6301\u591a\u6b65\u9aa4\u5de5\u4f5c\u6d41\uff0c\u5982\u63d0\u53d6\u3001\u5206\u6790\u548c\u603b\u7ed3\u3002<\/li>\n<li><strong>\u4e13\u7528\u667a\u80fd\u4f53<\/strong>\uff1a\u5185\u7f6e\u5ba2\u6237\u670d\u52a1\u3001\u6587\u6863\u5904\u7406\u3001\u90ae\u4ef6\u7ba1\u7406\u548c\u7814\u7a76\u5206\u6790\u7b49\u667a\u80fd\u4f53\u3002<\/li>\n<li><strong>\u9ad8\u7ea7\u8bb0\u5fc6\u7ba1\u7406<\/strong>\uff1a\u5b58\u50a8\u4efb\u52a1\u4e0a\u4e0b\u6587\uff0c\u652f\u6301\u8bed\u4e49\u68c0\u7d22\u3002<\/li>\n<li><strong>\u5de5\u5177\u652f\u6301<\/strong>\uff1a\u96c6\u6210\u6587\u6863\u5904\u7406\u3001WebSocket \u548c\u81ea\u5b9a\u4e49\u5de5\u5177\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<p>PilottAI \u9700\u8981 Python \u73af\u5883\u624d\u80fd\u8fd0\u884c\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li><strong>\u68c0\u67e5 Python \u7248\u672c<\/strong><br \/>\n\u786e\u4fdd\u5b89\u88c5\u4e86 Python 3.10 \u6216\u66f4\u9ad8\u7248\u672c\u3002\u5728\u7ec8\u7aef\u8f93\u5165\uff1a<\/li>\n<\/ol>\n<pre><code>python --version\r\n<\/code><\/pre>\n<p>\u5982\u679c\u7248\u672c\u4f4e\u4e8e 3.10\uff0c\u8bf7\u4ece\u00a0Python \u5b98\u7f51\u00a0\u4e0b\u8f7d\u5b89\u88c5\u3002<\/p>\n<ol start=\"2\">\n<li><strong>\u4e0b\u8f7d\u4ee3\u7801<\/strong><br \/>\n\u7528 Git \u514b\u9686 PilottAI \u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<pre><code>git clone https:\/\/github.com\/anuj0456\/pilottai.git\r\n<\/code><\/pre>\n<p>\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\uff1a<\/p>\n<pre><code>cd pilottai\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong><br \/>\n\u5728\u7ec8\u7aef\u8fd0\u884c\uff1a<\/li>\n<\/ol>\n<pre><code>pip install pilott\r\n<\/code><\/pre>\n<p>\u8fd9\u4f1a\u81ea\u52a8\u5b89\u88c5\u6240\u6709\u5fc5\u8981\u5e93\u3002\u5982\u679c\u9700\u8981\u624b\u52a8\u5b89\u88c5\uff0c\u6838\u5fc3\u4f9d\u8d56\u5305\u62ec\u00a0<code>asyncio<\/code>\u00a0\u548c LLM \u76f8\u5173\u5e93\uff0c\u5177\u4f53\u89c1\u5b98\u65b9\u6587\u6863\u3002<\/p>\n<ol start=\"4\">\n<li><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><br \/>\n\u8fd0\u884c\u6d4b\u8bd5\u4ee3\u7801\uff1a<\/li>\n<\/ol>\n<pre><code>python -m pilott.test\r\n<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u9519\u8bef\u4fe1\u606f\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<h3>\u5982\u4f55\u4f7f\u7528\u4e3b\u8981\u529f\u80fd<\/h3>\n<h4>1. \u914d\u7f6e\u5e76\u542f\u52a8\u7cfb\u7edf<\/h4>\n<p>PilottAI \u9700\u8981\u914d\u7f6e LLM \u548c\u667a\u80fd\u4f53\u624d\u80fd\u5de5\u4f5c\u3002\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code>from pilott import Pilott\r\nfrom pilott.core import AgentConfig, AgentRole, LLMConfig\r\n# \u914d\u7f6e LLM\r\nllm_config = LLMConfig(\r\nmodel_name=\"gpt-4\",\r\nprovider=\"openai\",\r\napi_key=\"your-api-key\"  # \u66ff\u6362\u4e3a\u4f60\u7684 API \u5bc6\u94a5\r\n)\r\n# \u914d\u7f6e\u667a\u80fd\u4f53\r\nconfig = AgentConfig(\r\nrole=\"processor\",\r\nrole_type=AgentRole.WORKER,\r\ngoal=\"\u9ad8\u6548\u5904\u7406\u6587\u6863\",\r\ndescription=\"\u6587\u6863\u5904\u7406\u5de5\u4f5c\u8005\",\r\nmax_queue_size=100\r\n)\r\nasync def main():\r\n# \u521d\u59cb\u5316\u7cfb\u7edf\r\npilott = Pilott(name=\"DocumentProcessor\")\r\nawait pilott.start()\r\n# \u6dfb\u52a0\u667a\u80fd\u4f53\r\nagent = await pilott.add_agent(\r\nagent_type=\"processor\",\r\nconfig=config,\r\nllm_config=llm_config\r\n)\r\n# \u505c\u6b62\u7cfb\u7edf\r\nawait pilott.stop()\r\nif __name__ == \"__main__\":\r\nimport asyncio\r\nasyncio.run(main())\r\n<\/code><\/pre>\n<ul>\n<li><strong>\u8bf4\u660e<\/strong>\uff1a\u66ff\u6362\u00a0<code>api_key<\/code>\u00a0\u4e3a\u4f60\u4ece OpenAI \u7b49\u5e73\u53f0\u83b7\u53d6\u7684\u5bc6\u94a5\u3002\u8fd0\u884c\u540e\uff0c\u7cfb\u7edf\u4f1a\u542f\u52a8\u4e00\u4e2a\u6587\u6863\u5904\u7406\u667a\u80fd\u4f53\u3002<\/li>\n<\/ul>\n<h4>2. \u5904\u7406 PDF \u6587\u6863<\/h4>\n<p>PilottAI \u7684\u6587\u6863\u5904\u7406\u529f\u80fd\u5f88\u5f3a\u5927\u3002\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u5c06 PDF \u6587\u4ef6\uff08\u5982\u00a0<code>report.pdf<\/code>\uff09\u653e\u5165\u9879\u76ee\u76ee\u5f55\u3002<\/li>\n<li>\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code>async def process_pdf():\r\nresult = await pilott.execute_task({\r\n\"type\": \"process_pdf\",\r\n\"file_path\": \"report.pdf\"\r\n})\r\nprint(\"\u5904\u7406\u7ed3\u679c:\", result)\r\n<\/code><\/pre>\n<\/li>\n<li>\u7cfb\u7edf\u4f1a\u63d0\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u8fd4\u56de\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<h4>3. \u521b\u5efa\u4e13\u7528\u667a\u80fd\u4f53<\/h4>\n<p>PilottAI \u63d0\u4f9b\u591a\u79cd\u9884\u8bbe\u667a\u80fd\u4f53\uff0c\u6bd4\u5982\u7814\u7a76\u5206\u6790\u667a\u80fd\u4f53\uff1a<\/p>\n<ul>\n<li>\u6dfb\u52a0\u667a\u80fd\u4f53\uff1a\n<pre><code>researcher = await pilott.add_agent(\r\nagent_type=\"researcher\",\r\nconfig=AgentConfig(\r\nrole=\"researcher\",\r\ngoal=\"\u5206\u6790\u6570\u636e\u5e76\u751f\u6210\u62a5\u544a\",\r\ndescription=\"\u7814\u7a76\u5206\u6790\u52a9\u624b\"\r\n),\r\nllm_config=llm_config\r\n)\r\n<\/code><\/pre>\n<\/li>\n<li>\u4f7f\u7528\u667a\u80fd\u4f53\u6267\u884c\u4efb\u52a1\uff1a\n<pre><code>result = await pilott.execute_task({\r\n\"type\": \"analyze_data\",\r\n\"data\": \"\u5e02\u573a\u9500\u552e\u6570\u636e\"\r\n})\r\nprint(\"\u5206\u6790\u7ed3\u679c:\", result)\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>4. \u914d\u7f6e\u8d1f\u8f7d\u5747\u8861\u548c\u5bb9\u9519<\/h4>\n<ul>\n<li><strong>\u8d1f\u8f7d\u5747\u8861<\/strong>\uff1a\u8bbe\u7f6e\u68c0\u67e5\u95f4\u9694\u548c\u8fc7\u8f7d\u9608\u503c\uff1a\n<pre><code>from pilott.core import LoadBalancerConfig\r\nconfig = LoadBalancerConfig(\r\ncheck_interval=30,  # \u6bcf30\u79d2\u68c0\u67e5\u4e00\u6b21\r\noverload_threshold=0.8  # 80%\u8d1f\u8f7d\u89c6\u4e3a\u8fc7\u8f7d\r\n)\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u5bb9\u9519\u673a\u5236<\/strong>\uff1a\u8bbe\u7f6e\u6062\u590d\u6b21\u6570\u548c\u5fc3\u8df3\u8d85\u65f6\uff1a\n<pre><code>from pilott.core import FaultToleranceConfig\r\nconfig = FaultToleranceConfig(\r\nrecovery_attempts=3,  # \u5c1d\u8bd5\u6062\u590d3\u6b21\r\nheartbeat_timeout=60  # 60\u79d2\u65e0\u54cd\u5e94\u89c6\u4e3a\u6545\u969c\r\n)\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li><strong>\u7f51\u7edc\u8981\u6c42<\/strong>\uff1a\u4f7f\u7528 LLM \u65f6\u9700\u8054\u7f51\uff0c\u786e\u4fdd API \u5bc6\u94a5\u6709\u6548\u3002<\/li>\n<li><strong>\u6587\u6863\u53c2\u8003<\/strong>\uff1a\u8be6\u7ec6\u914d\u7f6e\u89c1\u00a0<a href=\"https:\/\/pilottai.readthedocs.io\/\">\u5b98\u65b9\u6587\u6863<\/a>\u3002<\/li>\n<li><strong>\u8c03\u8bd5<\/strong>\uff1a\u51fa\u9519\u65f6\u68c0\u67e5\u7ec8\u7aef\u65e5\u5fd7\uff0c\u6216\u8bbf\u95ee GitHub \u63d0\u4ea4 issue\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u5e94\u7528\u573a\u666f<\/h2>\n<ol>\n<li><strong>\u4f01\u4e1a\u6587\u6863\u5904\u7406<\/strong><br \/>\n\u7528\u6587\u6863\u5904\u7406\u667a\u80fd\u4f53\u5206\u6790\u5408\u540c\u6216\u62a5\u544a\uff0c\u63d0\u53d6\u5173\u952e\u6761\u6b3e\uff0c\u63d0\u9ad8\u6548\u7387\u3002<\/li>\n<li><strong>\u5ba2\u6237\u652f\u6301\u81ea\u52a8\u5316<\/strong><br \/>\n\u5ba2\u6237\u670d\u52a1\u667a\u80fd\u4f53\u80fd\u5904\u7406\u54a8\u8be2\u3001\u751f\u6210\u56de\u590d\uff0c\u51cf\u8f7b\u4eba\u5de5\u8d1f\u62c5\u3002<\/li>\n<li><strong>\u7814\u7a76\u6570\u636e\u5206\u6790<\/strong><br \/>\n\u7814\u7a76\u5206\u6790\u667a\u80fd\u4f53\u53ef\u6574\u7406\u8d44\u6599\u3001\u5206\u6790\u8d8b\u52bf\uff0c\u9002\u5408\u5b66\u672f\u548c\u5546\u4e1a\u7814\u7a76\u3002<\/li>\n<li><strong>\u90ae\u4ef6\u7ba1\u7406<\/strong><br \/>\n\u90ae\u4ef6\u667a\u80fd\u4f53\u81ea\u52a8\u5206\u7c7b\u90ae\u4ef6\u3001\u751f\u6210\u6a21\u677f\uff0c\u4f18\u5316\u6c9f\u901a\u6d41\u7a0b\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>QA<\/h2>\n<ol>\n<li><strong>PilottAI \u652f\u6301\u54ea\u4e9b LLM\uff1f<\/strong><br \/>\n\u652f\u6301 OpenAI\u3001Anthropic\u3001Google \u7b49\u591a\u79cd\u63d0\u4f9b\u5546\uff0c\u5177\u4f53\u578b\u53f7\u89c1\u6587\u6863\u3002<\/li>\n<li><strong>\u9700\u8981\u4ed8\u8d39\u5417\uff1f<\/strong><br \/>\n\u6846\u67b6\u514d\u8d39\uff0c\u4f46\u4f7f\u7528 LLM \u670d\u52a1\u53ef\u80fd\u9700\u8981\u652f\u4ed8 API \u8d39\u7528\u3002<\/li>\n<li><strong>\u5982\u4f55\u81ea\u5b9a\u4e49\u667a\u80fd\u4f53\uff1f<\/strong><br \/>\n\u901a\u8fc7\u00a0<code>add_agent<\/code>\u00a0\u65b9\u6cd5\u8bbe\u7f6e\u89d2\u8272\u548c\u76ee\u6807\uff0c\u8be6\u89c1\u6587\u6863\u793a\u4f8b\u3002<\/li>\n<li><strong>\u8fd0\u884c\u51fa\u9519\u600e\u4e48\u529e\uff1f<\/strong><br \/>\n\u68c0\u67e5 Python \u7248\u672c\u3001\u4f9d\u8d56\u548c\u7f51\u7edc\u8fde\u63a5\uff0c\u6216\u53c2\u8003 GitHub \u95ee\u9898\u9875\u9762\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>PilottAI \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u6846\u67b6\uff0c\u6258\u7ba1\u5728 GitHub \u4e0a\uff0c\u7531\u5f00\u53d1\u8005 anuj0456 \u521b\u5efa\u3002\u5b83\u4e13\u6ce8\u4e8e\u5e2e\u52a9\u7528\u6237\u6784\u5efa\u4f01\u4e1a\u7ea7\u7684\u591a\u667a\u80fd\u4f53\u7cfb\u7edf\uff0c\u652f\u6301\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u96c6\u6210\uff0c\u63d0\u4f9b\u4efb\u52a1\u7f16\u6392\u3001\u52a8\u6001\u6269\u5c55\u548c\u5bb9\u9519\u673a\u5236\u7b49\u529f\u80fd\u3002PilottAI&#8230;<\/p>\n","protected":false},"author":1,"featured_media":62073,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230,201],"class_list":["post-29064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu","tag-aizhinengti"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/29064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/comments?post=29064"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/29064\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media\/62073"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media?parent=29064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/categories?post=29064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/tags?post=29064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}