Astro の不思議な夢
学習の目的
この単元を完了すると、次のことができるようになります。
- Campfire Stories (キャンプファイヤーストーリー) 従業員エージェントを使用して、Campfire Stories (キャンプファイヤーストーリー) オブジェクトに新しいストーリーを追加する。
エージェントにストーリーを伝える
Campfire Stories (キャンプファイヤーストーリー) カスタムオブジェクトと Campfire Stories (キャンプファイヤーストーリー) 従業員エージェントをヘッドレスで簡単に作成できたため、あなたはビーチを歩いてキャンプファイヤーリングで他のメンバーと合流します。Codey と Ruth はキャンプファイヤーストーリー体験のあらゆる詳細を計画しながら、まだ熱心に会話を続けています。Astro はおしゃべりが過ぎてイスの上でぐっすり眠ってしまいましたが、明らかにとても楽しい夢を見ているようです。
「きっとスモアの夢を見ているんだよ」と Ruth が Astro の方を向いてうなずきます。
Astro はびっくりして目を覚まし、体を震わせました。「こんなにおかしな夢は初めてだよ! 海の中にいたら、マシュマロがいくつも浮かんでいて、チョコレートのいかだに助けてもらったんだ。砂はグラハムクラッカーのかけらだったし! それからぼくは太陽で溶けちゃって、水面に映った自分を見たら、スモアになってたんだ! すごく不思議で怖かったよ! ぼく、本当にスモアみたいに見える?」
あなたと Codey と Ruth は笑いました。「その話を、さっき作ったエージェントに教えてあげよう」とあなたは言いました。「キャンプファイヤーストーリーのリストの最初にぴったりだよ!」

スモアの海
オフィスに戻ると、友人たちに作業中のものを見せました。みんな感心しています。「これは楽しそう!」 と Ruth は手を合わせながら言いました。「Astro、夢の内容を教えて。このエージェントがどう動くか見てみたい!」
Astro が夢の内容をとても鮮明に語ったので、みんなはまるで自分たちもその場にいたかのような気持ちになりました。Astro が話す間、あなたはその詳細をエージェントに入力します。
- ヘッドレスエクスペリエンス Playground で、
を選択して Agentforce Builder を終了します。
-
を選択し、[Coral Cloud Resorts] を検索して選択します。
-
[Campfire Stories (キャンプファイヤーストーリー)] タブを選択して Campfire Stories (キャンプファイヤーストーリー) オブジェクトを開きます。表示されない場合は、[More (その他)] を選択する必要があります。重要: エージェントはコンテキストに応じて動作するため、エージェントが作業を行うオブジェクト内でエージェントを操作する必要があります。
- 前の単元でエージェントをヘッドレスエクスペリエンスで有効化したときに、Playground で Campfire Stories (キャンプファイヤーストーリー) エージェントを使用できるようになっています。
を選択して、Campfire Stories (キャンプファイヤーストーリー) 従業員エージェントを開きます。
-
[Create a new campfire story (新しいキャンプファイヤーストーリーを作成)] を選択します。([Create a new campfire story (新しいキャンプファイヤーストーリーを作成)] ボタンが表示されるまで数秒かかる場合があります。また、テキストが若干異なる場合があります。)

新しいストーリーの作成をサポートするようにチャットウィンドウの情報が変わります。Campfire Stories (キャンプファイヤーストーリー) オブジェクトの項目に対応した具体的な詳細情報が尋ねられます。これらの質問には、次のステップで使用するストーリープロンプトで回答します。
- 次のストーリーの詳細をコピーしてエージェントのテキスト項目に貼り付け、
を選択します。
The title is A Sea of S’mores The type is Scary Dream The audience is Kids The Length is Medium (5-7 min) The full text is this: On a dark and stormy night, Astro found themself stranded on a lonely stretch of beach. The last thing they remembered, they’d been paddle boarding in the bay and paddled too close to a flippant whale. Now, they were here, the day is night, and the once glassy sea is now roiling in a terrible storm. The beach shook as thunder rumbled and waves pummeled the shore and the nearby cliffs. Cold, soggy, and feeling very alone, Astro managed to light the smallest, smokiest campfire with some damp driftwood. They hunched over their meager fire to protect it from the howling wind and sheets of rain. They couldn’t afford to lose this flame because they were so hungry and they had used their very last match. Even through the raging storm, the only things on Astro’s mind were the graham crackers, chocolate bars, and marshmallows wrapped up tightly in their backpack. They hoped they weren’t wet. In the flickering lightning, they could make out the rising tide and hoped they could make at least one s’more before the waves took their fire away. They don’t like cold marshmallows. All of a sudden, a gust of wind blew up a spray of saltwater that doused their fire in a blink. Noooooooooo! Astro cried at the stormy sky. When they looked back to the steaming mess of watery logs that had been their fire, they were horrified to see a sneaker wave pulling their backpack out to sea. My s’mores! My s’mores! they yelled helplessly, but their voice was whipped away by the wind. Now they were hungrier, even more exhausted, and feeling very defeated. In their dream, Astro bobbed up and down in the dark, treacherous waves. Every so often they and their backpack bobbed at the same cadence and they could see it rise and fall in the distance. Then, something hard bounced into them and floated off - was that a chocolate raft?! Yes! They frantically swam to it and scrambled on board and began futilely paddling with their hands in the direction of the backpack. They floated on the huge chocolate bar for what seemed ages before lightning lit up something big and white bobbing in the distance. They guided the raft toward the object. A boat? No. A buoy? No! It was a giant marshmallow! Astro grabbed it and pulled it onto the chocolate raft and together they floated and bobbed on and on through the stormy night. Morning came, and Astro was again on a beach. The storm was over and the hot sun had softened the chocolate bar raft. The giant marshmallow had turned a golden tan and melted all over them. It smelled delicious. They brushed sand off of their face and realized the sand wasn’t even sand - it was graham cracker crumbs! Yum! Suddenly, they remembered what their friends had been telling them. If you keep talking about s’mores you’re going to turn into a s’more! You’re going to turn into a s’more! …turn into a s’more…a s’more …s’more s’mores! Their words danced and swirled around them. They stood up and shuffled to the waters edge and looked at their reflection in the surf. I am a s’more!

- エージェントがストーリーを Campfire Stories (キャンプファイヤーストーリー) オブジェクトに確実に保存するように、次のテキストをコピーしてチャットウィンドウに貼り付けます:
Save the story to the Campfire Stories object if it hasn’t already been saved.(ストーリーがまだ保存されていない場合は、Campfire Stories (キャンプファイヤーストーリー) オブジェクトに保存してください。)
新しいキャンプファイヤーストーリーを表示する
Astro は自分のストーリーを話せてほっとしていますが、まだ少し動揺していて、自分がスモアになってしまったような気がしているようです。
エージェントにストーリーを入力し終えると、作成したストーリーレコードを確認するために Campfire Stories (キャンプファイヤーストーリー) オブジェクトを全員で確認します。
-
を選択して、[Campfire Stories (キャンプファイヤーストーリー)] エージェントパネルを閉じます。

- ブラウザーウィンドウを更新します。新しいストーリーが、[Campfire Stories (キャンプファイヤーストーリー)] オブジェクトの [All (すべて)] リストビューに表示されます。
- 作成したストーリー [A Sea of S'mores (スモアの海)] のレコード番号を選択して、ストーリーがオブジェクトに追加され、項目にストーリーの詳細が入力されていることを確認します。

次のステップ
次の単元では、別のストーリーを追加し、さらにいくつかのストーリーを生成します。その後、従業員エージェントに指定した条件に基づいてストーリーを提案するよう指示します。
