Coze | How to use Workflows

Coze
24 Jan 202419:09

Summary

TLDRこのビデオでは、ワークフローを使ってAIチャットボットをカスタマイズする方法を紹介しています。NBAの最新情報や統計、スコアをリアルタイムで提供するNBAボットを作成する例を通じて、マルチステップタスクを自動化する方法を説明します。ワークフローはノードを用いてタスクを分割し、最終結果を得るためのステップを定義します。プラグインやコードノードを活用してAPIからデータを取得し、大規模言語モデルを用いてユーザーにわかりやすい形で情報を提供します。ワークフローの実装前後でのボットの応答の違いも比較され、カスタマイズの重要性が強調されています。

Takeaways

  • 🤖 AIチャットボットを作成するためにコードを使用し、プロンプト、追加スキル、プラグインを使用してボットにパーソナを与え、ナレッジベースを使用してインテリジェンスを提供している。
  • 🛠️ ワークフローを使用して、マルチステップのタスクを完了する方法を紹介し、ボットをさらにカスタマイズする方法を説明している。
  • 🏀 NBAボットの例を使用して、シーズン中の最新情報、統計、スコアを提供するだけでなく、過去のゲームやリアルタイムのゲームも確認できるようにしている。
  • 📅 ワークフローの追加前と追加後のボットの応答の違いを比較し、データの正確性と一貫性を高めるためにワークフローが重要な役割を果たしていることを示している。
  • 🔗 ワークフローはノードから構成されており、それらはステップとして機能し、最終結果を得るために互いに接続している。
  • 🔧 コードノードを使用して、入力変数を処理し、特定の値を生成することができるが、ワークフローを作成する際にはコーディングの知識は必要ないが役立つ。
  • 🔍 ナレッジノードはナレッジベースを使用して、問い合わせと入力に基づいて情報を照合し、情報提供を行う。
  • 📝 if条件ノードと変数ノードはロジックを処理し、特定の条件に基づいて意思決定を行い、値を読み書きして保存することができる。
  • 🔌 プラグインはワークフローのノードとして機能し、特定の情報源にアクセスするために使用される。
  • 📈 ワークフローのテスト実行を通じて、ボットがAPIから受け取ったデータを処理し、ユーザーに必要な情報のみを提供するように調整している。
  • 📝 最後に、ワークフローを公開し、ボットにワークフローを追加して、より良い応答を提供するように調整している。

