逆天!Coze 可免费用 Twitter API,如何用批量工作流一次获取多人推文,月省 100 美元 | 回到Axton

人工智能 | ChatGPT & AIGC
7 Apr 202418:33

Summary

TLDRThe video introduces Coze, a platform enabling the creation of AI chatbots without coding, highlighting its ability to utilize GPT-4 and Twitter API for free. The creator, Axton, demonstrates Coze's features, including retrieving tweets from multiple authors and showcasing a workflow for batch获取推文. Despite some limitations and documentation gaps, Coze offers a promising tool for leveraging AI to enhance efficiency, with Axton inviting viewers to join his AI Elite Academy for further learning.

Takeaways

  • 🚀 Coze is a platform that enables users to build AI chatbots without coding, integrating advanced features like GPT-4 and Twitter API.
  • 💡 The standard practice to access Twitter API from outside the website now requires a $100/month subscription, but Coze offers some of its functionalities for free.
  • 🌐 To utilize GPT-4 models in Coze, users need to access the international version of Coze, which is in English.
  • 🤖 The video demonstrates creating an AI chatbot named Jerry, designed to search for tweets using AI Twitter Finder workflow and output in Chinese.
  • 🔍 Coze supports various Twitter-related plugins, including user information retrieval, tweet search, and trend analysis.
  • 📊 The video provides a walkthrough of Coze's features, including getting user profiles, searching for tweets based on keywords and authors, and accessing followers' lists.
  • 🔗 The AI Twitter Finder workflow allows batch retrieval of tweets from multiple authors, which can be embedded into AI chatbots for information aggregation.
  • ⚙️ Coze's workflow nodes include basic functions, coding, knowledge base, conditions, variables, and database interactions, offering a comprehensive toolkit for bot development.
  • 📈 The video highlights the limitation of Coze's documentation, particularly the lack of examples for batch processing and advanced configurations.
  • 📌 The presenter suggests that Coze's free access to premium services is beneficial but comes with usage limits, and it's not suitable for extensive data scraping.
  • 📚 The AI Elite Academy is mentioned as a resource for learning foundational AI skills and leveraging AI for efficiency and competitiveness.

Q & A

  • What is Coze and how does it relate to GPT-4 and Twitter API?

    -Coze is a platform that enables users to build AI chatbots without coding. It offers integration with GPT-4 and Twitter API, allowing users to utilize advanced AI capabilities and Twitter's functionalities, including those that require a paid subscription on Twitter's platform.

  • How does Coze facilitate the use of Twitter API features?

    -Coze provides a user-friendly interface with plugins that correspond to various Twitter API functionalities, enabling users to access and use Twitter's features without needing to write code. It also allows for free access to certain premium features of the Twitter API.

  • What are the limitations of Coze's Twitter API integration?

    -While Coze offers free access to some premium Twitter API features, there are usage limits. Users may reach a cap on the number of requests they can make, and certain functionalities may have limited access or be unavailable due to restrictions imposed by Twitter or Coze's platform policies.

  • How does the AI Twitter Finder workflow function in Coze?

    -The AI Twitter Finder workflow in Coze is designed to batch retrieve tweets from multiple Twitter accounts based on specific keywords. It can be embedded within an AI chatbot to help users search for and output tweets in their desired language, such as Chinese.

  • What are the plugins available for Twitter within Coze?

    -Coze supports several Twitter-related plugins including a generic X plugin for Twitter operations, a plugin for sending tweets, and a plugin for accessing Twitter API functionalities. Additionally, there's a plugin for fetching Twitter trends.

  • How can users test the functionality of a node in Coze's workflow?

    -Users can test individual nodes in Coze's workflow by clicking the 'play' button, which initiates a test run. This allows users to check if the node is configured correctly and to see the output without affecting the overall workflow.

  • What is the purpose of the 'variable' node in Coze's workflow?

    -The 'variable' node in Coze's workflow is used to retrieve the value of a defined variable from the AI chatbot. This enables the workflow to dynamically use information that has been set within the chatbot, such as a list of authors or a query string.

  • How can users ensure their Coze bot has access to the latest tweets from specific authors?

    -Users can create a workflow that utilizes the search_tweet module to fetch the latest tweets from a list of authors. By integrating this workflow into their AI chatbot, the bot can regularly update and provide information on recent tweets from the specified authors.

  • What additional resources are available for users interested in learning more about Coze and AI?

    -For users seeking to deepen their understanding of Coze and AI, there are resources such as the AI 精英学院 (AI Elite Academy), which offers high-value content and courses focused on AI fundamentals and Prompt Engineering. Users can also refer to Coze's documentation and workflow examples for practical guidance.

  • What was the outcome of the test run for the 'get twitter thread' functionality?

    -The 'get twitter thread' functionality successfully retrieved a summary of tweets from a specified thread ID. Although there were initial issues with stability, retrying the operation yielded the correct information, demonstrating the feature's effectiveness.

  • What is the significance of the 'AI 精英学院' mentioned in the script?

    -The 'AI 精英学院' (AI Elite Academy) is a resource center where users can learn to harness AI for efficiency and competitiveness. It offers courses like AI and Automation Integration and Prompt Engineering, aiming to equip users with foundational skills to tackle current and future challenges using AI.

