১. শুরু করার আগে
এই কোডল্যাবে, আপনি শিখবেন কিভাবে ডায়ালগফ্লো সিএক্স দিয়ে একটি খুচরা চ্যাটবট তৈরি করতে হয়, যা কথোপকথনমূলক UI তৈরির জন্য একটি কথোপকথনমূলক এআই প্ল্যাটফর্ম (CAIP)। ডায়ালগফ্লো সিএক্স ভার্চুয়াল এজেন্ট বাস্তবায়ন করতে পারে, যেমন: চ্যাটবট, ভয়েস বট, ফোন গেটওয়ে এবং ৫০ টিরও বেশি ভাষায় একাধিক চ্যানেল সমর্থন করতে পারে।
এই কোডল্যাবটি আপনাকে একটি খুচরা বিক্রেতার জন্য একটি ওয়েবসাইট চ্যাটবট তৈরি করার নির্দেশনা দেবে। আমরা যে কাল্পনিক ব্যবসার জন্য চ্যাটবট তৈরি করছি তার নাম: জি-রেকর্ডস । জি-রেকর্ডস হল ক্যালিফোর্নিয়ায় অবস্থিত একটি রক রেকর্ড লেবেল। এই লেবেলে ৪টি রক ব্যান্ড স্বাক্ষরিত হয়েছে; অ্যালিস গুগলার , জি'স এন' রোজেস , দ্য গু ফাইটারস এবং দ্য গুগল ডলস । জি-রেকর্ডস সমস্ত রক ভক্তদের কাছে ব্যান্ড পণ্য বিক্রি করছে।
এই কোডল্যাবের শেষে, আপনি চ্যাটবট ব্যবহার করে শার্ট বা সঙ্গীত অর্ডার করতে পারেন অথবা আপনার অর্ডার সম্পর্কে জিজ্ঞাসা করতে পারেন।

তুমি কি শিখবে
আপনি ডায়ালগফ্লো ES এর তুলনায় ডায়ালগফ্লো CX এর সুবিধাগুলি শিখবেন! এতে নিম্নলিখিত ধারণাগুলি অন্তর্ভুক্ত রয়েছে:
- গুগল ক্লাউডের মধ্যে কীভাবে একটি ডায়ালগফ্লো সিএক্স ভার্চুয়াল এজেন্ট তৈরি করবেন
- কীভাবে প্রবাহ তৈরি করতে হয় তা শিখুন
- কীভাবে সত্তা তৈরি করতে হয় তা শিখুন
- কীভাবে ইন্টেন্ট তৈরি করতে হয় তা শিখুন
- স্টেট হ্যান্ডলার ব্যবহার করে কীভাবে পৃষ্ঠা তৈরি করতে হয় এবং পৃষ্ঠা পরিবর্তন করতে হয় তা শিখুন।
- ইনটেন্ট রুট ব্যবহার করে পৃষ্ঠাগুলি কীভাবে পরিবর্তন করতে হয় তা শিখুন
- প্যারামিটার এবং কন্ডিশন রুট সহ পৃষ্ঠাগুলি কীভাবে স্থানান্তর করতে হয় তা শিখুন
- সিস্টেম ফাংশন ব্যবহার করে শর্তসাপেক্ষ প্রতিক্রিয়া কীভাবে ফেরত দিতে হয় তা শিখুন।
- ফলব্যাক বার্তা কীভাবে তৈরি করবেন তা শিখুন
- সিমুলেটরটি কীভাবে ব্যবহার করবেন তা শিখুন
- টেস্ট কেস এবং টেস্ট কভারেজ কীভাবে তৈরি করবেন তা শিখুন
চূড়ান্ত ডায়ালগফ্লো সিএক্স এজেন্ট ডিজাইনটি এরকম দেখাবে:

তোমার যা লাগবে
- একটি Dialogflow CX এজেন্ট তৈরি করতে আপনার একটি Google পরিচয় / Gmail ঠিকানার প্রয়োজন হবে।
- গুগল ক্লাউডে অ্যাক্সেস।
2. পরিবেশ সেটআপ
একটি গুগল ক্লাউড প্রকল্প তৈরি করুন
যেহেতু Dialogflow CX গুগল ক্লাউডে চলে, তাই আপনাকে একটি গুগল ক্লাউড প্রকল্প তৈরি করতে হবে। একটি প্রকল্প আপনার সমস্ত গুগল ক্লাউড সংস্থানগুলিকে সংগঠিত করে। এতে সহযোগীদের একটি সেট, সক্রিয় API (এবং অন্যান্য সংস্থান), পর্যবেক্ষণ সরঞ্জাম, বিলিং তথ্য এবং প্রমাণীকরণ এবং অ্যাক্সেস নিয়ন্ত্রণ থাকে।
যখন আপনি একটি নতুন প্রকল্প তৈরি করবেন, তখন আপনাকে একটি প্রকল্পের নাম লিখতে হবে। এবং আপনাকে এটি একটি বিদ্যমান বিলিং অ্যাকাউন্ট এবং সংস্থার সাথে লিঙ্ক করতে হবে।
একটি বিলিং অ্যাকাউন্ট ব্যবহার করা হয় নির্দিষ্ট রিসোর্সের জন্য কে অর্থ প্রদান করে তা নির্ধারণ করতে এবং এটি এক বা একাধিক প্রকল্পের সাথে লিঙ্ক করা যেতে পারে। প্রকল্পের ব্যবহারের জন্য লিঙ্ক করা বিলিং অ্যাকাউন্টে চার্জ করা হয়। বেশিরভাগ ক্ষেত্রে, আপনি যখন একটি প্রকল্প তৈরি করেন তখন বিলিং কনফিগার করেন। আরও তথ্যের জন্য, বিলিং ডকুমেন্টেশন দেখুন। নিশ্চিত করুন যে আপনার ক্লাউড প্রকল্পের জন্য বিলিং সক্ষম করা আছে।

Dialogflow API সক্ষম করুন
Dialogflow ব্যবহার করার জন্য, আপনার প্রকল্পের জন্য Dialogflow API সক্ষম করতে হবে।
- আপনি যে প্রকল্পের জন্য API সক্ষম করতে চান তা নির্বাচন করুন এবং Continue এ ক্লিক করুন।
- APIs & Services এর মেনুটি সঙ্কুচিত করুন এবং Create Credentials এ ক্লিক করুন।
- অ্যাপ্লিকেশন ডেটাতে ক্লিক করুন
- না বলুন, আমি এগুলো ব্যবহার করছি না কারণ আপনি আপাতত কুবেরনেটস ইঞ্জিন, অ্যাপ ইঞ্জিন বা ক্লাউড ফাংশন ব্যবহার করছেন না।
- সম্পন্ন ক্লিক করুন

একটি নতুন Dialogflow CX এজেন্ট তৈরি করুন
একটি নতুন Dialogflow CX এজেন্ট তৈরি করতে, প্রথমে Dialogflow CX কনসোলটি খুলুন:
- পূর্বে তৈরি করা গুগল ক্লাউড প্রকল্পটি বেছে নিন।
- এজেন্ট তৈরি করুন ক্লিক করুন।
এজেন্টের মৌলিক সেটিংসের জন্য ফর্মটি পূরণ করুন:
- আপনি যেকোনো প্রদর্শন নাম বেছে নিতে পারেন।
- অবস্থান হিসেবে বেছে নিন: us-central1
- আপনার পছন্দের সময় অঞ্চল নির্বাচন করুন।
- ডিফল্ট ভাষা হিসেবে en - ইংরেজি নির্বাচন করুন।
তৈরি করুন ক্লিক করুন।

ঠিক আছে, আমরা সব প্রস্তুত। অবশেষে আমরা আমাদের ভার্চুয়াল এজেন্টের মডেলিং শুরু করতে পারি।
3. প্রবাহ
জটিল সংলাপে প্রায়শই একাধিক কথোপকথনের বিষয় থাকে। জি-রেকর্ডসের জন্য আমরা যে চ্যাটবট তৈরি করছি, ব্যান্ড পণ্য বিক্রির জন্য, তার ক্ষেত্রে আমাদের পণ্যের ক্যাটালগ, অর্থপ্রদান, অর্ডারের অবস্থা এবং গ্রাহক সেবা সংক্রান্ত প্রশ্নাবলী সম্পর্কে সংলাপ থাকবে। আমরা এই কথোপকথনের বিষয়গুলিকে প্রবাহে ভাগ করতে পারি।

প্রবাহগুলি দলগুলিকে পৃথক কথোপকথনের পথে কাজ করার সুযোগ দেয়। একটি ভাল অভ্যাস হল প্রবাহটিকে সহজ করা, যাতে এটি স্ক্রিনে সহজেই ফিট হয় এবং এটি আরও মডুলার হয়।
Dialogflow CX-এর জন্য Flows হল একটি নতুন ধারণা। Dialogflow Essentials-এর Mega Agents ধারণাটি আছে, যা Flows-এর মতোই। তবে, আপনি Flows আরও বেশি ব্যবহার করবেন।
এই ল্যাবে পরবর্তীতে, আমরা স্টেট হ্যান্ডলার ব্যবহার করব যা একটি ফ্লো শেষ করতে পারে (যাতে এটি পরবর্তী বা পূর্ববর্তী ফ্লোতে ফিরে যাবে), অথবা আপনি সম্পূর্ণ এজেন্ট সেশনটি শেষ করতে পারেন।
চলো, কিছু প্রবাহ তৈরি করি।
প্রবাহ তৈরি করা
- Dialogflow CX- এ, + আইকন > Create flow- এ ক্লিক করুন।
- নামটি উল্লেখ করুন:
Catalogএবং এন্টার টিপুন।

আপনার প্রথম ফ্লো ক্যাটালগ তৈরি করা হয়েছে। এখন অন্যান্য ফ্লো তৈরি করুন:
-
Order Process -
My Order -
Customer Care

এই ল্যাবে পরবর্তীতে আমরা পেজ স্টেট হ্যান্ডলার সেট করব, এটি নিশ্চিত করবে যে অবশেষে ভিজ্যুয়ালাইজেশনটি এইরকম দেখাবে:

সিমুলেটর
Dialogflow CX Console এর ডান দিকে আপনি বিল্ট-ইন সিমুলেটর ব্যবহার করে ভার্চুয়াল এজেন্ট পরীক্ষা করতে পারেন। আপনি কথোপকথনের শুরু থেকে অথবা একটি নির্দিষ্ট প্রবাহ থেকে কথোপকথন পরীক্ষা করতে পারেন।
- আপনার স্ক্রিনের উপরের ডানদিকে টেস্ট এজেন্ট বোতামে ক্লিক করুন।
- "টক টু এজেন্ট" ক্ষেত্রে লিখুন:
Helloভার্চুয়াল এজেন্ট একটি ডিফল্ট স্বাগত বার্তার মাধ্যমে প্রতিক্রিয়া জানাবে: "শুভেচ্ছা! আমি কীভাবে সাহায্য করতে পারি?"