Q & A

  • コードを使用してAIチャットボットを作成することとはどういう意味ですか?

    -AIチャットボットを作成するためにコードを使用することは、プロンプトを使用してボットのパーソナを与えること、プラグインやスキルを追加してボットの機能を強化し、ナレッジベースを通じて知能を提供することであり、特定のニーズに応じてさらにカスタマイズすることが可能です。

  • ワークフローとは何で、どのようにしてマルチステップのタスクを完了させるのに役立つか説明してください。

    -ワークフローは、タスクを完了させるためのステップバイステップのプロセスを定義するツールです。マルチステップのタスクを完了させるためには、ワークフロー内の各ノードを通じて入力を処理し、最終的な結果を得るための出力を生成します。

  • このビデオではどのような種類のAIチャットボットを作成していますか?

    -ビデオではNBAボットを作成しており、その目的は最新の統計情報、スコア、シーズン中のすべてのNBAゲームに関する情報を提供することです。また、過去のシーズンやリアルタイムでのゲームも確認できます。

  • ワークフローを使わずにボットが生成するレスポンスと、ワークフローを使用した場合の違いは何ですか?

    -ワークフローを使わずにボットが生成するレスポンスは、不正確なデータや不要な情報を含んでいる可能性があります。一方、ワークフローを使用することで、最も正確なデータを取得し、ユーザーに一貫した方法で提供できます。

  • ノードとは何で、ワークフロー内で何の役割を果たしますか?

    -ノードはワークフローを構成する基本単位であり、特定の結果を得るために一つのステップを表します。ノードは互いに接続され、ユーザーからの入力を処理し、特定の答えを得るために必要な情報を提供します。

  • ワークフロー内で使用されるコードノードとは何であり、何のために使われますか?

    -コードノードはワークフロー内で使用され、入力変数を処理し、戻り値を生成します。これは、APIやプラグインから特定の結果を得る必要がある場合に、コーディング知識が非常に役立ちますが、ワークフローを作成するためにはコーディングの知識は必須ではありません。

  • プラグインとは何で、ワークフロー内でどのように役立つのですか?

    -プラグインは外部サービスやAPIと接続し、特定のデータを取得したり機能を提供したりするツールです。ワークフロー内でプラグインは、特定のタスクを自動化したり、必要な情報を取得したりするのに役立ちます。

  • このビデオではどのようにして独自のプラグインを作成し、それをワークフローに統合しましたか?

    -ビデオでは独自のプラグインを作成し、NBA APIに接続して必要なデータを取得できるようにしました。そして、そのプラグインをワークフローにドラッグアンドドロップして、必要な情報を処理し、ユーザーに提供するように統合しました。

  • ワークフローの最終ステップであるエンドノードはどのような役割を持っていますか?

    -エンドノードはワークフローの最終ステップで、ユーザーが求める答えを生成し、フォーマットして提供します。エンドノードは、ワークフロー内のすべてのステップを通じて得られた情報を元に、ユーザーにわかりやすい形で結果を提示します。

  • ワークフローを使用することでボットのレスポンス品質はどのように向上するのですか?

    -ワークフローを使用することで、ボットはより正確な情報を取得し、必要のない情報を除外してユーザーに提供できます。これにより、ボットのレスポンス品質は向上し、ユーザーが求める情報をより正確かつ効果的に提供できます。

  • このビデオの最後にどのようにしてワークフローをボットに適用するか説明されていますか?

    -ビデオの最後に、ワークフローを作成し、それをボットの空間に追加する手順が説明されています。そして、ワークフローを適用することで、ボットのレスポンスがどのように向上するのかを比較することができます。

Outlines

00:00

🤖 AIチャットボットのワークフローの紹介

この段落では、AIチャットボットを作成し、その個性を作り出し、知識ベースを通じて知能を与える方法が説明されています。さらに、ワークフローを使ってボットが特定のニーズに合わせて複数ステップのタスクを完了する方法も紹介されています。ワークフローは、ノードと呼ばれる基本単位からなり、それらが相互に接続して最終結果を得る仕組みです。ノードには、大規模言語モデルノード、プロンプト、コードノード、知識ノード、条件分岐、変数ノードなどがあります。また、プラグインや他のワークフローもノードとして使用できると示されています。

05:02

🏀 NBAゲーム情報のためのプラグインの作成とワークフローの構築

この段落では、NBAのスコアと統計情報を取得するためのカスタムプラグインを作成し、それをワークフローに組み込む方法が説明されています。プラグインはNDA APIに接続し、過去のゲームやリアルタイムのゲーム情報を含むデータを取得します。ワークフローでは、開始ノードからプラグインにデータを渡し、コードノードを使って必要な情報だけを抽出します。その後、大規模言語モデルノードを使って情報をユーザーにとって理解しやすい形に変換し、応答コンテンツを使って最終的な結果を整形します。

10:04

📊 NBAゲーム結果の詳細な情報抽出と整形

この段落では、コードノードを使ってAPIから取得したデータを加工し、必要な情報のみを抽出する方法が説明されています。次に、大規模言語モデルノードを使って、抽出された情報をユーザーに伝えるためのプロンプトを作成し、応答コンテンツを使って結果を整形します。これにより、ボットからの応答はより正確で詳細になり、ユーザーが求める情報だけを効率的に提供できます。

15:04

📝 ワークフローの実装前後でのボット応答の比較