Outlines

00:00

🤖 Introduction to Coze and Twitter API Integration

This paragraph introduces the Coze platform, which allows users to build AI chatbots without coding and leverages the Twitter API for free, despite its usual cost. The speaker has previously explained Coze's features and how to use the GPT-4 Turbo model. The focus is on demonstrating a workflow that can batch retrieve tweets from multiple authors, such as the speaker's and Elon Musk's, and embedding this into an AI chatbot. The video also covers the limitations of Coze and encourages viewers to explore the link in the description for more information.

05:00

🔍 Exploring Coze's Twitter API Features and Workflow

The speaker delves into the various Twitter API plugins supported by Coze, including getting user information, searching tweets, and creating tweets. The paragraph demonstrates how to use these features effectively, such as retrieving a user's profile, searching for tweets by keyword and author, and handling errors like the 403 permission issue encountered. The speaker also discusses the stability of the platform and its potential uses, such as creating daily reports or sharing information within groups.

10:01

📈 Batch Processing Tweets and WorkFlow Demonstration

This section focuses on the batch processing of tweets using Coze's workflow feature. The speaker explains how to set up a workflow to retrieve the latest tweets from multiple authors of interest, summarizing content related to AI. The paragraph details the process of defining variables, using nodes for different functions within Coze, and testing the workflow. It highlights the importance of understanding the configuration for batch processing, which will be elaborated in a future document shared by the speaker.

15:04

🚀 Conclusion and Invitation to AI Elite Academy

The speaker concludes by testing the workflow and demonstrating the retrieval of tweets from the speaker, Elon Musk, and Andrew. Despite some limitations in the number of tweets retrieved, the workflow successfully outputs the desired information. The speaker emphasizes Coze's ability to offer free access to paid services with usage limits and the need for improved documentation. The paragraph ends with an invitation to join the AI Elite Academy for advanced knowledge on utilizing AI for efficiency and competitiveness, and prompts the viewer to visit axtonliu.ai for valuable content and courses.

Mindmap

Keywords

💡Axton

Axton is the host of the video and the person who introduces the platform Coze and its features. Axton demonstrates how to use Coze to access Twitter API functionalities without coding and highlights the benefits of using the platform for AI chatbot creation.

💡Coze

Coze is a platform that allows users to build AI chatbots without coding. It provides access to advanced features such as GPT-4 and Twitter API, which would otherwise require payment. Coze is used to create workflows for tasks like batch retrieval of tweets from multiple authors.

💡GPT-4

GPT-4 is an advanced language model used by Coze to power AI chatbots. It is a part of the platform's capabilities that allow for complex interactions and information retrieval, such as searching for tweets and obtaining user profiles from Twitter.

💡Twitter API

Twitter API is a set of tools that allows developers to access Twitter's data, such as tweets, user profiles, and trends. In the video, Axton demonstrates how Coze can be used to access these features, which have become premium and require a subscription on Twitter's official platform.

💡AI chatbot

An AI chatbot is an artificial intelligence application that can converse with humans in a human-like manner. In the context of the video, Axton uses Coze to create an AI chatbot named Jerry, which is designed to assist with tasks such as searching for tweets based on keywords and outputting the results in Chinese.

💡Workflow