এই ডিফল্ট স্বাগত টেক্সটটি পরিবর্তন করা যাক।
ডিফল্ট স্টার্ট ফ্লো
চলুন শুরু করি একটি ইন্টেন্ট রুট তৈরি করে যা ভার্চুয়াল এজেন্টকে স্বাগত জানানোর সাথে সাথেই ট্রিগার হবে।
- বাম দিকের Build > Flows সাইডবারে, Default Start Flow এ ক্লিক করুন এবং Start tree নোড নির্বাচন করুন।
এটি স্টার্ট পৃষ্ঠাটি খুলবে। এটি স্বয়ংক্রিয়ভাবে বিল্ড > পেজ সাইডবার বিভাগে স্টার্ট পৃষ্ঠাটি নির্বাচন করবে।
- Start > Routes- এ Default Welcome Intent- এ ক্লিক করুন।
একটি ইনটেন্ট একজন ব্যবহারকারীর কথোপকথনের একটি পালায়ের অভিপ্রায়কে শ্রেণীবদ্ধ করে। Dialogflow CX-তে, পরবর্তী সক্রিয় পৃষ্ঠা বা পরিপূর্ণতা রুট করার জন্য ইনটেন্টগুলি একটি স্টেট হ্যান্ডলারের অংশ হতে পারে।
- এজেন্টের সকল এন্ট্রি মুছে ফেলুন এবং এই নতুন লেখাটি যোগ করুন:
Welcome, I am the virtual agent of G-Records, a fictional rock label. You can order artists merchandise, ask questions about your order or shipping, and I can tell you more which artists are currently signed with us. How can I help?
কথোপকথনকে সহজতর করার জন্য, আমাদের কিছু দ্রুত উত্তর বোতাম / পরামর্শ চিপগুলিরও প্রয়োজন হবে।
- Add dialogue option > Custom payload এ ক্লিক করুন এবং নিচের কোড স্নিপেটটি ব্যবহার করুন।
- নিচের কোড স্নিপেটটি কাস্টম পেলোড হিসেবে ব্যবহার করুন এবং Save টিপুন।
কাস্টম পেলোড সম্পর্কে আরও জানতে ডকুমেন্টেশনটি দেখুন।
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Which artists?"
},
{
"text": "Which products?"
},
{
"text": "About my order..."
}
]
}
]
]
}

- সিমুলেটরে স্বাগতম অভিপ্রায় পরীক্ষা করে দেখুন।
তুমি হয়তো ভাবছো কেন তুমি কোন সমৃদ্ধ কন্টেন্ট দেখতে পাচ্ছ না। এর কারণ হল সাজেশন চিপের মতো সমৃদ্ধ কন্টেন্ট একটি ইন্টিগ্রেশনের উপর নির্ভরশীল। নিম্নলিখিত ধাপগুলির জন্য একটি বিলিং অ্যাকাউন্ট প্রয়োজন, কিন্তু যদি তোমার কাছে একটি না থাকে তাহলে তুমি সেগুলো এড়িয়ে যেতে পারো।
- বাম সাইডবারে, Manage > Integrations এ ক্লিক করুন।
- Dialogflow Messenger নির্বাচন করুন এবং Connect এ ক্লিক করুন।
- পপআপে Enable এ ক্লিক করুন।

আরেকটি পপআপ দেখানো হবে, এবার ইন্টিগ্রেশন জাভাস্ক্রিপ্ট কোড সহ যা আপনি আপনার ওয়েবসাইটে ডায়ালগফ্লো মেসেঞ্জার কম্পোনেন্ট ইন্টিগ্রেট করার জন্য পেস্ট করতে পারেন। যেহেতু আমাদের এখনও কোনও ওয়েবসাইট নেই, তাই আমরা সরাসরি টুলে ভার্চুয়াল এজেন্ট পরীক্ষা করব।

- "এখন চেষ্টা করুন " লিঙ্কে ক্লিক করুন।
- চ্যাট উইন্ডো খুলতে নীচের ডানদিকের চ্যাটবট আইকনে ক্লিক করুন। কথোপকথন শুরু করতে
Helloলিখুন।

আপাতত, যখন আপনি সাজেশন চিপগুলিতে ক্লিক করবেন, তখন ভার্চুয়াল এজেন্ট আপনার কথা বুঝতে পারবে না। কারণ আমাদের ভার্চুয়াল এজেন্ট এখনও বিভিন্ন রাজ্যের মধ্যে স্যুইচ করছে না। আমরা এটি Dialogflow CX with Pages এ করতে পারি। চলুন ল্যাব চালিয়ে যাই, আমরা প্রথমে কিছু Entities এবং Intents তৈরি করব।
৪. সত্তার ধরণ
এন্ড-ইউজার ইনপুট থেকে ডেটা কীভাবে বের করা হয় তা নিয়ন্ত্রণ করতে এন্টিটি টাইপ ব্যবহার করা হয়। ডায়ালগফ্লো সিএক্স এন্টিটি টাইপগুলি ডায়ালগফ্লো ইএস এন্টিটি টাইপের সাথে খুব মিল। ডায়ালগফ্লো পূর্বনির্ধারিত সিস্টেম এন্টিটি সরবরাহ করে যা অনেক সাধারণ ধরণের ডেটা মেলাতে পারে। উদাহরণস্বরূপ, তারিখ, সময়, রঙ, ইমেল ঠিকানা ইত্যাদি মেলানোর জন্য সিস্টেম এন্টিটি রয়েছে। কাস্টম ডেটা মেলানোর জন্য আপনি নিজস্ব কাস্টম এন্টিটিও তৈরি করতে পারেন।
চলুন শুরু করা যাক, একটি ফ্লোতে পৃষ্ঠাগুলি ডিজাইন করার আগে সমস্ত কাস্টম এন্টিটি প্রস্তুত করে। আমরা নিম্নলিখিত এন্টিটি তৈরি করব:

সত্তা তৈরি করা
আসুন একটি শিল্পী সত্তা তৈরি করি।
- Manage > Entity Types-এ ক্লিক করুন।
- + তৈরি করুন ক্লিক করুন
- প্রদর্শনের নাম:
Artist - সত্তা:
-
The Google Dolls(সমার্থক শব্দ:Google Dolls) -
The Goo Fighters(সমার্থক শব্দ:Goo Fighters) -
G's N' Roses(সমার্থক শব্দ:Gs and Roses) -
Alice Googler - Advanced options-এ ক্লিক করুন এবং Fuzzy Matching চেক করুন। (যদি আপনি ব্যান্ডের নাম ভুল বানান করেন, তবুও এটি সঠিক সত্তার সাথে মিলে যেতে পারে।)
- অ্যাডভান্সড অপশনে লগ ইন রিড্যাক্ট চেক করুন। (যদি আপনি ব্যান্ডের নাম ভুল বানান করেন, তাহলে এটি লগে নামটি সংশোধন করবে।)
- সংরক্ষণ করুন ক্লিক করুন
মার্চেন্ড আইটেমের জন্য আমাদের একটি সত্তারও প্রয়োজন হবে:
- Manage > Entity Types-এ ক্লিক করুন।
- + তৈরি করুন ক্লিক করুন
- প্রদর্শনের নাম:
Merch - সত্তা:
-
T-shirt -
Longsleeve(সমার্থক শব্দ:Longsleeve shirt) -
Tour Movie -
Digital Album(সমার্থক শব্দ:MP3 Album,MP3) -
CD(সমার্থক শব্দDisc,Physical CD)
- সংরক্ষণ করুন ক্লিক করুন
অ্যালবামের জন্য আমাদের একটি সত্তারও প্রয়োজন হবে:
- Manage > Entity Types-এ ক্লিক করুন।
- + তৈরি করুন ক্লিক করুন
- প্রদর্শনের নাম:
Album - সত্তা:
-
Live -
Greatest Hits(সমার্থক শব্দ:Hits)
- সংরক্ষণ করুন ক্লিক করুন
পোশাকের আকারের জন্য আমাদের একটি সত্তারও প্রয়োজন হবে:
- Manage > Entity Types-এ ক্লিক করুন।
- + তৈরি করুন ক্লিক করুন
- প্রদর্শনের নাম:
ShirtSize - সত্তা:
-
XS(সমার্থক শব্দ:Extra Small) -
S(সমার্থক শব্দ:Small) -
M(সমার্থক শব্দ:Medium) -
L(সমার্থক শব্দ:Large) -
XL(সমার্থক শব্দ:Extra Large) -
2XL(সমার্থক শব্দ:Extra Extra Large) -
3XL
- সংরক্ষণ করুন ক্লিক করুন
এবং অর্ডার নম্বরের জন্য একটি সত্তা, যা সাধারণত 4টি বর্ণানুক্রমিক এবং 3টি সংখ্যার হয়। (যেমন ABCD123)
- Manage > Entity Types-এ ক্লিক করুন।
- + তৈরি করুন ক্লিক করুন
- প্রদর্শনের নাম:
OrderNumber - Regexp সত্তা
- সত্তা: [AZ]{4}[0-9]{3}
- সংরক্ষণ করুন ক্লিক করুন
আপনার সত্তা কনফিগারেশনটি নিম্নলিখিতগুলির মতো দেখতে হবে:
@শিল্পী: 
@মার্চ: 
@অ্যালবাম: 
@শার্টসাইজ: 
@অর্ডার নম্বর: 
একবার, কাস্টম সত্তা প্রস্তুত হয়ে গেলে, আমরা উদ্দেশ্যগুলি প্রস্তুত করতে পারি। আসুন ল্যাব চালিয়ে যাই।
৫. উদ্দেশ্য
একটি Intent একজন ব্যবহারকারীর কথোপকথনের এক পালার জন্য উদ্দেশ্যকে শ্রেণীবদ্ধ করে। Dialogflow CX-এ এগুলিকে নাটকীয়ভাবে সরলীকৃত করা হয়েছে, এটি আর কথোপকথন নিয়ন্ত্রণের জন্য একটি বিল্ডিং ব্লক নয়। Dialogflow CX শুধুমাত্র ব্যবহারকারীদের কথার সাথে মিল রাখার জন্য ইন্টেন্ট ব্যবহার করে। Dialogflow ES-এ, আপনাকে সবকিছুকে একটি ইন্টেন্টের সাথে সংযুক্ত করতে হত (প্যারামিটার, ইভেন্ট, পরিপূর্ণতা, ইত্যাদি)। Dialogflow CX-এর ইন্টেন্টগুলিতে কেবল প্রশিক্ষণ বাক্যাংশ থাকে এবং তাই পুনরায় ব্যবহারযোগ্য। এটি আর কথোপকথন নিয়ন্ত্রণ করে না। তাই ইন্টেন্ট তৈরির প্রক্রিয়াটি সরাসরি হবে:
"ইন্টেন্ট"-এর প্রশিক্ষণ বাক্যাংশগুলি "ভেরিয়েবল" ইনপুট বের করার জন্য Entities ব্যবহার করতে পারে, এই কারণেই এটি একটি ভাল অনুশীলন, আপনার সত্তার ধরণগুলি আগে থেকেই তৈরি করা, যা আমরা ল্যাব ধাপগুলির পূর্ববর্তী পৃষ্ঠায় করেছি।
ইন্টেন্ট তৈরি করা
চলুন শুরু করা যাক পৃষ্ঠাগুলিকে একটি প্রবাহে ডিজাইন করার আগে সমস্ত উদ্দেশ্য প্রস্তুত করে।
- Manage > Intents- এ ক্লিক করুন।
- + তৈরি করুন এ ক্লিক করুন
নিম্নলিখিত বিবরণ ব্যবহার করুন:
- প্রদর্শন নাম
redirect.artists.overview - বর্ণনা
Artists overview: The bands supported by the label