最後の段落では、ワークフローを実装する前後のボットの応答を比較しています。ワークフローを実装する前は、ボットからの応答が不正確で、望まないゲームの結果も含まれていることが示されています。しかし、ワークフローを実装した後、ボットはAPIとコードノード、大規模言語モデルを通じて正確な情報を提供し、ユーザーの質問に適切に答えることができます。ワークフローの実装の重要性とその効果が明確に示されています。

Mindmap

Keywords

💡AI chatbot

AI chatbotとは、人工知能を活用して会話が可能なボットのことです。このビデオでは、AI chatbotを作成し、パーソナリティやスキル、プラグインを用いてカスタマイズする方法を紹介しています。AI chatbotは、ユーザーとの対話を通じて情報を提供したり、タスクを完了させることが可能です。

💡Workflows

Workflowsとは、タスクを完了させるためのステップバイステップのプロセスを定義した仕組みです。ビデオでは、ワークフローを使ってAI chatbotがマルチステップのタスクをこなす方法を説明しています。これは、特定のニーズに合わせてボットをカスタマイズする上で非常に重要な要素です。

💡Persona

Personaとは、キャラクターや個々の特性を持つボットのパーソナリティを指します。ビデオでは、ボットにパーソナリティを与えることで、ユーザーとの対話をより自然で魅力的に行う方法が紹介されています。

💡Skills

Skillsは、AI chatbotが持っている特定の能力や機能を指します。ビデオでは、スキルを追加することでボットの能力を拡張し、より複雑なタスクをこなす方法が説明されています。

💡Plugins

Pluginsとは、AI chatbotに追加の機能を提供する外部のソフトウェア部品です。ビデオでは、プラグインを使ってボットを拡張し、特定の情報源にアクセスする方法が紹介されています。

💡Knowledge bases

Knowledge basesとは、AI chatbotが情報を検索し回答するためのデータベースです。ビデオでは、ナレッジベースを使ってボットがより正確な情報を提供する仕組みを説明しています。

💡Nodes

Nodesとは、ワークフロー内のステップを表す基本単位です。ビデオでは、ノードがワークフローを構成し、タスクを完了させるプロセスを制御する方法について説明しています。

💡Large language model

Large language modelとは、大量のデータを学習し、自然言語を理解し生成するAIモデルです。ビデオでは、ラージランゲージモデルがボットの応答を生成し、ユーザーとの対話を促進する役割を果たしていると説明されています。

💡API

APIとは、Application Programming Interfaceの略で、ソフトウェア間でデータをやり取りするためのインターフェースです。ビデオでは、APIを通じてリアルタイムのNBAのスコアや統計情報を取得する方法が紹介されています。

💡Customization

Customizationとは、ユーザーの特定のニーズに合わせてソフトウェアやサービスをカスタマイズするプロセスです。ビデオでは、ワークフローを使ってAI chatbotをカスタマイズし、ユーザーに合わせたサービスを提供する方法が説明されています。

Highlights

Creating an AI chatbot involves giving the bot a persona using prompts, extra skills or plugins, and knowledge bases.

Customization of the bot can be enhanced using workflows to complete multi-step tasks.

The example project is an NBA bot designed to provide the latest information, statistics, and scores of NBA games, including past, present, and real-time games.

Workflows help ensure accurate data by setting up multi-step tasks and providing uniform information to the user.

The starting node takes user input, and the end node produces the output in workflows.

Basic nodes include large language models, prompts, code nodes, knowledge nodes, if conditions, and variable nodes.

Plugins can also be used as nodes in workflows, and custom plugins can be created for specific needs.

An example custom plugin connects to an NBA API to fetch game data, scores, stats, and other relevant information.

Nodes in workflows connect in a sequence to achieve the desired result, with each node performing a specific task.

Code nodes allow processing of input variables and generation of return values, enhancing the workflow's capabilities.

Knowledge nodes use knowledge bases to match information based on inputs, aiding in accurate data retrieval.

If conditions and variable nodes help with logic, making decisions based on conditions and storing values for later use.

The example workflow involves nodes for starting input, NBA data retrieval, code processing, and output formatting.