A workflow in the context of Coze is a series of connected steps or tasks that are automated to perform a complex operation. The video demonstrates creating a workflow to batch retrieve tweets from multiple Twitter authors, which is then embedded into the AI chatbot for use.

💡Elon Musk

Elon Musk is a prominent entrepreneur and CEO of companies like Tesla and SpaceX. In the video, his Twitter account is used as an example when Axton demonstrates how to retrieve tweets using Coze's platform.

💡AI Twitter Finder

AI Twitter Finder is a workflow within Coze that is designed to search and retrieve tweets based on specific criteria such as keywords, author, and the number of tweets to return. It is part of the functionalities that Axton showcases in the video.

💡Plugin

In the context of Coze, a plugin is a module or tool that adds specific functionalities to the platform. The video mentions several Twitter-related plugins that can be added to a bot to enable features like searching tweets, getting user information, and more.

💡Variable

Variables in Coze are used to store and manipulate data within a chatbot or a workflow. They can be defined, modified, and used to interact with different nodes in a workflow, allowing for dynamic and customizable operations.

💡AI精英学院

AI精英学院 (AI Elite Academy) is mentioned as a resource where Axton provides high-value content and courses on AI and automation. It is a place for learning and enhancing one's skills in using AI to improve efficiency and competitiveness.

Highlights

Coze is a platform that allows users to build AI chatbots without coding, leveraging advanced models like GPT-4 Turbo.

Twitter API's access has become subscription-based, costing $100 per month after the acquisition by Elon Musk.

Coze offers free access to some of the Twitter API functionalities, which would otherwise require a paid subscription.

The video demonstrates a workflow for batch retrieval of tweets from multiple Twitter authors, such as Axton and Elon Musk.

Coze's platform supports various Twitter-related plugins, including user information retrieval, tweet search, and trend analysis.

The AI Twitter Finder workflow can be embedded into AI bots to help find tweets based on keywords and output them in Chinese.

The video provides a detailed walkthrough of using Coze's Twitter plugins, including getting user profiles and searching for tweets.

Axton Liu's Twitter account was used as a test case to demonstrate the functionality of retrieving user information and tweets.

The video showcases the process of creating a workflow in Coze, which can be used to batch retrieve tweets and summarize AI-related content.

Coze's work with Twitter API has limitations, such as rate limits on usage, which were encountered during the video's preparation.

The video emphasizes the importance of understanding Coze's documentation and best practices for effective use of the platform.

Axton Liu invites viewers to join his AI Elite Academy for comprehensive lessons on AI and automation, prompting that prices will increase soon.

The video concludes with a call to action, encouraging viewers to visit axtonliu.ai for valuable free content and AI courses.

The AI chatbot named Jerry is introduced, designed to assist users by utilizing the AI Twitter Finder workflow.

A workflow is demonstrated to show how to retrieve and output tweets from specified authors in a structured manner.

The video highlights the stability issues encountered when using Coze's Twitter API plugins and the need for further testing.

The potential of using Coze's platform for creating daily reports or sharing information within groups is discussed.

The video provides insights into the configuration of Coze's nodes and workflow for batch processing of Twitter data.

Transcripts

00:00

嘿,你好,欢迎回到 Axton

00:02

没想到,Coze 不但可以免费的用到 GPT-4

00:05

居然还能耗到马斯克的羊毛

00:07

可以免费的使用比 GPT-4还要贵的 Twitter API

00:11

Coze 是一个可以不用代码来搭建 AI 聊天机器人的平台

00:15

我在这期视频当中已经详细的讲解了 Coze 的各种功能

00:19

以及如何用到 GPT-4 Turbo 的模型

00:23

感兴趣的朋友可以回看一下

00:25

链接我放在描述栏当中

00:27

自从 Twitter 被马斯克买了之后

00:29

如果你想从 Twitter 网站的外面来获取推文信息

00:33

也就是用 Twitter API

00:34

就需要每个月充值100美元了

00:37

但是 Coze 却很大方的

00:39

让你可以免费的用部分 Twitter API 的功能了

00:42

今天我就先给大家演示一个

00:45

可以批量获取多个 Twitter 作者的推文的工作流

00:49

把这个工作流嵌入到你的 AI Bot

00:52

AI 聊天机器人里面

