Summary Engine Innovation Release
This documentation covers the current Innovation Release of
EDB Postgres AI. You may also want the docs for the current LTS version.
Overview
Summary engines are used to summarize text and collections of TextArtifacts.
Prompt
Used to summarize texts with LLMs. You can set a custom prompt_driver, generate_system_template, generate_user_template, and chunker.
Use the summarize_artifacts method to summarize a list of artifacts or summarize_text to summarize an arbitrary string.
import requests from griptape.drivers.prompt.openai import OpenAiChatPromptDriver from griptape.engines import PromptSummaryEngine from griptape.loaders import PdfLoader response = requests.get("https://arxiv.org/pdf/1706.03762.pdf") engine = PromptSummaryEngine( prompt_driver=OpenAiChatPromptDriver(model="gpt-3.5-turbo"), ) artifact = PdfLoader().parse(response.content) engine.summarize_artifacts(artifact)