The code node processes the NBA API data to extract only the necessary information, making the response concise.

The large language model node formats the extracted information into a readable format for the user.

Workflows significantly improve the accuracy and presentation of information provided by the bot.

The final output is tailored to present the number of games, teams, and scores for a specific date as per the workflow's design.

Transcripts

play00:00

so you've been using codes to create an

play00:02

AI chatbot that means that you've given

play00:04

your Bot a Persona using prompts some

play00:06

extra skills or plugins and then also

play00:08

intelligence using knowledge bases

play00:10

however you want to customize it even

play00:12

more so that your Bot knows how to

play00:14

really complete task tailor towards your

play00:16

specific needs so in this video I'm

play00:19

going to show you how to use workflows

play00:20

so that your Bot knows how to complete

play00:22

multi-step task let's head over to the

play00:24

CO's workspace so I can show you how

play00:27

workflows can really enhance your B

play00:30

[Music]

play00:35

all right so I'm creating an NBA bot and

play00:38

the purpose of this spot is to give me

play00:39

the latest information the statistics

play00:42

and the scores of all the NBA games that

play00:44

are happening this season and not only

play00:46

that I'll be able to look at games that

play00:48

happened in the past and previous

play00:50

seasons and also games that are

play00:51

happening in real time so the spot is

play00:53

pretty powerful and workflows are going

play00:55

to help us get there so there's actually

play00:57

no need for me to really even look at

play00:59

ESPN anymore because I have my own

play01:00

personal assistant so if we look at our

play01:03

Persona impr prompts I have a character

play01:05

set with some skills and constraints and

play01:07

over time I'll be able to add more to

play01:09

this to enhance our bot even further so

play01:11

if we look at the skills here we don't

play01:13

have any plugins or workflows right now

play01:15

so the reason why is because we haven't

play01:17

created it yet and also because I want

play01:19

to show you the difference between how

play01:22

this operates without a workflow versus

play01:24

towards the end of the video how it

play01:26

operates when we do add the workflow so

play01:28

let's ask this bot what the scores were

play01:30

for January 20th 2024 and we'll see the

play01:33

difference later on so let's see how

play01:36

this bot generates a

play01:38

response so I do remember watching games

play01:41

on this day and I don't remember any of

play01:43

these games happening the Warriors never

play01:44

played the Rockets and the Lakers did

play01:46

not play the Milwaukee Bucks on this

play01:48

date so this is where workflows are

play01:51

going to come into play we're not sure

play01:52

where this data came from however with

play01:54

workflows we'll be able to set up a

play01:56

multi-step task in order for us to get

play01:59

the most accurate data and deliver it to

play02:01

our user in a uniform way so what we'll

play02:05

do now is we'll go over here to add

play02:07

workflows and we'll create our

play02:09

workflow and we'll name our workflow

play02:11

MBA workflow for

play02:15

now and the description box is a place

play02:19

that you can describe your workflow of

play02:20

course however it uses a large language

play02:22

model to help our workflow understand

play02:24

how it needs to be invoked so we can

play02:26

just say get the latest

play02:33

NBA

play02:40

scores okay so the first thing to

play02:43

understand about workflows are nodes and

play02:45

nodes are the basic unit of what make up

play02:48

workflow and nodes connect to one

play02:51

another in order to get an end result so

play02:53

think of a node as a step that it takes

play02:56

in order to give our user the specific

play02:58

answer that we want so we have our

play03:01

starting node here that it comes with

play03:03

and this starting node is where the user

play03:05

puts an input or the question that

play03:07

they're asking and then the other node

play03:09

that uh the workflow gives us is the end

play03:11

node here and the end node is what

play03:13

produces our output and Returns the

play03:17

value that we're looking for here so

play03:19

that would be our

play03:20

answer now there are a few other nodes

play03:23

that go in between the start node and

play03:25

the end node and if we bring our

play03:26

attention here to the left side we'll

play03:28

see that we have basic nodes so we have

play03:31