00:54

比如我这里加了两个 Twitter 账号

00:56

我的和马斯克的

00:58

这样就可以一次性的获取到我们两个人的推文了

01:02

01:03

今天我首先给大家演示一下

01:05

在 Coze 上可以用到的 Twitter API 的功能

01:08

然后再演示一下批量获取推文的工作流

01:11

最后我们再聊一聊 Coze 的局限性

01:14

如果你喜欢这类视频

01:15

请点赞收藏方便以后回看

01:18

01:18

咱们开始

01:19

01:20

这就是 Coze 的网站

01:21

如果我们想用到 GPT-4的模型

01:23

我们就需要用 Coze 的海外版

01:25

也就是 Coze.com

01:26

是英文版

01:27

今天我们就用英文版来做演示

01:30

01:31

这就是我创建的一个测试

01:32

X 的 AI 聊天机器人 Bot

01:35

X 也就是以前的 Twitter

01:37

给聊天机器人的 prompt 很简单

01:40

你是我的小助手

01:41

你的名字叫做 Jerry

01:42

你会使用 AI Twitter Finder 工作流

01:45

帮助我寻找关键词的推文

01:49

并且输出中文

01:50

这里面用到的 AI Twitter Finder

01:52

就是我待会给大家介绍的

01:54

我们可以批量的去获取到一批

01:57

Twitter 作者的推文的工作流

02:00

咱们后面再看

02:01

我们先来看一下

02:02

可以操作 Twitter 的这些 plugin 插件

02:05

这边我已经把 Coze 当中

02:07

所支持 Twitter 的这些插件

02:09

三个插件全部列在这边了

02:12

添加插件只需要点击加号就可以了

02:15

然后我们就可以在这边进行搜索

02:17

X 就是跟 Twitter 相关的

02:20

这就包括一个 X 插件

02:21

然后发送 Twitter 的插件

02:23

还有后面有一个 Twitter API 的插件

02:26

当然为了不漏掉

02:27

我们可以再使用 Twitter 来进行

02:29

再一次的搜索

02:31

这4个就是目前关于 Twitter 的这些插件

02:34

这里面有三个我都添加到我的 Bot 里面来了

02:37

Twitter 的 trends

02:38

Twitter 趋势我还没有加

02:39

我们可以把它也添加进来

02:41

02:42

这就是这4个插件

02:43

这边就是他所支持的

02:45

Twitter 相关的功能

02:46

我们现在就来给大家演示一遍

02:49

看看他到底能达到什么样的效果

02:51

02:52

首先第一个 get users

02:54

获得指定用户的信息

02:56

实际上也就是获得一个用户的 profile

02:59

这边给的参数可以用 user id

03:02

也可以用 user 的 user name

03:05

03:05

我们就来试一下

03:07

比如让他来获得我的推文的信息

03:10

这边给的提示为了避免他混淆

03:13

因为毕竟我们有这么多的内容

03:15

我就明确指定了这个方法的名称

03:18

然后告诉他获取 axtonliu

03:20

也就是我的推特号的信息

03:22

03:22

这边我们就可以看到他很快速的得到了我的一些信息

03:25

我的名字

03:26

id

03:27

粉丝人数

03:27

关注的人数等等

03:29

包括我的头像链接

03:31

还有我的描述

03:33

简介

03:34

03:34

然后我们可以看一下

03:35

接下来 search 一个推文

03:38

那么他有三个参数

03:40

分别是 count

03:41

就是你要返回多少个推文

03:44

然后查询字符串

03:45

这个是一个必须要的参数

03:47

就是你要查询的关键词是什么

03:49

author 就是作者

03:51

也就是推文的推主

03:53

你要查谁的推文信息

03:55

请使用 searchTweet 查找 axtonliu 的与 AI 相关的推文

03:59

最多返回10条

04:01

我们看看他能不能正确的调用

04:03

失去 AI 让我们恐慌

04:05

而这才是最令人恐惧的事情

04:07

没错

04:07

这些都是我的推文

04:09

链接也是正确的

04:11

04:12

很遗憾后面这个没有给出链接

04:13

但是效果已经很不错了

04:15

04:16

我们再看 user

04:17

followers

04:18

同样参数只需要一个用户名就行了

04:20