নিচে স্ক্রোল করুন এবং নিম্নলিখিত প্রশিক্ষণ বাক্যাংশ তৈরি করুন:
-
Which bands are signed? -
Which bands -
Which artists -
Which artists are part of the record label -
Who is part of the label -
From which bands can I buy merchandise -
Band merchandise -
Which music do you have? -
I would like to know who are signed to the label -
Who are supported by the label -
From who can I buy shirts -
What music can I order -
Can I get an overview of all the artists

- সংরক্ষণ করুন ক্লিক করুন।
- এবার চলুন শুরু করা যাক এবং অন্যান্য সকল উদ্দেশ্য তৈরি করা যাক। আরও প্রশিক্ষণ বাক্যাংশ তৈরি করতে আপনার নিজস্ব কল্পনাশক্তি ব্যবহার করুন। একটি সর্বোত্তম অনুশীলন হল প্রতিটি উদ্দেশ্যের জন্য কমপক্ষে ১০টি প্রশিক্ষণ বাক্যাংশ থাকা, যাতে ব্যবহারকারী বিভিন্ন উপায়ে এই উদ্দেশ্যটি ট্রিগার করতে পারে। এই ল্যাবের উদ্দেশ্যে, কম থাকাও ঠিক হবে।
কয়েকটি জিনিস খুঁজতে হবে:
- মনে রাখবেন যে আপনি যখন আপনার প্রশিক্ষণ বাক্যাংশটি প্রবেশ করাবেন, তখন Dialogflow CX স্বয়ংক্রিয়ভাবে আপনার সত্তাগুলিকে টীকাবদ্ধ করবে। যদি এটি তা না করে, তাহলে আপনাকে আপনার সত্তাটি আপডেট করতে হতে পারে (একটি সমার্থক শব্দ যোগ করে) অথবা প্রশিক্ষণ বাক্যাংশটি নিজে নিজে টীকাবদ্ধ করে।
- ছোট প্রশিক্ষণ বাক্যাংশ: ডায়ালগফ্লো-এর NLU সিস্টেম ছোট প্রশিক্ষণ বাক্যাংশের সাথেও কাজ করতে পারে এবং আমরা এখানে কয়েকটি উদাহরণ প্রদান করেছি।
- অতিরিক্ত প্রশিক্ষণ: একটি অভিপ্রায়ের জন্য অনেক বেশি প্রশিক্ষণ বাক্যাংশ অতিরিক্ত প্রশিক্ষণের কারণ হতে পারে এবং ফলাফল কম পছন্দসই হতে পারে। পুনরাবৃত্তিমূলক এবং ক্রমবর্ধমান পরীক্ষা ব্যবহার করা এবং যদি কোনও অভিপ্রায়ের সাথে মিল না থাকে তবে প্রশিক্ষণ বাক্যাংশ যোগ করা সর্বোত্তম অনুশীলন।
প্রদর্শন নাম | প্রশিক্ষণ বাক্যাংশ |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
এখন যেহেতু আমাদের পুনঃব্যবহারযোগ্য উপাদানগুলি (প্রবাহ, সত্তা এবং উদ্দেশ্য) প্রস্তুত, আমরা পৃষ্ঠা এবং স্টেট হ্যান্ডলার তৈরি করে এটি একত্রিত করতে পারি।
৬. পৃষ্ঠা এবং স্টেট হ্যান্ডলার
একটি Dialogflow CX কথোপকথন (একটি অধিবেশন) একটি সসীম অবস্থা মেশিন হিসাবে বর্ণনা এবং কল্পনা করা যেতে পারে। একটি ভেন্ডিং মেশিনের উদাহরণ নিন, এটি একটি সসীম অবস্থা মেশিন হিসাবে মডেল করা যেতে পারে। এর নিম্নলিখিত অবস্থা রয়েছে: কয়েনের জন্য অপেক্ষা করা, ক্যান্ডি নির্বাচন করা, ক্যান্ডি দেওয়া এবং ইনপুটগুলির একটি সেট দেওয়া হলে, এটি এই অবস্থাগুলির মধ্যে চলে। উদাহরণস্বরূপ, একটি মুদ্রা ঢোকানো ভেন্ডিং মেশিনকে কয়েনের জন্য অপেক্ষা করা থেকে সিলেক্ট ক্যান্ডিতে নিয়ে যায়। পৃষ্ঠাগুলি হল কিভাবে আমরা একটি Dialogflow CX ভার্চুয়াল এজেন্টের জন্য এই অবস্থাগুলিকে মডেল করতে পারি।
একজন শেষ ব্যবহারকারী যখন কথোপকথনে Dialogflow CX-এর সাথে ইন্টারঅ্যাক্ট করেন, তখন কথোপকথনটি এক পৃষ্ঠা থেকে অন্য পৃষ্ঠায় চলে যায়, তাই যেকোনো মুহূর্তে, ঠিক একটি পৃষ্ঠা বর্তমান পৃষ্ঠা হিসাবে বিবেচিত হয়, বর্তমান পৃষ্ঠাটি সক্রিয় বলে বিবেচিত হয় এবং সেই পৃষ্ঠার সাথে সম্পর্কিত প্রবাহটিও সক্রিয় বলে বিবেচিত হয়।
প্রতিটি Flow এর জন্য, আপনি অনেকগুলি পৃষ্ঠা সংজ্ঞায়িত করেন, যেখানে আপনার সম্মিলিত পৃষ্ঠাগুলি সেই বিষয়(গুলি) সম্পর্কে সম্পূর্ণ কথোপকথন পরিচালনা করতে পারে যার জন্য প্রবাহটি ডিজাইন করা হয়েছে। প্রতিটি প্রবাহের একটি বিশেষ সূচনা পৃষ্ঠা থাকে। যখন একটি প্রবাহ প্রাথমিকভাবে সক্রিয় হয়, তখন সূচনা পৃষ্ঠাটি বর্তমান পৃষ্ঠায় পরিণত হয়। প্রতিটি কথোপকথনের জন্য, বর্তমান পৃষ্ঠাটি হয় একই থাকবে অথবা অন্য পৃষ্ঠায় স্থানান্তরিত হবে। এই ধারণাটি আপনাকে অনেক পৃষ্ঠা এবং একাধিক কথোপকথনের পালা সহ বৃহত্তর এজেন্ট তৈরি করতে অনুমতি দেবে।
পৃষ্ঠাগুলিতে পরিপূর্ণতা (স্ট্যাটিক এন্ট্রি ডায়ালগ এবং/অথবা ওয়েবহুক), প্যারামিটার এবং স্টেট হ্যান্ডলার থাকে। কথোপকথন নিয়ন্ত্রণ স্টেট হ্যান্ডলারের মাধ্যমে ঘটে, যা আপনাকে অন্য ডায়ালগফ্লো CX পৃষ্ঠায় স্থানান্তরের জন্য বিভিন্ন ট্রানজিশন রুট তৈরি করতে দেয়, যার মধ্যে এটিকে শর্তসাপেক্ষ (কথোপকথনের শাখা তৈরির জন্য) করা অন্তর্ভুক্ত।
তিনটি ভিন্ন ধরণের রুট সহ পৃষ্ঠাগুলির মধ্যে রূপান্তর পরিচালনা করে একটি কথোপকথনের অবস্থা নিয়ন্ত্রণ করা হয়:
- ইন্টেন্ট রুট : কখন একটি ইন্টেন্ট মেলানো উচিত (যেমন, ব্যবহারকারীর বক্তব্যের উপর ভিত্তি করে পৃষ্ঠা পরিবর্তন করা)। (ভিজ্যুয়াল ডায়াগ্রামে নীল রেখা।)
- কন্ডিশন রুট : কখন কোন কন্ডিশন পরীক্ষা করা উচিত (যেমন সেশনে সংরক্ষিত নির্দিষ্ট প্যারামিটারের উপর ভিত্তি করে পৃষ্ঠা পরিবর্তন করা) (ভিজ্যুয়াল ডায়াগ্রামে কমলা রেখা।)
- ইভেন্ট হ্যান্ডলার : যখন একটি নির্দিষ্ট ফলব্যাক ইভেন্ট পরিচালনা করা উচিত (যেমন কোনও ইনপুট, কোনও মিল না থাকা, শেষ ব্যবহারকারীকে একটি অভিপ্রায় বা শর্তের রুটের সাথে দ্ব্যর্থতা নিরসন করার জন্য) (ভিজ্যুয়াল ডায়াগ্রামে সবুজ রেখা।)
কথোপকথনের উচ্চারণ (অর্থাৎ ব্যবহারকারীর কাছে পাঠানো বিষয়বস্তু বা প্রতিক্রিয়া) পরিপূর্ণতা দ্বারা সংজ্ঞায়িত করা হয়, যা স্থির বা গতিশীল হতে পারে:
- স্ট্যাটিক পরিপূর্ণতা : যখন একটি স্ট্যাটিক পরিপূর্ণতা প্রতিক্রিয়া প্রদান করা হয়
- গতিশীল পরিপূর্ণতা : যখন গতিশীল প্রতিক্রিয়ার জন্য একটি পরিপূর্ণতা ওয়েবহুক ডাকা হয়
আমাদের রিটেইল বটের জন্য, আমরা কিছু ইন্টেন্ট রুট তৈরি করব এবং কিছু স্ট্যাটিক এন্ট্রি পূরণের প্রতিক্রিয়া প্রদান করব, যা কোনও পৃষ্ঠা সক্রিয় হওয়ার সাথে সাথে ব্যবহারকারীর কাছে উপস্থাপন করা হবে। পরবর্তীতে, আমরা একটি পণ্যদ্রব্য অর্ডার করার জন্য প্রয়োজনীয় তথ্য সংগ্রহ করার জন্য কন্ডিশন রুট সহ প্যারামিটার তৈরি করব।
পৃষ্ঠার অভিপ্রায় রুট
ডিফল্ট স্টার্ট ফ্লোতে পৃষ্ঠা তৈরি করা
ডিফল্ট স্টার্ট ফ্লোর একটি ফ্লো চার্ট এখানে দেওয়া হল:

আসুন একসাথে এটিতে ক্লিক করি:
- বিল্ড > ডিফল্ট স্টার্ট ফ্লো ক্লিক করুন
- শুরু পৃষ্ঠায় ক্লিক করুন
- রুটস এর পাশে + আইকনে ক্লিক করুন।
- redirect.artists.overview যোগ করুন
- Transition এ স্ক্রোল করে ক্যাটালগ ফ্লোতে যান।
- সংরক্ষণ করুন টিপুন
-
redirect.product.overviewএবং এই টেবিলের বাকি ১১টি সারির জন্য উপরের ধাপগুলি পুনরাবৃত্তি করুন:
পৃষ্ঠা (প্রবাহিত) | রুট > উদ্দেশ্য | রুট > ট্রানজিশন টু |
শুরু করুন | | - |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: ক্যাটালগ |
শুরু করুন | | প্রবাহ: গ্রাহক সেবা |
শুরু করুন | | প্রবাহ: গ্রাহক সেবা |
শুরু করুন | | প্রবাহ: গ্রাহক সেবা |
শুরু করুন | | প্রবাহ: আমার আদেশ |
শুরু করুন | | প্রবাহ: আমার আদেশ |
শুরু করুন | | প্রবাহ: আমার আদেশ |
শুরু করুন | | পৃষ্ঠা: অধিবেশন শেষ করুন |