our large language model node which

play03:32

invokes a large language model and it

play03:35

can gener generate a response based on

play03:38

the input that we give it and then we

play03:40

also have a prompt that we can have to

play03:42

specify our answer even more and I'll

play03:44

show you how to use that too we also

play03:46

have our code node here which allows you

play03:49

to process an input variable and it will

play03:51

generate a return value so with work

play03:53

flows just keep in mind you don't need

play03:55

to know how to code however it does help

play03:57

a lot if you do have this knowledge

play03:59

because being able to get these specific

play04:02

answers from things like plugins or apis

play04:05

you're going to be required to know how

play04:06

to code or at least understand what's

play04:09

going on to get the results that you

play04:11

want now the next node that we have here

play04:14

are the knowledge nodes and this is a

play04:17

node that uses the knowledge bases that

play04:19

you create and matches information based

play04:22

on what you're asking here and what your

play04:24

inputs are then we also have our if

play04:27

condition and our variable nodes here

play04:29

which are a little bit more related to

play04:30

coding however these are to help with

play04:33

logic so our if condition here will

play04:36

allow us to um actually make some type

play04:38

of decision if something's happening

play04:41

then do this and our variable node here

play04:44

is to help us read and write values so

play04:46

that we can store things and pass them

play04:48

on when we need them to be um so not

play04:52

only do we have these basic nodes we

play04:53

also have plugins that can be nodes and

play04:56

workflows that can also be nodes so you

play04:57

can also use another workflow that you

play04:59

you created as a node itself but in this

play05:02

video we're not going to cover that but

play05:04

uh we're actually going to talk about

play05:05

plugins here so with plugins we have

play05:09

plenty of plugins like Reddit Microsoft

play05:12

Outlook slack Google search you name in

play05:15

however these plugins right here aren't

play05:18

really going to specifically give me

play05:19

what I want so I took my time to create

play05:21

my own plug-in and this plugin connects

play05:23

to an NDA API that I'm able to grab the

play05:26

data that I want so this data consists

play05:28

of games that happened in the past or

play05:31

even games that are happening right now

play05:32

in real time so I'm able to grab the

play05:34

scores and stats and also even see who

play05:37

even officiated the game now I might not

play05:39

need all that information to create this

play05:41

workflow however we're going to use bits

play05:43

and pieces of it all right so let's add

play05:46

our MBA node here from our plugins and

play05:50

we'll just drag it here to the middle

play05:52

now what we'll do is actually name this

play05:55

starting input that we have here and

play05:58

we're just going to name the starting

play05:59

input date because this is where the

play06:01

user is going to be asking their

play06:03

question um so this question is based

play06:05

off of the date that we're going to be

play06:07

sending to this NBA API node that we

play06:11

have here as well so our description

play06:14

we'll just set this simply as what this

play06:16

is going to do it's just going to be

play06:17

taking a date in by a format and the

play06:19

format doesn't really matter because

play06:21

it's going to be running through an llm

play06:23

anyways so it's going to be able to

play06:24

determine the date based on how we

play06:26

rewrite it now the next step is we're

play06:29

going to connect our starting node to

play06:31

our NBA Daily data node that has our NBA

play06:34

plugin in it right so this plugin is

play06:37

already created and it's already looking

play06:39

for this game date here so we're using

play06:42

the game date to determine where uh what

play06:44

games are being played now this game

play06:46

date we're going to reference this to

play06:48

the input that we have from the start

play06:51

node on the date so we're connecting

play06:53

this date this question of what games

play06:56

happen on this date to this NBA node

play07:00

that's actually a plugin that connects

play07:02

to an API and this API has all of the

play07:06

data that we need for games that are

play07:08

happening in real time or games that

play07:10

happened in the past based on the date

play07:11

that we ask now when we use this plug-in

play07:15

here we have this payload with all this

play07:17

data and so for the next step what I'm

play07:19

going to do is I'm going to add a code

play07:22

node here so you can see what it looks

play07:24