我们同样来查我的 followers

04:23

04:23

出错

04:24

因为某些未知的原因

04:25

我无法完成这个操作

04:27

04:28

我们可以在这里面看他的运行过程

04:30

来判断一下他的问题出在哪

04:32

点击

04:33

这样就是他的整个执行过程

04:35

那发送的信息呢

04:36

给了一个 username

04:37

这个没有什么问题

04:39

response 就是他的返回结果

04:41

04:41

这边返回的错误

04:43

403

04:44

权限的问题

04:46

您的账户已被暂停

04:47

不允许访问此功能

04:48

这不会是扣子的账户被暂停了吧

04:52

04:53

那这一步我们就先放过

04:54

我们把后面两个重点的功能来先测试一下

04:58

那创建推文呢

04:59

这个就不用演示了

05:00

因为这本身就是一个免费给大家提供的功能

05:02

不会存在什么问题

05:04

就算有问题

05:05

我们可以通过其他各种办法来用它

05:07

包括使用 Make 工作流

05:08

那这边获取它的趋势

05:10

我们可以待会来试一下

05:12

还有获取一个推文线程

05:14

以及获取一个用户的推文

05:16

这两个相对来说应该是更有用的一些内容

05:20

而这边的查询呢

05:21

它这边只支持一个查询条件

05:24

就是关键词

05:25

那相对于这个查询呢

05:27

它的功能要弱一些

05:29

因为它条件少

05:30

05:31

我们就先把这两个来试一下

05:33

那首先这个获取用户的推文呢

05:35

就是根据用户 ID 来获取推文的

05:38

那实际上 get user tweets 这个功能

05:40

加上 search 的这个功能

05:42

就可以完成 search tweet 的功能

05:45

也就是说这个功能和它这两个是等价

05:48

我们可以先暂时不看它们两个

05:50

我们先看一下 get twitter thread 的这个功能

05:53

获取一个推特线程

05:55

获取一个推文线程呢

05:56

它的参数是要 ID

05:57

这个 ID 哪来的呢

05:59

我们就看我的推文吧

06:01

就第一个自动抓取 RSS 文章的这个推文

06:05

一个推文线程它的 ID 呢

06:07

实际上就是在它的 URL 里面

06:10

我们可以直接 copy link

06:12

然后我们再到这边

06:15

link 当中的这串数字呢

06:17

就是你的推文的 ID

06:18

06:19

请使用 get twitter thread 获取 ID 为这个的推文

06:23

没有找到

06:25

我们可以让它再试一次

06:26

OK

06:27

这下就正常了

06:28

所以说还是不够稳定

06:30

没错

06:30

整个线程总结的内容是正确的

06:34

很好

06:35

这个功能也是一个比较有用的功能

06:37

相当于你可以获取一个

06:39

推主它整个推文串的主要内容

06:42

那这个功能呢

06:42

就可以帮助大家去创建一个你自己的 AI 机器人

06:47

从推特上面去抓取一些你所关心的信息

06:50

你可以把这个信息做成你的日报

06:53

或者分享到你的群里面都是有用的

06:55

06:56

接下来我们就再看一下它的获取推特趋势的功能

06:59

那它的参数呢

07:00

需要一个国家

07:02

比如美国

07:03

那我们待会就用美国吧

07:04

07:05

又一次出错

07:05

那么同样这种情况下

07:07

我们就再让它来一次就行了

07:09

OK

07:09

给出了一些当前美国的推特的趋势

07:12

那其他的功能呢

07:13

因为都大同小异

07:14

我们就不用一个一个的去演示了

07:17

但是这两个就是查看你的粉丝和你粉了谁

07:21

这两个功能呢

07:22

我们在视频最后再来试一遍

07:25

我们首先把我们的工作流先给演示完成

07:28

以防止真的他这个账户出了什么问题

07:31

导致我们整个工作流跑不起来

07:33

07:33

刚才我们看到

07:34

我们可以用这些插件来使用一些推特 API 的付费功能

07:38

比如获取用户信息

07:40

查找推文

07:41

以及获取推文的内容等等

07:44

在跟 Bot 对话的过程当中使用这些功能呢

07:47

也非常的简单

07:48

方便

07:49

但是呢

07:49

如果我们需要去应对一些更复杂的场景呢