কল সেন্টারে কল করার সময় ডিফল্ট স্টার্ট ফ্লো অপশন মেনুর মতো কাজ করবে। তবে, এই ভার্চুয়াল এজেন্টে এটি প্রাকৃতিক ভাষা দিয়ে প্রশিক্ষিত হয়, প্রশিক্ষণ বাক্যাংশগুলিকে উদ্দেশ্যের মধ্যে রাখা হয়। অতএব, মিথস্ক্রিয়াটি কথোপকথনের মাধ্যমে পরিচালিত হয়, DTMF বিকল্পগুলির দ্বারা নয় এবং এটি আরও স্বাভাবিক এবং মানুষের মতো।

ক্যাটালগ ফ্লোতে পৃষ্ঠাগুলি তৈরি করা
নিম্নলিখিত চ্যাট ট্রান্সক্রিপ্টটি ক্যাটালগ ফ্লো-এর অন্তর্গত:
> "Hi"
"Welcome, I am the virtual agent of G-Records, a fictional rock label.
You can order artists merchandise, ask questions about your order or shipping,
and I can tell you more which artists are currently signed with us. How can I help?"
> "Which bands are signed with this record label?"
"The following bands are signed with G-Records:
Alice Googler, G's N' Roses, The Goo Fighters and The Google Dolls.
From which of these artists would you like to order merchandise?"
> "Alice Googler"
"You want to rock with Alice Googler merchandise. Awesome!
We sell shirts, music or the tour movie.
Which merchandise item do you want?"
"(Suggestion chips: [Shirts] [Music] [Tour Movie])"
> "I would like to buy a Shirt"
"Do you want a longsleeve or a t-shirt?"
"(Suggestion chips: [T-shirt, Longsleeve, Price?])"
> "What's the price difference?"
"A t-shirt costs $25 and a longsleeve costs $30.
Do you want a longsleeve or a t-shirt?"
> "A t-shirt",
"What shirt size do you want?"
"(Suggestion chips: [XS, S, M, L, XL, 2XL, 3XL])"
> "M"
"A T-shirt of Alice Googler size: M costs $25. Shall I continue to order?"
যখন আপনি সঙ্গীত বা ভ্রমণ চলচ্চিত্র নির্বাচন করবেন তখন সংলাপটি ভিন্ন হবে: সঙ্গীতের জন্য সংলাপটি এইরকম দেখাবে:
> "Music"
"We have a Greatest Hits Album or the Live Album. Which one do you want?"
"(Suggestion chips: [Greatest Hits, Live, Price?])"
> "The Live Album"
"Do you want this album on CD or MP3?"
"(Suggestion chips: [CD, MP3])"
> "What's the price difference?"
"A CD costs $15. The digital album on MP3 costs $10.
Do you want this album on CD or MP3?"
> "Digital Album",
"The Digital Album: Alice Googler - Live costs $10. Shall I continue to order?"
ট্যুর মুভির জন্য সংলাপটি এরকম দেখাবে:
> "Tour Movie"
"The Tour Movie of G's N' Roses costs $25. Shall I continue to order?
ক্যাটালগ ফ্লো-এর মধ্যে থাকা সমস্ত পৃষ্ঠার একটি ফ্লো চার্ট এখানে দেওয়া হল:

এই প্রবাহের জটিলতা লক্ষ্য করুন:
- আমি "কোন শিল্পীদের" প্রশ্নটি এড়িয়ে যেতে পারি এবং সাথে সাথে "কোন পণ্যদ্রব্য পাওয়া যায়" জিজ্ঞাসা করতে পারি।
- ডিফল্ট স্টার্ট ফ্লো থেকে, আমি জিজ্ঞাসা করতে পারি: "আমি গুগল ডলস টি-শার্ট কিনতে চাই", অথবা "আমি কিছু কিনতে চাই"। যার অর্থ ভার্চুয়াল এজেন্ট এই প্রয়োজনীয় প্যারামিটারগুলির জন্য স্লটগুলি পূরণ করার জন্য ফলো-আপ প্রশ্ন জিজ্ঞাসা করবে। এটি সরাসরি পণ্য পৃষ্ঠায় চলে যাবে।
- মূল্য সংলাপটি মূল্য পৃষ্ঠা থেকে আসে যা পুনরায় ব্যবহার করা হবে।
- যদিও ট্যুর মুভির সংলাপটি সবচেয়ে সহজ সংলাপের মতো মনে হচ্ছে, আমরা আসলে এটি দিয়ে বিশেষ কিছু করব। আমরা সংলাপের এই অংশটি পুনরায় ব্যবহার করব, যাতে ব্যবহারকারীরা অন্য কোনও পণ্যের জন্য এটি সরাসরি প্রবেশ করতে পারেন, যদি তারা একবারে সমস্ত তথ্য বিশেষায়িত করে:
> "I want The Goo Fighters longsleeve size S."
"The longsleeve of The Goo Fighters size S costs $30. Shall I continue to order?"
প্রথমে পৃষ্ঠাগুলি সংযুক্ত করে শুরু করা যাক।
- বিল্ড > ক্যাটালগ ক্লিক করুন
- শুরু পৃষ্ঠায় ক্লিক করুন
- রুটস এর পাশে + আইকনে ক্লিক করুন।
- redirect.artists.overview যোগ করুন
- Transition এ স্ক্রোল করে Page নির্বাচন করুন এবং নির্বাচন করুন: + new Page
- পৃষ্ঠার নাম ব্যবহার করুন:
Artist Overviewএবং সংরক্ষণ করুন এ ক্লিক করুন।
এবার বাকি ফ্লো শেষ করা যাক:
- পূর্ববর্তী ধাপগুলি নিম্নলিখিত পৃষ্ঠাগুলি, উদ্দেশ্য এবং পরিপূর্ণতাগুলির সাথে পুনরাবৃত্তি করা যেতে পারে। এই টেবিলটি দখল করুন। পৃষ্ঠা , হল সেই পৃষ্ঠা যা আপনি প্রবাহে নির্বাচন করবেন, রুট > ট্রানজিশন টু হল সেই নতুন প্রবাহ বা পৃষ্ঠা যা আপনি তৈরি করবেন এবং স্থানান্তর করবেন।
পৃষ্ঠা (প্রবাহিত) | রুট > উদ্দেশ্য | রুট > ট্রানজিশন টু |
ক্যাটালগ শুরু | | শিল্পীর সংক্ষিপ্ত বিবরণ |
ক্যাটালগ শুরু | | পণ্য |
ক্যাটালগ শুরু | | পণ্যের সংক্ষিপ্ত বিবরণ |
ক্যাটালগ শুরু | | পণ্যের সংক্ষিপ্ত বিবরণ |
ক্যাটালগ শুরু | | শার্ট |
ক্যাটালগ শুরু | | সঙ্গীত |
ক্যাটালগ শুরু | | অধিবেশন শেষ করুন |
ক্যাটালগ শুরু | | শেষ প্রবাহ |
শিল্পীর সংক্ষিপ্ত বিবরণ | | পণ্যের সংক্ষিপ্ত বিবরণ |
এখন চলুন শুরু করা যাক এবং আরও স্ট্যাটিক পরিপূর্ণতা যোগ করা যাক।
- ক্যাটালগ ফ্লোতে, শিল্পীর ওভারভিউ পৃষ্ঠায় ক্লিক করুন।
- এন্ট্রি পূরণ বিভাগে পূর্ণতা সম্পাদনা করুন ক্লিক করুন।
- নিম্নলিখিত স্ট্যাটিক পরিপূর্ণতা ব্যবহার করুন ( এজেন্ট বলেছেন ):
-
The following bands are signed with G-Records: Alice Googler, G's N' Roses, The Goo Fighters and The Google Dolls.
- সংরক্ষণ করুন ক্লিক করুন
- ক্যাটালগ প্রবাহে, পণ্যের সংক্ষিপ্ত বিবরণ পৃষ্ঠায় ক্লিক করুন।
- এন্ট্রি পূরণ বিভাগে পূর্ণতা সম্পাদনা করুন ক্লিক করুন।
- নিম্নলিখিত স্ট্যাটিক পরিপূর্ণতা ব্যবহার করুন ( এজেন্ট বলেছেন ):
-
We sell shirts, music or the tour movie.
- সংরক্ষণ করুন টিপুন।
পৃষ্ঠার পরামিতি
প্যারামিটারগুলি একটি সেশনের সময় ব্যবহারকারীর দ্বারা সরবরাহ করা মানগুলি ক্যাপচার এবং রেফারেন্স করার জন্য ব্যবহৃত হয়। প্রতিটি প্যারামিটারের একটি নাম এবং একটি সত্তার ধরণ থাকে। @Artist এবং @Merch হল সর্বনিম্ন প্যারামিটার যা আমাদের একটি পণ্যদ্রব্য অর্ডার করার জন্য সংগ্রহ করতে হয়। টি-শার্ট বা লংস্লিভের জন্য, আপনাকে @ShirtSize ও সংগ্রহ করতে হবে এবং যদি আপনি সঙ্গীত অর্ডার করতে চান, তাহলে আপনার একটি @Carrier এবং @Album নামও প্রয়োজন হবে।
এই প্যারামিটারগুলিকে প্রয়োজনীয় হিসেবে চিহ্নিত করতে হবে। এবং একবার প্রয়োজনীয় হয়ে গেলে, আপনার ব্যবহারকারীকে মনে রাখার জন্য কাস্টম প্রম্পট প্রদান করতে হবে, যাতে সঠিক উত্তর প্রদান করা যায় যাতে এই প্যারামিটারগুলি সংগ্রহ করা যায়। Dialogflow CX-এ কিছু মেকানিজম আছে যা আপনাকে এতে সাহায্য করতে পারে।
উদাহরণস্বরূপ, আপনি প্যারামিটার বিভাগে কাস্টম স্ট্যাটিক পরিপূর্ণতা বার্তা প্রদান করতে পারেন। যদি প্যারামিটারটি প্রয়োজন হয়, তাহলে এই প্যারামিটার পরিপূর্ণতাগুলি দেখানো হবে। এই প্রতিক্রিয়া বার্তাগুলি প্রতিক্রিয়া সারিতে যোগ করা হবে। একজন এজেন্টের পালা চলাকালীন, একাধিক পরিপূর্ণতা কল করা সম্ভব (এবং কখনও কখনও পছন্দসই), যার প্রতিটি একটি প্রতিক্রিয়া বার্তা তৈরি করতে পারে। Dialogflow এই প্রতিক্রিয়াগুলিকে একটি প্রতিক্রিয়া সারিতে বজায় রাখে। পৃষ্ঠার জীবনচক্র এবং এই পরিপূর্ণতাগুলি প্রতিক্রিয়া সারিতে কীভাবে যোগ করা হবে সে সম্পর্কে আরও জানতে, Dialogflow CX Page Docs পড়ুন।
শিল্পীর ওভারভিউ পৃষ্ঠায় প্যারামিটার তৈরি করা
কিছু পৃষ্ঠার প্যারামিটার সংজ্ঞায়িত করা যাক:
- ক্যাটালগ ফ্লোতে, শিল্পীর ওভারভিউ পৃষ্ঠায় ক্লিক করুন।
- প্যারামিটার ব্লকে + ক্লিক করুন। শিল্পী প্যারামিটার যোগ করুন:
- প্রদর্শনের নাম:
artist - সত্তার ধরণ:
@Artist - প্রয়োজনীয়: চেক করুন
- লগে সম্পাদনা করুন: চেক করুন
- এখন আমরা কিছু কাস্টম প্যারামিটার পূরণের বার্তা যোগ করব। যদি ভার্চুয়াল এজেন্ট এখনও শিল্পী প্যারামিটার সংগ্রহ না করে থাকে, তাহলে শেষ ব্যবহারকারী এই এজেন্ট প্রতিক্রিয়াটি প্রতিক্রিয়া সারিতে যুক্ত করবেন:
From which of these artists would you like to order merchandise?
- একটি দ্বিতীয় ডায়ালগ বিকল্প যোগ করুন যা সমৃদ্ধ পরামর্শ চিপ প্রদান করে। ডায়ালগ যোগ করুন বিকল্পে ক্লিক করুন এবং এই কোডটি ব্যবহার করুন ( JSON তে):
{
"richContent": [
[
{
"options": [
{
"text": "The Google Dolls"
},
{
"text": "The Goo Fighters"
},
{
"text": "Alice Googler"
},
{
"text": "G's N' Roses"
}
],
"type": "chips"
}
]
]
}
আপনার ব্যবহারকারী কতবার উত্তর দেওয়ার চেষ্টা করেছেন তার উপর ভিত্তি করে বিভিন্ন ফলব্যাক পূরণ প্রম্পট পরিচালনা করা সম্ভব। আপনি প্যারামিটার ইভেন্ট হ্যান্ডলার দিয়ে এটি করতে পারেন। বিভিন্ন বিল্ট-ইন ইভেন্ট হ্যান্ডলার থেকে বেছে নেওয়ার জন্য রয়েছে যেমন Invalid Parameters , Utterances too long , No input , No input 1st try , 2nd try , অথবা No Match । no input এবং no match এর মধ্যে পার্থক্য হল, কোন ইনপুট ছাড়াই একজন ব্যবহারকারী কখনও উত্তর প্রদান করেননি, যেখানে কোন মিল ছাড়াই, ব্যবহারকারী একটি উত্তর প্রদান করেছিলেন কিন্তু Dialogflow CX এটিকে একটি পৃষ্ঠার সাথে মেলাতে পারেনি।
- Reprompt ইভেন্ট হ্যান্ডলার বিভাগে স্ক্রোল করুন।
- ইভেন্ট হ্যান্ডলার যোগ করুন ক্লিক করুন এবং ইভেন্টটি নির্বাচন করুন:
No-match default - নিম্নলিখিত ইভেন্ট স্ট্যাটিক টেক্সট পরিপূর্ণতা ব্যবহার করুন:
I missed that. Please, specify the artist. You can choose between: Alice Googler, G's N' Roses, The Google Dolls or The Goo Fighters. Which artist do you want to buy merchandise from?
- সংরক্ষণ করুন ক্লিক করুন
- ইভেন্ট হ্যান্ডলার যোগ করুন ক্লিক করুন এবং ইভেন্টটি নির্বাচন করুন:
No-input default - নিম্নলিখিত ইভেন্ট স্ট্যাটিক টেক্সট পরিপূর্ণতা ব্যবহার করুন:
I am sorry, I could understand the artist's name. You can choose between Alice Googler, G's N' Roses, The Google Dolls or The Goo Fighters. Which artist do you want to buy merchandise from?
- সংরক্ষণ করুন ক্লিক করুন
পৃষ্ঠার অবস্থা রুট
প্যারামিটারগুলি Page Conditional Routes এর সাথে একত্রে খুবই শক্তিশালী। যখন একটি শর্ত true হিসাবে মূল্যায়ন করা হয়, তখন সংশ্লিষ্ট পৃষ্ঠা রুটটি বলা হবে। একটি শর্ত হতে পারে, A parameter equals a specific value , অথবা A parameter can't be missing , অথবা A form that has been completed , এবং আরও অনেক কিছু। আপনি Dialogflow CX ডকুমেন্টেশনে Parameters and Conditions সম্পর্কে আরও তথ্য পেতে পারেন।
আমাদের খুচরা ভার্চুয়াল এজেন্টের জন্য, আমাদের প্যারামিটারের একটি ক্রম সংগ্রহ করতে হবে, তাই আমাদের একটি শর্ত তৈরি করতে হবে, যাতে একটি 'ফর্ম' পূরণ করা হয়েছে কিনা তা পরীক্ষা করা যায়। একটি ফর্ম হল প্যারামিটারের একটি তালিকা যা পৃষ্ঠার জন্য শেষ ব্যবহারকারীর কাছ থেকে সংগ্রহ করা উচিত। ভার্চুয়াল এজেন্ট একাধিক কথোপকথনের জন্য শেষ ব্যবহারকারীর সাথে যোগাযোগ করে, যতক্ষণ না এটি প্রয়োজনীয় সমস্ত ফর্ম প্যারামিটার সংগ্রহ করে, যা পৃষ্ঠা প্যারামিটার নামেও পরিচিত।
ফর্ম পূরণের সময় ডায়ালগফ্লো সিএক্স স্বয়ংক্রিয়ভাবে ব্যবহারকারীর দ্বারা প্রদত্ত প্যারামিটার মান সেট করে। বর্তমান পৃষ্ঠার সম্পূর্ণ ফর্মটি পূরণ করা হয়েছে কিনা তা পরীক্ষা করতে, নিম্নলিখিত শর্তটি ব্যবহার করুন: $page.params.status = "FINAL"
শিল্পীর ওভারভিউ পৃষ্ঠায় শর্তসাপেক্ষ রুট তৈরি করা
চলুন একটি শর্তসাপেক্ষ রুট তৈরি করি, যা শিল্পী পরিচিত হওয়ার পরে পরবর্তী পৃষ্ঠায় স্থানান্তরিত হবে:
- শিল্পীর ওভারভিউ পৃষ্ঠায়, রুটস বিভাগে + আইকনে ক্লিক করুন।
- কন্ডিশন বিভাগে স্ক্রোল করুন।
- কমপক্ষে একটি (OR) নির্বাচন করুন
- এরপর, আমরা একটি রাশি লিখব যা
- প্যারামিটার:
$page.params.status - অপারেটর:
= - মান:
"FINAL"
- এখন, আমরা রুটে একটি নির্দিষ্ট স্ট্যাটিক পরিপূর্ণতা বার্তা তৈরি করব, যা শেষ ব্যবহারকারীর পছন্দ নিশ্চিত করবে। পরিপূর্ণতা ব্লকে স্ক্রোল করুন এবং নিম্নলিখিত পরিপূর্ণতা বার্তাগুলি লিখুন:
-
$session.params.artist, great choice! Rock on! -
You want to rock with $session.params.artist merchandise. Awesome!
- যখন শর্তটি সত্য হয়, তখন আপনার পণ্য ওভারভিউ পৃষ্ঠায় স্থানান্তর করা উচিত। ট্রানজিশন বিভাগে স্ক্রোল করুন এবং নিম্নলিখিত পৃষ্ঠাটি ব্যবহার করুন:
Product Overview - সংরক্ষণ করুন টিপুন।