like when we connect all this to code

play07:26

and we start to parse out this

play07:28

information the code node requires the

play07:30

most amount of complexity here but it's

play07:33

not required for you to make a

play07:34

workflow I'm still going to show you how

play07:36

to do it anyways because it is important

play07:38

to know the power that this code node

play07:40

can actually bring to your workflow that

play07:42

will then be presented in your Bot so

play07:45

we'll go ahead and we'll connect this

play07:47

daily data node to our code node and

play07:50

I'll use a block of code that I've

play07:51

already created and I'll explain it and

play07:53

go down each

play07:56

line but before we do that let's take a

play07:58

look at these input puts I want to make

play08:01

sure that I am getting the inputs that I

play08:03

need from this NBA Daily data node so

play08:08

I'm going to need a few things let's

play08:10

look through this uh payload that we get

play08:13

so we look through here through date and

play08:15

I definitely want some games all this

play08:19

data from who was the away team to the

play08:22

profiles of the players all the way to

play08:25

the game count as well so let's take

play08:29

this input and we're going to name it

play08:32

games and then we're going to have this

play08:34

reference our NBA Daily data payload and

play08:37

we'll look for here in date and we'll

play08:39

get games and then I'm going to add

play08:42

another input here for the games count

play08:45

so I want to be able to tell my user how

play08:49

many games happened on that day as well

play08:51

because every day is different so I'll

play08:53

take this I'll go to NBA Daily data and

play08:56

then I'll also go to my payload my dat

play08:59

and game count and it's just great

play09:01

because I can go through all these

play09:02

different fields here and customize my

play09:05

response how I want it to look so now

play09:07

that I have these inputs here let's take

play09:09

a look at this code block a bit now this

play09:11

code block all it's telling me is to go

play09:14

through the uh list of games that we

play09:18

have inside of our payload so it'll tell

play09:21

me all the games that are happening

play09:22

create a new array of these games and

play09:24

bring me back the profile the box score

play09:28

who the home team was and who was the

play09:30

away team and here all I'm saying is

play09:33

bring me back the city of the home team

play09:35

and bring me back the name of the home

play09:37

team and the same thing for the away

play09:39

team as well so I'm just going through

play09:41

all this information that's being taken

play09:43

from this node and pass to the code and

play09:46

I'm just splitting it into little tiny

play09:48

chunks so I can only get the information

play09:50

that I'm actually looking for and not a

play09:52

bunch of other things that are not

play09:54

necessary now for this output what I'll

play09:56

do now as well is I'll set up my out

play09:59

outut so that my things that I'm getting

play10:00

as my input from here are going to be

play10:03

passed on to the next node which would

play10:05

be my large language model so I want

play10:07

these same inputs these answers for what

play10:09

were the games and how many games

play10:11

happened and then within that same uh

play10:13

information we're getting from this node

play10:15

we'll get the profile the box score who

play10:17

the home team was and who the way team

play10:19

was and so forth so let's go here and

play10:22

add our

play10:24

games and we'll keep this as a type

play10:26

string right because it's just a text

play10:29

and then we're going to add another one

play10:30

here for game

play10:34

count and we'll change this to a number

play10:36

because just the number of games that

play10:39

we're going to be presenting to the user

play10:41

so the next step is to create a large

play10:43

language model node and put it here in

play10:45

order to connect to our code node

play10:47

because this large language model node

play10:49

is going to be able to take this

play10:50

information that we have in this

play10:52

unreadable format and make it more

play10:55

legible for our user to understand so

play10:58

what I'll do now is I'll take this large

play11:01

language model prompt that I've already

play11:03

created as well and I'll put this inside

play11:06

of our large language model node so

play11:08

let's move things over to the

play11:09

side and we'll connect our nodes

play11:15

together right and let's connect this to

play11:17

the end node here and what I'll do now

play11:20

is change my GPT model to GPT 4 and I

play11:24

can keep the temperature the same but

play11:26

the things that are different is I'm

play11:28

going to this input right is actually