07:51

我们可能就需要去调用多个功能

07:54

或者呢

07:55

把一个功能多次的调用

07:57

比如我接下来要给大家演示的一个场景呢

07:59

就是假设我要从我关心的多个推主

08:02

那边去获得他们的最新推文

08:04

然后来总结出当前跟 AI 最相关的一些内容

08:08

以方便我获取信息呢

08:10

那我就需要去针对每一个用户

08:13

我都要调用一遍

08:14

那这实际上就是一个循环的过程

08:17

我们就需要用到工作流

08:19

工作流它的目的就是来实现一些更复杂的任务

08:23

那么我要给大家演示的这个工作流呢

08:25

就是希望他能够一次性的获取到我伊隆马斯克的推文

08:29

只要把你所关心的作者的信息都加到他的列表里面就可以了

08:34

那首先呢

08:35

我要把我关心的这些推主

08:36

他们的账号名称是什么

08:38

告诉这个机器人

08:40

可以有很多办法做到

08:41

那么我在这边用的比较简单的方法呢

08:43

就是定义一个变量叫 authors

08:45

就是作者

08:47

然后这个 authors 里面呢

08:48

我就给了他

08:49

这是我的推特账号

08:51

还有伊隆马斯克的

08:53

我们两个人的账号就可以了

08:54

做个演示

08:55

然后我们再进入到这个工作流里面

08:57

看看这个工作流他在干什么

08:59

09:00

这就是我的整个工作流

09:02

那工作流当中的每一个方块呢

09:04

实际上就是他完成的每一项功能可以叫做模块

09:08

在 Coze 里面呢

09:09

他就叫做节点

09:11

比如 Coze 里面所支持的这些节点

09:13

首先就有 basic 的节点

09:15

基本的节点

09:16

这就包括了大语言模型

09:18

然后 code 你可以写代码

09:20

完成一些客制化的功能

09:23

还有知识库

09:25

condition 条件

09:26

你可以设定一些条件

09:27

根据不同的条件呢

09:28

去跳转到不同的功能场景

09:31

变量就是你机器人当中的变量可以进行交互

09:34

数据库也是一样

09:36

那除了这些基本的模块之外呢

09:38

他还可以用插件

09:40

同样也可以用其他的工作流来当做你的工作流当中的节点

09:45

那既然我们的目的是为了查找推文

09:48

所以我们就要用到刚才我们前面演示过的

09:50

获取推文的那个插件

09:53

也就是 X 那个插件

09:55

最下面对我们要用到 search_tweet 这个模块

09:59

只要点击加号加进来就可以了

10:00

我这边已经有一个了

10:03

就是他 search_tweet

10:03

这就是今天的主角

10:05

那另外一个关键的模块呢

10:08

就是这个 variable

10:09

variable 是 code 里面的一个基础模块

10:12

他的目的呢

10:13

就是从你的 AIbot 里面

10:15

就是你的机器人里面把你定义的变量的值取过来

10:19

那我刚才在机器里面定义的变量

10:21

就是我关心的那些推文作者

10:23

也就是我 Elon Musk

10:25

还有 AndrewNG 这三个人作为例子

10:28

所以这个模块的功能就是要把我定义的

10:31

那三个人的账号拿过来

10:32

交给下一个工作流去用

10:35

所以很简单

10:35

我这边输入一个 key

10:38

authors 就是我在 bot 里面定义的这个变量的名称

10:42

就可以了

10:44

它的输出

10:45

你给它起个名字就行

10:47

那看你的节点配置的正常不正常呢

10:49

你只需要点击这个播放按钮

10:52

就可以测试你的这个节点

10:54

点击

10:55

这边就会选择一个 bot

10:57

那就是我们演示的 testx 这个 bot

11:00

11:00

然后运行

11:01

运行成功就是绿色的

11:03

这时候我们就可以看一下它运行的结果是什么

11:06

11:06

它的输出就已经取出了我定义的这三个人

11:10

这就说明我这个节点的配置是正确的

11:12

那这边的是一个 start 开始 节点

11:15

Coze 的工作流默认就会给你两个节点

11:17

一个是 开始 节点

11:18

你可以在这边去初始化一些

11:20

你需要在整个工作流当中用到的一些数据