পণ্যের ওভারভিউ পৃষ্ঠায় রুট তৈরি করা
এখন, আমরা জানি কিভাবে আপনি প্যারামিটার এবং কন্ডিশনাল রুট তৈরি করতে পারেন, আসুন নিম্নলিখিত পৃষ্ঠাগুলির জন্য আরও প্যারামিটার তৈরি করি:
পণ্যের সংক্ষিপ্ত বিবরণ
- পণ্যের ওভারভিউ পৃষ্ঠায়
artistপ্যারামিটার তৈরি করুন:
- প্রদর্শনের নাম:
artist - সত্তার ধরণ:
@Artist - প্রয়োজনীয়: চেক করুন
- লগে সম্পাদনা করুন: চেক করুন
- প্রাথমিক তাৎক্ষণিক পরিপূর্ণতা:
From which of these artists would you like to order merchandise?
{
"richContent": [
[
{
"options": [
{
"text": "The Google Dolls"
},
{
"text": "The Goo Fighters"
},
{
"text": "Alice Googler"
},
{
"text": "G's N' Roses"
}
],
"type": "chips"
}
]
]
}
- ইভেন্ট হ্যান্ডলার >
No-match default:To buy merchandise you can choose between the following artists: Alice Googler, G's N' Roses, The Google Dolls or The Goo Fighters. Which artist do you want to buy merchandise from? - কাস্টম পেলোড:
{
"richContent": [
[
{
"options": [
{
"text": "The Google Dolls"
},
{
"text": "The Goo Fighters"
},
{
"text": "Alice Googler"
},
{
"text": "G's N' Roses"
}
],
"type": "chips"
}
]
]
}
- ইভেন্ট হ্যান্ডলার >
No-input default:To buy merchandise you can choose between the following artists: Alice Googler, G's N' Roses, The Google Dolls or The Goo Fighters. Which artist were you trying to mention? - কাস্টম পেলোড:
{
"richContent": [
[
{
"options": [
{
"text": "The Google Dolls"
},
{
"text": "The Goo Fighters"
},
{
"text": "Alice Googler"
},
{
"text": "G's N' Roses"
}
],
"type": "chips"
}
]
]
}
-
merchপ্যারামিটার তৈরি করুন:
- প্রদর্শনের নাম:
merch - সত্তার ধরণ:
@Merch - প্রয়োজনীয়: চেক করুন
- লগে সম্পাদনা করুন: চেক করুন
- পরিপূর্ণতা:
Which merchandise item do you want? - ক্লিক করুন: সংলাপ বিকল্প যোগ করুন > কাস্টম পেলোড :
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Shirts"
},
{
"text": "Music"
},
{
"text": "Tour movie"
}
]
}
]
]
}
- ইভেন্ট হ্যান্ডলার >
No-match default - ইভেন্ট হ্যান্ডলার ফুলফিলমেন্ট:
We sell Shirts, Music or the Tour movie. Which of these items do you want? - কাস্টম পেলোড:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Shirts"
},
{
"text": "Music"
},
{
"text": "Tour movie"
}
]
}
]
]
}
- ইভেন্ট হ্যান্ডলার >
No-input default - ইভেন্ট হ্যান্ডলারের পূর্ণতা:
I couldn't understand which merchandise item you wanted to buy. You can choose between: Shirts, Music or the Tour movie. Which item do you want? - কাস্টম পেলোড:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Shirts"
},
{
"text": "Music"
},
{
"text": "Tour movie"
}
]
}
]
]
}
-
artistসরবরাহ করা এবংmerchসরবরাহ করা হলে পণ্য পৃষ্ঠায় স্থানান্তরিত হবে এমন একটি রুট তৈরি করুন।
- অবস্থা:
- প্রতিটি নিয়ম মেলাও (AND)
- অভিব্যক্তি:
$session.params.artist != null - এক্সপ্রেশন:
$session.params.merch != null - পরিপূর্ণতা:
Alright! $session.params.merch of $session.params.artist, let's go! - রূপান্তর: পৃষ্ঠা:
Product
- ব্যবহারকারী যখন "শার্ট" বলবেন তখন একটি রুট তৈরি করুন।
- উদ্দেশ্য: redirect.shirts
- রূপান্তর: পৃষ্ঠা:
Shirts
- ব্যবহারকারী যখন "সঙ্গীত" বলবেন তখন একটি রুট তৈরি করুন।
- উদ্দেশ্য: redirect.music
- রূপান্তর: পৃষ্ঠা:
Music
- ব্যবহারকারী যখন দামের তথ্য চাইবে তখন একটি রুট তৈরি করুন
- উদ্দেশ্য: redirect.price
- পরিবর্তন: নতুন পৃষ্ঠা তৈরি করুন:
Price
উপরের কনফিগারেশনটি সেট করার পর, আপনি নীচের ছবির মতো একটি ভিজ্যুয়ালাইজেশন দেখতে পাবেন। মনে রাখবেন যে ডায়াগ্রামে ইন্টেন্ট রুটগুলি নীল এবং কন্ডিশন রুটগুলি কমলা। যদিও চিত্রিত করা হয়নি, ইভেন্ট হ্যান্ডলারগুলি সবুজ, এবং যখন একাধিক রুট ধরণের একটি পৃষ্ঠায় স্থানান্তরিত হয়, তখন লাইনটি ধূসর হবে।