play11:31

going to be referencing our input of the

play11:35

games so I'm going to put games here and

play11:37

then I'm going to reference what I'm

play11:39

getting from this code node it's being

play11:42

passed down so this input that I put

play11:44

here for the games that's getting from

play11:45

the plugin and then it's spitting back

play11:47

out here through this output I want to

play11:49

pass this output all the way to this

play11:51

large language model so let's go here

play11:53

and take from our code I want the games

play11:57

now I have a prompt that I've already

play11:59

written as well and this prompt is just

play12:01

describing what I want this workflow to

play12:03

do with the data that I'm passing to it

play12:06

from the code node now this is just

play12:08

going to be able to tell our uh large

play12:11

language model exactly what we want and

play12:13

it's going to be able to Output inside

play12:15

of our end result a lot better than how

play12:18

it would without this larger language

play12:19

model so for this output I'm just going

play12:22

to custom make this to game results and

play12:26

I'll just do game res for short and I'll

play12:28

keep this as a string because this is

play12:30

just going to be a text again that's

play12:32

going to hold all the information that I

play12:34

want and I'll just say that this is the

play12:38

results of the

play12:42

games okay great so now I have

play12:46

everything ready to go and it's

play12:48

connected to my end node here now my end

play12:51

node is pretty much how I want my result

play12:55

to be formatted here right so I'm

play12:57

already have all the information

play12:58

information that I need and now I'm just

play13:00

being able to present it to the user the

play13:03

way that I want to with this end node

play13:05

and I'm going to take this game result

play13:07

that we

play13:09

have and I'm going to have that as an

play13:11

input but before I do that let's add an

play13:14

answer with a direct answer content as

play13:17

well and this is where we're going to be

play13:18

able to format our response the way we

play13:20

want it to be so we'll take game results

play13:23

let's do game res and I'm going to

play13:26

reference that to what we're getting

play13:27

from our large link model all right I'll

play13:30

also take my date that I'm going to be

play13:33

taking from the user from the beginning

play13:36

right so I have to reference my date

play13:38

from the start and then I also am going

play13:41

to take my game count right so we have

play13:44

our game count because we want to have

play13:46

our amount of games that we're going to

play13:48

present to our user as well and we have

play13:50

our game count is coming from our uh our

play13:54

code all right so now all we need to do

play13:58

is create some type of answer content

play14:01

and we're going to customize how this

play14:02

answer is going to look so um we're

play14:05

going to use these same input fields in

play14:07

order to do that and I've already have

play14:10

this written out here so that when it

play14:11

does print out to the user and they ask

play14:13

hey tell me the scores for this specific

play14:16

date it's going to list it in a way that

play14:18

we have this formatted here so the bot's

play14:21

going to

play14:21

say there were blank amount of games on

play14:25

a certain date here were the results so

play14:27

now we have all these notes connected

play14:29

and let's give it a test run and see how

play14:30

it

play14:31

works so we have this date here we'll

play14:33

submit for the 20th of January and we'll

play14:36

submit it and let's zoom out a bit and

play14:38

we're going to see how this workflow is

play14:40

being used here so we have our starting

play14:43

node is already having a success and our

play14:46

start node again is just taking in our

play14:48

input so we can display our result here

play14:50

and you'll see this just taking in the

play14:52

date right and then we also have our NBA

play14:55

Daily data node and this here is taking

play14:58

in our our game date and it's giving us

play15:00

back this payload and it's letting us

play15:01

know we had eight games on that day

play15:03

here's some highlights here's the away

play15:06

team and all this other information that

play15:07

we're going to need but if you look at

play15:09

how much data is in here there's a lot

play15:12

and we really don't need all of this now

play15:15

this then gets passed to our code node

play15:18

and this is where we take care of

play15:19

truncating that data and making it a lot

play15:21

smaller because we're only asking for

play15:23

the profile the box score who the home

play15:25

team was who the away team was and the

play15:28

amount of games that did happen on that

play15:29

