PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

近日首个自研全开源自然语言低代码GPT应用快速开发框架PromptAppGPT迎来重要更新。

框架简介可以参考往期文章: 真低代码!首个基于ChatGPT的自然语言开发框架PromptAppGPT:全自动编译、运行、界面生成。

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

项目网站:https://promptappgpt.wangzhishi.net/

项目代码:https://github.com/mleoking/PromptAppGPT

PromptAppGPT框架更新后增加了对网页搜索、图片搜索、网页抓取、JavaScript代码执行等多个重要执行组件的内置支持。

新的执行组件的加入和本次其他机制优化使得PromptAppGPT具备了几十行低代码实现AutoGPT这种AI自动助手的能力。

更新后PromptAppGPT将AI全自动助手的开发和运行门槛都降到了最低: 人人都可以自然语言开发, 直接打开网址点击就可以运行,不用安装任何依赖组件。

本次更新增加的My AutoGPT程序就是基于PromptAppGPT开发AI全自动助手类APP的示例。

基于PromptAppGPT 的 My AutoGPT的代码

---
author: Leo
name: My AutoGPT
description: Use gpt   and executors to autonomously achieve whatever goal you set.
gptRound: multiple
failedRetries: 2
autoRun: true
 
sysTask:
  - executor: gpt
    prompt: |
      Constraints:
      1. If you are unsure how you previously   did something or want to recall past events, thinking about similar events   will help you remember.
      2. No user assistance
      3. Exclusively use the commands listed   in double quotes e.g. "command name"
 
      Commands:
      1. Webpage Search:   "doSearchWeb", args: "query":   "<keywords_to_search>"
      2. Image Search:   "doSearchImage", args: "query":   "<keywords_to_search>"
      3. Task Complete:   "doCompleteTask", args: "output":   "<task_output>"
 
      Resources:
      1. Internet access for searches and   information gathering.
      2. GPT-3.5 powered Agents for   delegation of simple tasks.
 
      Performance Evaluation:
      1. Continuously review and analyze your   actions to ensure you are performing to the best of your abilities.
      2. Constructively self-criticize your   big-picture behavior constantly.
      3. Reflect on past decisions and   strategies to refine your approach.
      4. Every command has a cost, so be   smart and efficient. Aim to complete tasks in the least number of steps.
 
      You should only respond in JSON format   as described below
      Response Format:
      {
          "thoughts": {
              "text":   "thought",
              "reasoning":   "reasoning",
              "plan": "- short   bulletedn- list that conveysn- long-term plan",
              "criticism":   "constructive self-criticism",
              "speak":   "thoughts summary to say to user"
          },
          "command": {
              "name": "command   name",
              "args": {
                  "arg name":   "value"
              }
          }
      }
 
userTask:
  - trigger: doSearchWeb
    executor: bingWeb
    prompt: |
      query: $e{"query":   "(.*)"}
      limit: 2
    outputer: $e{RawInput} doGptNext
  - trigger: doSearchImage
    executor: bingImage
    prompt: |
      query: $e{"query":   "(.*)"}
      limit: 2
    outputer: $e{RawInput} doGptNext
  - trigger: doGptNext
    executor: gpt
    prompt: Determine which next command to   use, and respond using the format specified above.
  - trigger: doCompleteTask
    executor: log
    prompt: |
       $i{Task   Complete:@textarea=$e{"output": "(.*)"}}
  - executor: gpt
    prompt: |
      $i{My Objectives:@textarea=Objectives:
      1. Recommend the best smartphone for   business professionals in 2023.
      2. Explain why the smartphone is   recommended and show the smartphone's image.}

代码中,sysTask部分描述了助手需要遵守的约束(Constraints), 可以运行的命令(Commands),可以使用的资源(Resources),性能评估方法(Performance Evaluation),输出内容和格式规范。

userTask部分配置了助手运行需要的5种任务各自的触发条件(trigger),执行器(executor)和执行输入(prompt)。

My AutoGPT运行过程

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

首先输入要助手完成的目标:

1. Recommend the best smartphone for business professionals in 2023.

  为商务人士推荐2023年最好的智能手机

2. Explain why the   smartphone is recommended and show the smartphone’s image.

  解释智能手机的推荐理由并展示手机图片

然后点击运行。这个时候程序就开始全自动目标拆解和完成的过程:

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

第一步,调用GPT作决策判断需要先进行网页搜索,找出2023年对于商务人士最好的智能手机列表。

第二步, 调用bingWeb搜索给出两个网页,并得出2023年商务人士最优智能手机候选: iPhone 14 Pro Max, Samsung Galaxy S22 Ultra, Google Pixel 7 Pro, Samsung Galaxy Z Fold 4, Oppo Find X5 Pro。

第三步,调用GPT作决策判断,下一步需要进一步搜索上面得到两个网页(TechRepublic vs TechRadar)观点的异同。

第四步,调用bingWeb获得了两篇报道观点异同信息。

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

第五步,调用GPT做决策判断,通过以上步骤输入,GPT判断出iPhone 14 Pro Max是2023年对商务人士最好的智能手机; 然后GPT决策下一步需要调用图像搜索来获得这个手机的图片。

第六步,调用bingImage搜索得出iPhone 14 Pro Max的两张图片。

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

第七步,调用GPT作决策判断,在两张图片中选择了第一张更好看的深蓝色的图片,并做出下一步决策是要完成任务(doCompleteTask)。

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

第八步,任务完成,结果推荐了iPhone 14 Pro Max手机,并给出了推荐理由和手机的图片链接。

我们看到基于PromptAppGPT的My AutoGPT应用已经展露出大语言模型对于目标进行自动拆解、决策、利用工具、和综合最终结果的能力。

更新后的PromptAppGPT带有更多的插件和机制,将能支持低代码开发更加智能的大语言模型应用。

作者介绍

张长旺,高级研究员,CCF理论计算机科学技术委员会委员。 曾担任第37届AAAI人工智能会议(AAAI-23)的高级程序委员会(SPC)成员。

PromptAppGPT重磅更新!AI助手0门槛开发+运行:几十行代码即可实现AutoGPT

他分别于2011年和2015年获得伦敦大学学院(UCL)的硕士和博士学位。2016年至2017年在阿里巴巴从事LBS数据挖掘,2018年至2022年在腾讯从事广告推荐和用户画像。

目前的研究方向是信息检索(搜推广)、自然语言处理、大数据挖掘的研究与应用。 

文章版权声明

 1 原创文章作者:1038,如若转载,请注明出处: https://www.52hwl.com/83026.html

 2 温馨提示:软件侵权请联系469472785#qq.com(三天内删除相关链接)资源失效请留言反馈

 3 下载提示:如遇蓝奏云无法访问,请修改lanzous(把s修改成x)

 免责声明:本站为个人博客,所有软件信息均来自网络 修改版软件,加群广告提示为修改者自留,非本站信息,注意鉴别

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023年7月17日 上午10:43
下一篇 2023年7月17日 上午10:44