এখন পর্যন্ত, আপনি শিখেছেন কিভাবে স্টেট হ্যান্ডলার ব্যবহার করে Flows , Entities , Intents এবং Pages তৈরি করতে হয়: Intent Routes এবং Conditional Routes , Parameters এর উপর ভিত্তি করে। পরবর্তীতে এই ল্যাবে, আমরা ইনপুটের উপর ভিত্তি করে বিভিন্ন সংলাপ প্রদানের জন্য পরিপূর্ণতায় কন্ডিশনাল ব্রাঞ্চিং ব্যবহার করব।
আমাদের ভার্চুয়াল এজেন্ট চূড়ান্ত করতে আপনি নিম্নলিখিত কনফিগারেশনগুলি ব্যবহার করতে পারেন।
শার্ট পৃষ্ঠা:
- শার্ট পৃষ্ঠায় নিম্নলিখিত কনফিগারেশনগুলি তৈরি করুন:
- প্রবেশের পরিপূর্ণতা:
Do you want a longsleeve or a t-shirt? - প্রবেশ পূরণ কাস্টম পেলোড:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "T-shirt"
},
{
"text": "Longsleeve"
},
{
"text": "Price?"
}
]
}
]
]
}
- একটি ইন্টেন্ট রুট তৈরি করুন:
Priceপৃষ্ঠায় রূপান্তর সহredirect.price - নিম্নলিখিত প্যারামিটারটি তৈরি করুন:
- প্যারামিটার:
merch- সত্তার ধরণ:@Merch,RequiredএবংRedact in log - প্যারামিটার > ইভেন্ট হ্যান্ডলার >
No-match default - প্যারামিটার > ইভেন্ট হ্যান্ডলার ফুলফিলমেন্ট:
You can choose between a t-shirt or a longsleeve. Which of these do you want? - প্যারামিটার > ইভেন্ট হ্যান্ডলার ফুলফিলমেন্ট কাস্টম পেলোড:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "T-shirt"
},
{
"text": "Longsleeve"
}
]
}
]
]
}
- প্যারামিটার > ইভেন্ট হ্যান্ডলার >
No-input default - প্যারামিটার > ইভেন্ট হ্যান্ডলার ফুলফিলমেন্ট:
I couldn't understand if you want the t-shirt or the longsleeve. Which of these do you want? - প্যারামিটার > ইভেন্ট হ্যান্ডলার ফুলফিলমেন্ট কাস্টম পেলোড:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "T-shirt"
},
{
"text": "Longsleeve"
}
]
}
]
]
}
- এন্ট্রি পূর্ণতায় ক্লিক করুন এবং প্যারামিটার প্রিসেটস পর্যন্ত স্ক্রোল করুন, প্রতিবার যখন শার্টস পৃষ্ঠাটি সক্রিয় হবে, তখন ক্যাটাগরি প্যারামিটারটি shirts এ সেট করা হবে:
প্যারামিটার | মূল্য |
| |
- একটি শর্তসাপেক্ষ রুট যোগ করুন:
- কমপক্ষে একটি নিয়ম (OR) মিলান
- এক্সপ্রেশন:
$session.params.merch = "T-shirt" - এক্সপ্রেশন:
$session.params.merch = "Longsleeve" - নতুন পৃষ্ঠায় স্থানান্তর:
Shirt Size
মূল্য পৃষ্ঠা:
যেহেতু দামের বার্তাগুলি নির্বাচিত পণ্যদ্রব্য বা বিভাগের (সঙ্গীত বা শার্ট) উপর নির্ভর করবে, তাই আমরা ল্যাবে পরে এই অংশটি ঠিক করব। আপাতত কেবল একটি স্থানধারক প্রবেশ করানোই যথেষ্ট।
- মূল্য পৃষ্ঠায় নিম্নলিখিত কনফিগারেশনগুলি তৈরি করুন:
- প্রবেশ পূরণ:
PRICE TODO
যেহেতু আপনি কথোপকথনের বিভিন্ন জায়গা থেকে দামের জন্য অনুরোধ করতে পারেন, তাই এটি আপনাকে সর্বদা একটি উত্তর দেবে এবং ক্রমটি চালিয়ে যাওয়ার জন্য আপনাকে সংলাপের আগের অংশে ফিরিয়ে নিয়ে যাবে। সংলাপ ট্রিতে 5টি জায়গা আছে যেখানে আপনি দামের তথ্য পেতে শাখা করতে পারেন। (শার্ট, শার্টের আকার, সঙ্গীত, ক্যারিয়ার এবং একটি ইন্টেন্ট রুটের মাধ্যমে নির্দেশিকা), তাই আমাদের ফিরে যাওয়ার জন্য কিছু শর্তসাপেক্ষ রুটের প্রয়োজন হবে:
- একটি শর্তাধীন রুট যোগ করুন:
- প্রতিটি নিয়ম মেলাও (AND)
- এক্সপ্রেশন:
$session.params.category = "shirts" - এক্সপ্রেশন:
$session.params.merch = "null" - নতুন পৃষ্ঠায় রূপান্তর:
Shirts
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$session.params.category = "shirts" - Expression:
$session.params.size = "null" - Transition to new page:
Shirt Size
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$session.params.category = "music" - Expression:
$session.params.album = "null" - Transition to new page:
Music
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$session.params.category = "music" - Expression:
$session.params.merch = "null" - Transition to new page:
Carrier
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$session.params.category = "null" - Transition to new page:
Product Overview
Shirt Size Page:
- Create the following configurations in the Shirt Size Page:
- Entry fulfillment:
What shirt size do you want? - Entry fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "XS"
},
{
"text": "S"
},
{
"text": "M"
},
{
"text": "L"
},
{
"text": "XL"
},
{
"text": "2XL"
},
{
"text": "3XL"
}
]
}
]
]
}
- Create an Intent route :
redirect.pricewith a transition to thePricePage. - Create the following parameter:
- Parameter:
shirtsize- Entity Type:@ShirtSize-Required,Redact In Log - Parameter > Event Handler >
No-match default - Parameter > Event Handler Fulfillment:
Please tell me the shirt size, such as XL. - Parameter > Event Handler Fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "XS"
},
{
"text": "S"
},
{
"text": "M"
},
{
"text": "L"
},
{
"text": "XL"
},
{
"text": "2XL"
},
{
"text": "3XL"
}
]
}
]
]
}
- Parameter > Event Handler >
No-input default - Parameter > Event Handler Fulfillment:
I couldn't understand the shirt size. What size do you want? - Parameter > Event Handler Fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "XS"
},
{
"text": "S"
},
{
"text": "M"
},
{
"text": "L"
},
{
"text": "XL"
},
{
"text": "2XL"
},
{
"text": "3XL"
}
]
}
]
]
}
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$page.params.shirtsize != "null" - Transition to Page:
Product
Music Page:
- Create the following configurations in the Music Page:
- Entry fulfillment:
We have a Greatest Hits Album or the Live Album. Which one do you want? - Entry fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Greatest Hits"
},
{
"text": "Live"
},
{
"text": "Price?"
}
]
}
]
]
}
- Create an Intent Route :
redirect.pricewith a transition to Page:Price. - Create the following parameter:
- Parameter:
album- Entity Type:@Album-Required,Redact In Log - Parameter > Event Handler >
No-match default - Parameter > Event Handler Fulfillment:
You can choose between Greatest Hits and Live Album. Which of these do you want? - Parameter > Event Handler Fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Greatest Hits"
},
{
"text": "Live"
}
]
}
]
]
}
- Parameter > Event Handler >
No-input default - Parameter > Event Handler Fulfillment:
I couldn't understand if you want the album: Greatest Hit or Live. Which of these do you want? - Parameter > Event Handler Fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Greatest Hits"
},
{
"text": "Live"
}
]
}
]
]
}
- Click on the entry fulfillment and scroll down to Parameter presets , each time when the Music page gets active, the category parameter will be set to music :
প্যারামিটার | মূল্য |
| |
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$page.params.album != "null" - Transition to Page:
Carrier
Carrier Page:
- Create the following configurations in the Carrier Page:
- Entry fulfillment:
Do you want this album on CD or MP3? - Entry fulfillment Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "CD"
},
{
"text": "MP3"
},
{
"text": "Price?"
}
]
}
]
]
}
- Create an Intent route :
redirect.pricewhich transitions to thePricePage. - Create the following parameter:
- Parameter:
merch- Entity Type:@Merch-Required,Redact In Log - Parameter > Event Handler >
No-match default - Parameter > Event Handler Fulfillment:
Do you want a physical CD or the digital album? - Parameter > Event Handler Fulfillment: Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "CD"
},
{
"text": "Digital Album"
}
]
}
]
]
}
- Parameter > Event Handler >
No-input default - Parameter > Event Handler Fulfillment:
I couldn't understand if you mean CD or MP3. Which one do you want? - Parameter > Event Handler Fulfillment: Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "CD"
},
{
"text": "MP3"
}
]
}
]
]
}
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$page.params.merch != "null" - Transition to Page:
Product
Product Page:
- Create the following parameters:
Parameter Displayname | Parameter Entity Type | চেক |
| | Required, Redact in log |
| | Required, Redact in log |
- The artist parameter needs the following initial prompt fulfillment, which will be shown when the artist isn't known.
You didn't mention which artist you are interested in. You can ask me to buy the $session.params.merch of the artist you like or ask which artists we signed. How can I help?
{
"richContent": [
[
{
"options": [
{
"text": "Which artists?"
}
],
"type": "chips"
}
]
]
}
- Also add a
No-input defaultevent handler with fulfillment:I couldn't understand what you just said. Ask me which artists are signed. - And a
No-match defaultevent handler with fulfillment:I missed that. Please ask me which artists are signed.
- The merch parameter needs reprompt event handlers as well.
- Add a
No-input defaultevent handler with fulfillment:I couldn't understand what you just said. Which merchandise item do you want? - And a
No-match defaultevent handler with fulfillment:I missed that. Which merchandise item do you want?
The next route will transition to the confirmation page when the artist is known and the user chooses a "Tour Movie".
- Add a Conditional Route:
- Match Every rule (AND)
- Expression:
$session.params.artist != null - Expression:
$session.params.merch = "Tour Movie" - Parameter Presets Add Parameter >
price = 25 - Transition to new page:
Confirmation
The next route will transition to the confirmation page when the artist is known and the user chooses a "T-shirt" and the shirt size is chosen.
- Add a Conditional Route:
- Custom Expression:
$session.params.artist != null AND $session.params.merch = "T-shirt" AND $session.params.shirtsize != null - Parameter Presets Add Parameter >
price = 25 - Transition to page:
Confirmation
The next route will transition to the confirmation page when the artist is known and the user chooses a "Longsleeve" and the shirt size is chosen.
- Add a Conditional Route:
- Custom Expression:
$session.params.artist != null AND $session.params.merch = "Longsleeve" AND $session.params.shirtsize != null - Parameter Presets Add Parameter >
price = 30 - Transition to page:
Confirmation
The next route will transition to the confirmation page when the artist is known and the user chooses a "CD" also the album name is chosen.
- Add a Conditional Route:
- Custom Expression:
$session.params.artist != null AND $session.params.merch = "CD" AND $session.params.album != null - Parameter Presets Add Parameter >
price = 15 - Transition to page:
Confirmation
The next route will transition to the confirmation page when the artist is known and the user chooses a "Digital Album" and the album name is chosen.
- Add a Conditional Route:
- Custom Expression:
$session.params.artist != null AND $session.params.merch = "Digital Album" AND $session.params.album != null - Parameter Presets Add Parameter >
price = 10 - Transition to page:
Confirmation
Next, we will now make some advanced conditionals with prompts that detect missing information. The next route will transition back to the music page when the artist is known and the user chooses a "CD" or a "Digital Album" but the album name was not chosen.
- Add a Conditional Route:
- Custom Expression:
$session.params.artist != null AND ($session.params.merch = "CD" OR $session.params.merch = "Digital Album") AND $session.params.album = null - Fulfillment:
I would also need to know which album you would like to buy! - Transition to page:
Music
And the last route will transition to the confirmation page when the artist is known and the user choose a "T-shirt" or a "Longsleeve", but when t-shirt size was not chosen.
- Add a conditional Route:
- Custom Expression:
$session.params.artist != null AND ($session.params.merch = "T-shirt" OR $session.params.merch = "Longsleeve") AND $session.params.shirtsize = null - Fulfillment:
I would also need to know which shirt size you need! - Transition to page:
Shirt Size
In the next part of the lab, we will make use of conditional fulfillments to give different fulfillment messages depending on the input.
7. Conditional Responses
Some responses will return a different dialogue based on the input, The dialogues will branch off, we call this conditional responses . This can become interesting, when you are not making use of webhook fulfillments, where the conditional responses were determined on the back-end. An example could look like:
if [condition]
[response]
elif [condition]
[response]
elif [condition]
[response]
else
[response]
endif
- An example of a [condition] could be:
$session.params.user-age >= 21. It uses a similar formatting as the conditions in the routes. - An [response] takes the static text response
- Conditional responses always start with
if -
elifandelseblocks are optional
Dialogflow CX can also make use of built-in system functions to make use of. For example to format a date or time, or to display the current time ( $sys.func.NOW() )
Let's finalize the Catalog flow, by fixing the Confirmation and Price Pages.
Confirmation Page:
Now we will build the confirmation page. It has the following requirements:
- If merch is CD or Digital Album . We will show the following fields in the confirmation: artist , merch , album and price .
- If merch is T-shirt or Longsleeve . We will show the following fields in the confirmation: artist , merch , size and price .
- Else (and thus if merch is Tour Movie ). We will show the following fields in the confirmation: artist , merch and price .
- Click on the Confirmation Page.
- Click Edit Fulfillment > Agent Responses > Add dialogue option > Conditional Response :
if ($session.params.merch = "CD" OR $session.params.merch = "Digital Album")
The $session.params.merch: $session.params.artist - $session.params.album costs $$session.params.price. Shall I continue to order?
elif ($session.params.merch = "T-shirt" OR $session.params.merch = "Longsleeve")
A $session.params.merch of $session.params.artist size: $session.params.shirtsize costs $$session.params.price. Shall I continue to order?
elif $session.params.merch = "Tour Movie"
The $session.params.merch of $session.params.artist costs $$session.params.price. Shall I continue to order?
else
It looks like something went wrong with your order. You can say "Reset", to restart the order process.
endif
- Create the following Custom payload:
- Custom payload:
{
"richContent": [
[
{
"options": [
{
"text": "Yes, confirm"
}
],
"type": "chips"
}
]
]
}
Next, create two intent routes:
confirm.proceed.ordertransitions to:Order ProcessFlow.decline.proceed.ordertransitions toEnd Flow
When the user declines the order, and does not want to proceed the order process, we will have to transition back to the welcome page, but all the parameters have to be cleared. We can do this by specifically setting null to all the possible parameters. You can do this with Parameter presets.
- In the decline.proceed.order intent route, scroll down to Parameter presets and add the following parameters:
Parameter | Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notice that we have created an additional parameter called restart. If this parameter is present, the Default Start Flow, should know to continue the conversation by showing a customized message.
- Click on the Default Start Flow, Start Page, and create another Conditional Route:
$session.params.restart = "true"- Fulfillment:
"Welcome back, as the virtual agent of G-Records, I can help you order artists merchandise, you can ask questions about your order or shipping, and I can tell you more which artists are currently signed with us. How can I help?" - Custom payload:
{
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "Which artists?"
},
{
"text": "Which products?"
},
{
"text": "About my order..."
}
]
}
]
]
}
- Select the Start Page and click on the
redirect.endintent. Create the following fulfillment:Thank you for contacting G-Records! Have a nice day!
Price Page:
Let's also fix the Price TODOs. The price information will be static for now. Click on the Price Page in the Catalog Flow, and use the following entry fulfillment:
- Delete the Agent Says entry fulfillment.
- Create a new Conditional Response:
if $session.params.category = "shirts"
A t-shirt costs $25 and a longsleeve costs $30.
elif $session.params.category = "music"
A CD costs $15. The digital album on MP3 costs $10.
else
A t-shirt costs $25 and a longsleeve costs $30. A CD costs $15 and a digital album on MP3 $10. In case you are interested in the Tour Movie, that one is $25.
endif