day so we have our display result here

play15:32

and we'll see that we have this input

play15:34

given from this API and look how much

play15:36

longer this is from this input that

play15:38

we're getting from the API or this node

play15:41

and how much shorter it is now when we

play15:43

run it through this code because we're

play15:44

only taking out the information that we

play15:47

want now this is being passed to our

play15:49

large language model node now this large

play15:52

language model node is taking this

play15:54

information from this output and running

play15:56

it through this prompt to make it more

play15:57

readable for us

play15:59

and we show this display result here and

play16:02

we take this input this same output that

play16:04

we get from here it turns into an input

play16:06

and an outputs here are the game results

play16:09

uh the NBA games that happen Milwaukee

play16:11

Bucks Detroit Pistons it shows all these

play16:14

games that happen on this date and

play16:16

notice how this list is a lot shorter

play16:18

now it's only showing these eight games

play16:20

so when we pass this large language

play16:22

model node inputs and outputs to our

play16:25

successful end node we're going to only

play16:29

take out this information that we do

play16:30

want to present to our user the game

play16:32

results the game date and the game count

play16:35

and if we display our results here

play16:38

you'll see that we have it custom made

play16:41

on how we've written here in our answer

play16:43

content and it says there were x amount

play16:46

of games here on this date and it's

play16:48

going to present it in the way that we

play16:50

wanted to so let's go right here and

play16:52

publish our workflow after a successful

play16:54

run that we just

play16:55

have and we can go over here to are bot

play16:59

currently there's no workflows or

play17:01

plugins in this bot it's just powered by

play17:03

a Persona impr prompt at the moment so

play17:05

what I'm going to do now is just compare

play17:07

how this bot responds without a workflow

play17:10

versus how it will respond when we do

play17:12

add the workflow so let's just ask this

play17:14

spot the same question we had before

play17:16

what happens on January 20th tell me the

play17:19

scores and let's

play17:22

see so right now I can already tell you

play17:24

off the bat this Warriors versus Lakers

play17:27

game did not happen on this date

play17:28

and either did this Heat versus 76ers

play17:31

game so I'm not sure where this

play17:33

information is coming from and it

play17:35

doesn't mean that these Bots are not

play17:36

intelligent it's just that it's not

play17:38

tailored for our needs yet and that's

play17:40

where the workflow is come into play so

play17:42

let's see how this looks when we add a

play17:44

workflow now if I go to I created and

play17:47

add my workflow to the

play17:48

space I'll ask this bot the same

play17:51

question again and then we're going to

play17:52

see how this response is completely

play17:54

different

play17:56

now so as you you can see here it's

play17:59

going through the workflow just remember

play18:01

all those nodes that the inputs are

play18:02

being passed from one node to the next

play18:05

all the way to get to the end result and

play18:07

as we look at how this response is we'll

play18:10

see that this is tailored to how we

play18:12

wrote it in our workflow remember we

play18:14

wrote in our workflow that there were

play18:15

going to be a certain amount of games on

play18:18

this date that's how we formatted the

play18:19

text to be and now this workflow is

play18:22

going through the API and the also the

play18:25

code node the large language model all

play18:27

the way to the end to give us the

play18:29

accurate information and the accurate

play18:30

scores that happen on the state so

play18:33

that's the power of workflows right I

play18:35

can specify how I want things to look

play18:37

and tailor make it for my users all

play18:40

right so that's how you use workflows

play18:41

with codes now it's the most advanced

play18:43

feature when it comes to using the

play18:45

platform however you can really see the

play18:47

difference in the quality of the answer

play18:49

your Bot gives when you implement a

play18:50

workflow now if you want to learn more

play18:52

check out our documentation and also

play18:54

join us on Discord keep a lookout for

play18:56

more videos and I'll see you next time

Rate This

5.0 / 5 (0 votes)

Related Tags
AIチャットボットワークフローカスタマイズマルチステップタスク管理NBA情報API連携データ解析プラグインコードノード
Do you need a summary in English?