11:24

比如我要查询推特

11:26

我可能就需要一个关键词

11:28

我就可以在这边定义一个叫 query string 的一个变量

11:32

用它来存我们要查询的关键词就可以了

11:35

同样

11:36

最后他还会默认给你加一个结束的一个节点

11:39

结束节点的主要目的就是把你的结果输出

11:42

你就可以在你的机器人里头用它

11:44

或者你也可以在其他的工作流里面去调用它

11:47

那这边用到的 GPT-4的一个模型就是

11:50

处理你的一些输入格式

11:52

这边主要就是查询推文

11:54

很多节点它都有两种运行模式

11:56

一种就是 single time 就是单次运行

11:58

还有就是批处理

12:00

我们首先看一下它的单次运行

12:02

它跟我们之前的演示是一样的

12:04

它需要三个变量

12:05

首先就是它的 query string

12:07

那这边我们就让它用我们最开始的 start

12:12

里面定义的查询字符串就可以了

12:15

12:15

这边的作者和返回多少条结果都是可以定义的

12:18

我们可以先测试一下它单次运行的结果

12:22

那这边作者

12:22

我们可以给它定死一个测试一下

12:25

比如说 axtonliu

12:27

12:29

运行一下

12:29

它会让你提供查询字符串

12:32

因为这个是一个变量

12:33

你没有在这边指定

12:35

所以你测试的时候需要给它提供一个

12:37

比如我们就 AI

12:39

然后运行

12:40

12:40

运行成功

12:41

我们同样可以看一下它的结果

12:43

那这边的就是它的查询出来的结果

12:46

有没有数据呢

12:47

是有数据的

12:48

查询出来了12个推文

12:50

那这边我们就可以看到这个推文的一些信息

12:53

包括推文的内容

12:54

说明这个节点工作是正常的

12:57

但是因为我们需要去同时要查三个人多个人的推文

13:01

所以我们肯定不能用单次执行

13:03

我们就要用到它的批处理模式

13:05

但是它的批处理模式就比较尴尬了

13:08

因为我们在它的文档当中没有发现有关批处理模式

13:12

该怎么去配置的说明

13:14

我们可以看一下扣子的这个文档

13:16

它当中对工作流怎么使用的一个简介

13:20

文档基本上都包含了一个工作流的基础操作

13:23

而且这边它还很贴心的提供了几个最佳实践的

13:26

工作流的例子

13:28

比如识别用户意图这个工作流

13:31

这应该是这个例子当中最复杂的一个工作流

13:34

那它的目的就是用大语言模型来根据用户的输入

13:37

去判断你的用户到底是想干什么

13:40

是想去搜索新闻信息呢

13:42

还是想去搜索天气的信息

13:45

那基本上它的这个工作流的例子

13:47

就把它前面的工作流的一些例子都包含在一起了

13:50

所以如果你对扣子的工作流感兴趣

13:52

我建议你把它的这个工作流的例子好好地研究一下

13:56

可以方便你快速地了解工作流的工作过程

13:59

但是遗憾的就是在这个使用工作流的这个文档当中

14:04

只有单次的例子

14:05

没有批处理的例子

14:06

14:07

回到我们的工作流

14:09

因为我们是要批处理嘛

14:10

所以我这边的参数呢

14:11

就需要用到前边某块的输出

14:14

比如它的查询关键词呢

14:16

就是 query string

14:18

这个我们在开始的节点上定义的查询字符串

14:22

那这个作者呢

14:22

就是那三个人

14:23

我,Elon Musk,还有 Andrew

14:26

因为批处理的过程实际上就是一个人一个人的处理

14:28

那这边作者呢

14:29

实际上我用到的是他的批处理这个参数

14:32

它并不是我前面的那个作者的变量

14:34

这点是需要注意的

14:36

item1 这个

14:37

然后要返回多少个信息呢

14:39

这边我们就随便定义一个行了

14:40

因为它不重要

14:41

14:42

那至于批处理里面该怎么样配置

14:44

以及为什么要这样的配置

14:46

它的目的是什么

14:47

这些就比较繁琐了

14:49

我就不在视频里面啰嗦了

14:51

回头几天呢

14:52

我会把它整理成一个说明文档

14:55

去放到我的 AI 精英学院里面供大家参考