Well done, by now you completed the Catalog flow. Your flow should look similar to this diagram:
8. Wrapping up the agent
We are almost at the end of this lab. Let's configure the last flows together, and take in practice all the new things that we have learned.
Creating the My Order Flow
- Go to the My Order Flow, and create the following intent transitions:
Page (In Flow) | Routes > Intent | Routes > Transition To |
My Order Start |
| My Order |
My Order Start |
| My Order Status |
My Order Start |
| My Order Cancellation |
My Order Start |
| End Session |
My Order Start |
| End Flow |
My Order |
| My Order Status |
My Order |
| My Order Cancellation |
Default Start Flow |
| Flow: My Order |
Default Start Flow |
| Flow: My Order |
- Let's create the following entry fulfillment for the My Order Page:
- Entry fulfillment:
I can look up the status of your order, or I can cancel an order.
- In the My Order Page create the following parameter:
- Displayname:
ordernumber - Entity Type:
@OrderNumber - Required: checked
- Initial prompt fulfillment:
What's the order number? For example ABCD123. - Event Handler:
No-match default:To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use? - Event Handler:
No-input default:I missed that. To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use?
- Create the following conditional route:
- Customize Expression:
$page.params.status = "FINAL" - Fulfillment:
And do you want to Cancel your order, or should I look up the status?
- Click on Add state handler > Event Handlers and create the Event Handler:
No-input default
- Fulfillment:
I'm sorry, what was that? Would you like me to cancel an order or look up the status? - Custom payload:
{
"richContent": [
[
{
"options": [
{
"text": "Status"
},
{
"text": "Cancel"
}
],
"type": "chips"
}
]
]
}
- Create the Event Handler:
No-match default
- Fulfillment:
Would you like me to cancel an order or lookup the status? - Custom payload:
{
"richContent": [
[
{
"options": [
{
"text": "Status"
},
{
"text": "Cancel"
}
],
"type": "chips"
}
]
]
}
- In the My Order Status Page create the following parameter:
- Displayname:
ordernumber - Entity Type:
@OrderNumber - Required checked
- Initial prompt fulfillment:
What's the order number? For example ABCD123. - Event Handler:
No-match default:To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use? - Event Handler:
No-input default:I missed that. To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use?
- In the My Order Status Page create the following conditional route:
- Customize Expression:
$session.params.ordernumber != null - Fulfillment:
Your order $session.params.ordernumber has been shipped, it can take up to approx 2 weeks before you will receive your items. - Add dialogue option > Text:
Is there anything else I can help you with?
- In the My Order Cancelation Page create the following parameter:
- Displayname:
ordernumber - Entity Type:
@OrderNumber - Required checked
- Initial prompt fulfillment:
What's the order number? For example ABCD123. - Event Handler:
No-match default:To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use? - Event Handler:
No-input default:I missed that. To proceed with your order I will need an order number. Order numbers start with 4 characters and end with 3 numbers, such as ABCD123. Which order number may I use?
- In the My Order Cancelation Page create the following conditional route:
- Customize Expression:
$session.params.ordernumber != null - Fulfillment:
Your order $session.params.ordernumber has been canceled. - Add dialogue option > Text:
Is there anything else I can help you with?
- Test the flow and create the following two test scenarios:
>"About my order"
>"ABCD123"
>"Status"
And:
>"What's the status of order DEFG222"
- Select the Start Page and click on the
redirect.endintent. Create the following fulfillment:Thank you for contacting G-Records! Have a nice day! - Select the Start Page and click on the
redirect.homeintent. Create the following parameter preset:restart = true
Default Negative intents (Fallback)
When you create a virtual agent, a default negative intent is created for you. You can add training phrases to this intent that act as negative examples that will trigger a No-match event. There may be cases where end-user input has a slight resemblance to training phrases in normal intents, but you do not want these inputs to match any normal intents.
- Try in the simulator:
I don't like Alice Googler.
You will see that the virtual agent answers with the Product Overview Page, to continue ordering Alice Googler merchandise. However, your end user does not like that artist. Let's use the Default Negative Intent for this.
- Go to Manage > Intents and select the Default Negative Intent.
- Add the following training phrases that will trigger the No-match event.
I don't like Alice GooglerI am not a fan of G's N' RosesI can't stand the music of the Google Dolls
- Hit Save and test the following sentence in the simulator:
I am really not a fan of the Goo Fighters
This time the No-match event was triggered, you stayed on the Start Page.
Default Fallback Messages
- Click the Default Start Flow, select the
sys.no-input-defaultevent handler.
The No-input fallback basically means: No text or speech answers were detected. Likely no answers were given, or the system couldn't hear it. Therefore, let's make the fallback messages more specific. Use the tab key, to create alternative dialogues:
- Remove all answers, and add these text dialogues:
I'm sorry, I didn't receive an answer. Can you say it again?I missed your answer, can you say it again?Sorry, I didn't hear anything. Can you say it again?I couldn't hear what you were saying, what was that?I'm sorry, I missed your answer. What were you trying to say?
Don't forget to click Save.
- Click the Default Start Flow, select the
sys.no-match-defaultevent handler.
The No Match fallback basically means: Text or speech answers were detected but nothing in Dialogflow CX got matched.
- Remove all answers, and add these text dialogues:
Sorry, I didn't get that. Can you please rephrase?I'm sorry, I don't understand. Can you please rephrase?I don't understand, please rephrase.Sorry, I didn't get that. What was that?I didn't get that, can you please rephrase?
Don't forget to click Save.
- It's advised to repeat these steps for the Catalog, My Order, Order Process and Customer Care flows.
Here's a tip: when creating fallback messages, make them more explicit, by rephrasing the previous question or by mentioning an example. You could create these type of No-match and No-input events on Page level when creating parameters. In our labs, we have already done this.
Creating the Order Process Flow
- Go to the Order Process Flow, and create the following intent transitions:
Page (In Flow) | Routes > Intent | Routes > Transition To |
Order Process Start |
| End Session |
Order Process Start |
| End Flow |
Order Process Start |
| New Page: Shipping Details |
- Let's create the following entry fulfillment for the Shipping Details Page:
- Entry fulfillment:
To complete your order I will first need to collect your shipping details.
- Create the following parameters:
These parameters will make use of built-in system entities. System entity support differs for each language. See the docs for more information.
Parameter Display name | Entity | Required? | Initial prompt fulfillment | No-match default | No-input default |
| @sys.person | Required |
|
|
|
| @sys.person | Required |
|
|
|
| @sys.address | Required |
|
|
|
| @sys.any | Required |
|
|
|
| @sys.geo-city | Required |
|
|
|
| @sys.geo-country | Required |
|
|
|
| @sys.email | Required |
|
|
|
- Create the following conditional route:
- Customize Expression:
$page.params.status = "FINAL" - Transition to new Page:
Payment Details
- Create the following entry fulfillment.
Let's fake it that this virtual agent makes use of Google Pay. Don't worry this tutorial won't make real transactions. Create the following entry dialogues:
- Agent Says:
Alright $session.params.firstname! We will make use of Google Pay, that's connected to your email account: $session.params.email.
- Conditional Response
if $session.params.merch != "Digital Album"
Shipping costs an additional 5 dollars. This will make the total price $$sys.func.TO_TEXT($sys.func.ADD($session.params.price, 5)).
Your merchandise will be shipped to:
$session.params.firstname $session.params.lastname
$session.params.address
$session.params.zipcode $session.params.city
$session.params.country
To continue the order process please explicitly say "I confirm". Do you want to confirm your $session.params.artist $session.params.merch order?
else
The total costs will be: $$session.params.price.
After purchasing the digital album, you will receive an email with the download link.
To continue the order process please explicitly say "I confirm".
Do you want to confirm your $session.params.artist $session.params.merch order?
endif
- Create the following Intent Route
- Intent:
confirm.proceed.order - Agent Says:
Thank you for your order! Your merchandise will be shipped today! - Add Dialogue Option > Text:
Here's the order number: ABCD123. - Add Dialogue Option > Text:
Have a good day! - Transition:
End Session
- Select the Start Page and click on the
redirect.endintent. Create the following fulfillment:Thank you for contacting G-Records! Have a nice day! - Select the Start Page and click on the
redirect.homeintent. Create the following parameter preset:restart = true
Awesome! By now we have a fully working realworld retailer chatbot! In the next lab, we will test how well the virtual agent performs!
9. Test your virtual agent
You can use the built-in simulator to test the dialogues of your virtual agent. The advantage of testing the flows in the simulator is that you will see a nice overview of flows, pages, parameters, and (DTMF) events that the simulator collected while walking through your flows. This makes testing easier than testing it directly in an integration, as those types of information will be hidden from the end user. It's even possible to create test cases, save and reuse those test cases. This makes a lot of sense, for when you maintain or edit your flows over time, and you want to be sure that none of your changes break your previous work.
It is also possible to export and import previously made test cases, by storing the tests in Google Cloud Storage or local. Exporting a test will download a blob file. To learn more about the simulator and test cases check out the Simulator / Test Cases Docs .
Before creating some test cases, let's first finalize the rest of our virtual agent:
Creating the Customer Care Flow
- Go to the Customer Care Flow, and create the following intent transitions:
Page (In Flow) | Routes > Intent | Routes > Transition To |
Customer Care Start | | পরিবহন |
Customer Care Start | | ফেরত |
Customer Care Start | | অদলবদল |
Customer Care Start | | End Flow |
Customer Care Start | | অধিবেশন শেষ করুন |

