-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeb97f5
commit 49495dd
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
from griptape.structures import Pipeline | ||
from griptape.tasks import ToolkitTask | ||
import logging | ||
|
||
from griptape.config import config | ||
from griptape.structures import Agent | ||
from griptape.tools import PromptSummaryTool, WebScraperTool | ||
from griptape.utils import Stream | ||
|
||
pipeline = Pipeline() | ||
pipeline.add_tasks( | ||
ToolkitTask( | ||
"Based on https://griptape.ai, tell me what griptape is.", | ||
tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(off_prompt=False)], | ||
) | ||
# Hide Griptape's usual output | ||
logging.getLogger(config.logging_config.logger_name).setLevel(logging.ERROR) | ||
|
||
agent = Agent( | ||
input="Based on https://griptape.ai, tell me what griptape is.", | ||
tools=[ | ||
PromptSummaryTool(off_prompt=True), | ||
WebScraperTool(off_prompt=False), | ||
], | ||
stream=True, | ||
) | ||
|
||
for artifact in Stream(pipeline).run(): | ||
|
||
for artifact in Stream(agent).run(): | ||
print(artifact.value, end="", flush=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters