|
131 | 131 | "source": [ |
132 | 132 | "## Building our agent\n", |
133 | 133 | "\n", |
134 | | - "We'll be building a product review writing agent that takes in a set of product descriptions, collects relevant information, and provides a summary and analysis you can use for SEO.\n" |
| 134 | + "We'll be building a restaurant review writing agent that takes in a set of restaurant reviews, collects relevant information, and provides a summary and analysis you can use for SEO." |
135 | 135 | ] |
136 | 136 | }, |
137 | 137 | { |
138 | 138 | "cell_type": "markdown", |
139 | 139 | "metadata": {}, |
140 | 140 | "source": [ |
141 | 141 | "### Defining tools\n", |
142 | | - "One of the defining the features of an agent is its ability to use tools so let's give it some.\n", |
| 142 | + "One of the defining the features of an agent is its ability to use tools so let's give it some. Our agent will decide when to call each tool, construct the appropriate arguments, then retrieve and utilize the results.\n", |
143 | 143 | "\n", |
144 | | - "For use with Autogen that just requires we define a well named function with type hints in its signature" |
| 144 | + "With Autogen that just requires we define a well named function with type hints in its signature.\n", |
| 145 | + "\n", |
| 146 | + "We will have three main tools:\n", |
| 147 | + "1. A `summarize()` function that can take in a collection of reviews and boil them all down to a single summary.\n", |
| 148 | + "2. A `get_keywords()` function to count the most common words present in the article, becuase LLM's often struggle with character counting.\n", |
| 149 | + "3. A `publish_article()` function that will write our final article to a separate file we can then upload elsewhere." |
145 | 150 | ] |
146 | 151 | }, |
147 | 152 | { |
|
419 | 424 | "outputs": [], |
420 | 425 | "source": [] |
421 | 426 | }, |
| 427 | + { |
| 428 | + "cell_type": "markdown", |
| 429 | + "metadata": {}, |
| 430 | + "source": [ |
| 431 | + "That's a lot of output from our agent, and it can be hard to parse through all of it.\n", |
| 432 | + "\n", |
| 433 | + "Take a moment to scan the main points and you'll see the agent takes in the user's task as a `TextMessage`, then proceeds to perform a series of `ToolCallRequestEvent`, `ToolCallExecutionEvent`, `ThoughtEvent`, and `MemoryQuery` actions. The input and output of each of these is printed.\n", |
| 434 | + "\n", |
| 435 | + "There's no need for us to read it closely as we'll have the final article written to an external file cleanly when we're - or rather our agent - is finished." |
| 436 | + ] |
| 437 | + }, |
422 | 438 | { |
423 | 439 | "cell_type": "markdown", |
424 | 440 | "metadata": {}, |
|
584 | 600 | "await Console(stream)" |
585 | 601 | ] |
586 | 602 | }, |
| 603 | + { |
| 604 | + "cell_type": "markdown", |
| 605 | + "metadata": {}, |
| 606 | + "source": [ |
| 607 | + "## The finished product\n", |
| 608 | + "We got another large block of agent output showing us it's hard work. We can see the same `ThoughtEvent` and other actions happening, but what we really care about it is the finished product. Check your local directory for a markdown file with our finished article.\n", |
| 609 | + "\n", |
| 610 | + "That's it!" |
| 611 | + ] |
| 612 | + }, |
587 | 613 | { |
588 | 614 | "cell_type": "markdown", |
589 | 615 | "metadata": {}, |
|
0 commit comments