- Create the following entry fulfillments for the Shipping Page:
-
Shipping physical merchandise items can take up to 2 weeks. -
Is there anything else I can help you with?
- Create the following entry fulfillments for the Refund Page:
-
We offer free returns and refunds. We provide one free return label for each order. You can use it within 30 days from receiving your order. If your refund is accepted, we will refund the price you paid for your item back to your original payment method. -
Is there anything else I can help you with?
- Create the following entry fulfillments for the Swapping Page:
-
If you would like to change your item for a different one, please return your unwanted item and place a new order. If your refund is accepted, we will refund the price you paid for your item back to your original payment method. -
Is there anything else I can help you with?
- Select the Start Page and click on the
redirect.endintent. Create the following fulfillment:Thank you for contacting G-Records! Have a nice day! - Select the Start Page and click on the
redirect.homeintent. Create the following parameter preset:restart = true
Create test cases
- Click the Test Agent button on the right side of the screen.
When you first open the simulator, you need to select an agent environment and active flow. In most cases, you should use the draft environment and default start flow.
- Type:
Hi

- Ask:
Which artists are signed with your label? - Say:
The Google Dolls - Say:
I am interested in buying a shirt - Say:
A t-shirt - Say:
Medium - Now click on the save test case button. Which you can find in the top of the simulator (next to the redo arrow, and reset trash bin icon)

- Give it the following details:
- Test case name:
Buy Google Dolls t-shirt size M - Tags: #catalog, #shirts, #t-shirt, #TheGoogleDolls
- সংরক্ষণ করুন ক্লিক করুন
Let's create more test cases.
- First clear the current dialogue, by clicking on the Reset (thrash bin) icon.
- Create the following test cases:
Buy the Alice Googler t-shirt:
>"Buy the Alice Googler t-shirt."
>"XL"
- Test case name:
Buy the Alice Googler t-shirt - Tags:
#catalog, #shirts, #t-shirt, #AliceGoogler
Buy a t-shirt size M: (Note the Artist name hasn't been mentioned, but you do want to skip the bands overview, products overview, shirts and shirt size pages)
>"Buy a t-shirt size M"
>"The Google Fighters"
- Test case name:
Buy a t-shirt size M - Tags:
#catalog, #shirts, #t-shirt, #TheGoogleFighters - Description: (Note the Artist name hasn't been mentioned, but you do want to skip the bands overview, products overview, shirts and shirt size pages)
Purchase Music of G's N' Roses (Note this will skip the bands overview and products overview page)
>"Purchase music of G's N' Roses"
>"Live"
>"CD"
- Test case name:
Purchase music of G's N' Roses - Tags:
#catalog, #music, #CD, #GsNRoses, #live - Description: (Note this will skip the bands overview and products overview page)
Check price information:
>"Which products"
>"Shirts"
>"What's the price difference?"
>"Longsleeve"
>"What does it cost?"
>"M"
>"The Google Dolls"
>"No"
>"Which bands"
>"The Gooo Fighters"
>"Music"
>"How much does it cost?"
>"Greatest Hits"
>"What's the price difference?"
>"Mp3"
>"No"
>"I want to buy the tour movie"
>"Alice Googler"
>"Yes"
- Test case name:
Price info - Tags:
#catalog, #music, #tourmovie, #shirts - Description: Test price info on various points in the dialogue
Test pre-recorded test cases
- Select Manage > Test Cases in the Dialogflow main menu on the left.
- Select all the test cases and press the Run button, above the table.
Dialogflow CX will run all the selected test cases against the recording that was saved as a "Golden Test Case", if the results are the same as how you saved it, then the tests are passed. - Did something change in the flows like Pages that are not correctly configured, or intents that directed you to the wrong pages, then the tests will fail.

- In the simulator ask the following question:
How long will shipping take? - Note the result, and save the test case as
Shippingwith the tag:#shipping. - Go to the Manage > Test Cases panel and press the Run button on the top right of the grid, to run only the
Shippingtest case.
This test should pass.
- Go back to the Customer Care Flow, Select the Start Page and click on the Routes header.
This will show a screen with a grid that shows all the routes.
- Remove the
redirect.shipping.info route - Go to the Manage > Test Cases panel and press the Run button on the top right of the grid, to run only the
Shippingtest case.
This test should fail.
- You can click on the failed test, to see the details of the fail.
In this case the test failed with the below error message:
Page: Page mismatch:
Expected: Shipping
Actual: Start Page
The reason for this is because the page doesn't exist in the flow anymore. We expected the Shipping Page, but instead we never moved away from the Start Page. (or your end-users would receive a fallback message.)
With other words, this is a missed request, a False Negative Test result. The test failed. We expected the Shipping Page, but nothing happens, or a fallback message was shown.
- Go back to the Customer Care Flow, and add the
redirect.shipping.infoas an intent route, to the Start Page. Don't forget to transition to the Shipping Page and hit Save . - In the simulator record the following test case:
I want to swap my item, save this test case asSwapping#swapping. - Open Manage >Intents > redirect.refund.info and add the following training phrase:
I want to swap this item for a refund
Without that training phrase, when a user would ask to change an item for a refund, it would hit the redirect.swapping.info intent, but we don't want to give information on changing items, we want to give information on refunds.
- Create the following golden test case:
I want to swap this item for a refundin the simulator, and save this test case asSwap for Refund#refund - Go back to the Manage >Intents > redirect.refund.info intent, and remove the
I want to swap this item for a refundline. - Go back to Manage > Test Cases , select the Swap for Refund test case, and Run it.
Your latest test failed, with the below error message:
If you would like to change your item for a different one, please return your unwanted item and place a new order. If your refund is accepted, we will refund the price you paid for your item back to your original payment method.`
Is there anything else I can help you with?
Page: Page mismatch:
Expected: Refund
Actual: Swapping
With other words, this is a missed understood request, a False Positive Test result. The test failed. We expected the Refund Page, but Swapping Page became active.
কভারেজ
In Dialogflow CX, test coverage is a measure used to describe the degree to which the dialogue of the virtual agent (Pages and Intents) is executed when a particular test suite runs. A virtual agent with high test coverage, measured as a percentage, has had more of its dialogues executed during testing, which suggests it has a lower chance of containing undetected bugs (like missed understood requests) compared to a virtual agent with low test coverage.
- To view a test coverage report for all test cases, click Coverage .
- Click on the tab Transitions .
This will show you the test coverage for all the page transitions.

- Click on the tab Intents .
This will show you the test coverage for all the intents.

Congratulations, by now you have built and tested a complete real world example of a retailer bot! Let's go to the next lab page to read the conclusion and find some handy references!
১০. উপসংহার
Dialogflow CX is a Conversational AI Platform (CAIP) for creating virtual agents like chat or voice bots. Dialogflow CX empowers your team to accelerate creating enterprise-level conversational experiences through visual bot builders, reusable intents, and the ability to address multi-turn conversations.
In this codelab, you have learned how to build a real world retail virtual agent. We addressed the following concepts:
- প্রবাহিত হয়
- Parameters, Custom & System Entities
- পাতা
- State Handlers like Intent Routes and Condition Routes
- Static Fulfillment Messages and Conditional Responses
- Fallback intents
- Simulator, Test Cases and Coverage

তথ্যসূত্র
To learn more about Dialogflow CX have a look into the following blogs and documentation!