14:58

14:58

最后的结束的节点呢

15:00

我们就把它的结果输出到一个我们自己定义的一个变量

15:03

这个名字是随便起的

15:05

然后它的输出呢

15:06

实际上就是我们的查询推特的这个输出

15:09

那这样我们整个工作流就串起来了

15:11

我们可以先测试一下我们的工作流能不能正常的运行

15:14

比如我们这边就是点 test run 测试运行

15:17

首先我们需要给他一个 query string

15:20

查询字符串关键词

15:21

我们还是给 AI

15:23

然后同样我们要选一个 bot 机器人

15:26

我们就选 test x

15:28

15:28

我们运行

15:29

15:30

成功完成

15:31

我们来看一下它的输出结果

15:32

这就是最终输出的结果

15:36

我们可以看到查出了三个结果

15:38

第一个第一个查到了12个推文

15:42

15:42

那这个推文就是我的

15:43

第二个一这个我们看

15:46

也是出来了12个推文

15:50

AI is not better

15:51

这应该就是 Elon Musk 的

15:53

然后我们再看最后一个

15:55

这就是Andrew的推文

15:57

所以这个工作流它的效果就很理想

15:59

它完全是按照我们的要求输出了三个人的推文

16:04

每个人找出了12条推文

16:07

并没有严格的按照我们的 count 的定义去执行

16:10

那么这样的我们就可以针对他找出来的这三个推文

16:13

他都返回了比较完善的一个数据结构

16:16

我们就可以继续对他进行一些后续的加工

16:19

比如你从三个人所有的推文当中

16:21

你再去挑选你最关心的内容

16:23

这就比较方便了

16:25

16:25

那现在我们再回到我们的 AI 机器人

16:29

我们再演示一遍

16:30

我们该如何去调用刚才我们创建好的这个工作流

16:35

首先点就是我们要把工作流添加到这里面

16:37

用加号添加就可以了

16:40

那要测试一下

16:40

我们就用这个命令就可以了

16:43

比如我们就在这边指明

16:45

让他用这个工作流去帮我寻找 AI 相关的推文

16:48

并且输出中文

16:50

然后点击发送

16:52

16:52

这边他找了我和伊隆马斯克的

16:54

但是没有找Andrew的

16:56

但是没有关系

16:57

毕竟是一个演示

16:58

能达到这个结果说明我们的整个流程都是工作正常的

17:03

17:03

我们接下来再来演示一下

17:04

我们在视频开头演示失败的获取用户的粉丝的功能

17:09

17:09

我们就要求他请使用 users followers 获取伊隆马斯克的粉丝

17:14

不错

17:14

获取到了伊隆马斯克的部分粉丝

17:17

可惜只有五个

17:18

我看看他的数据里面有多少

17:21

那还是不错

17:22

他返回的数据还是挺多的

17:24

但是总结出来的只有五个

17:26

17:26

总结一下

17:27

扣子可以让大家免费的使用付费服务

17:30

这点非常的好

17:32

但是呢

17:32

这些服务他是有用量限制的

17:34

我在为视频做测试准备的时候呢

17:36

就达到了限制

17:37

不能继续的去查询推文了

17:40

所以呢

17:40

不要指望用他的推特功能来当做爬虫

17:44

第二呢

17:44

扣子目前文档还是缺乏

17:46

这会让你耗费更多的时间和精力

17:49

那这点呢

17:50

希望他们能够尽快的完善起来

17:52

如果你希望能够利用 AI 来提升你的效率和竞争力

17:56

请尽快的加入 AI 精英学院

17:58

下一波更新即将到来

18:00

价格也将会上调

18:02

请抓住现在最好的时机

18:04

请输入网址 axtonliu.ai

18:07

这里不但有我分享的高价值的免费内容

18:10

还有我精心打造的两门 AI 基础能力的课程

18:14

AI 与自动化的融合以及 Prompt Engineering

18:17

我会教你驾驭 AI 所需要的基础能力

18:20

而不是昙花一现的花式技巧

18:23

这些基础能力可以帮助你用学到的知识

18:26

来解决你自己当下的问题

18:28

甚至是未来的问题

18:30

18:30

今天就到这里

18:31

我是 Axton

18:31

咱们下期再见