griptape
griptape is a modular Python framework for LLM workflows, tools, memory, and data that enables developers to:
- 🤖 Build AI agents, sequential LLM pipelines and sprawling DAG workflows for complex use cases.
- ⛓️ Augment LLMs with chain of thought capabilities.
- 🧰️ Integrate other services and functionality into LLMs as tools (e.g., calculators, web scrapers, spreadsheet editors, and API connectors); run tools in any environment (local, containerized, cloud, etc.); use tools directly in griptape or convert them into ramps abstractions, such as ChatGPT Plugins, LangChain tools, or Fixie.ai agents.
- 💾 Add memory to AI pipelines for context preservation and summarization.
Documentation
Please refer to Griptape Docs for:
- Getting started guides.
- Core concepts and design overviews.
- Examples.
- Contribution guidelines.
Quick Start
First, install griptape and griptape-tools:
pip install griptape griptape-tools -U
Second, configure an OpenAI client by getting an API key and adding it to your environment as OPENAI_API_KEY. griptape uses OpenAI Completions API to execute LLM prompts and to work with LlamaIndex data structures.
With griptape, you can create structures, such as Agents, Pipelines, and Workflows, that are composed of different types of tasks. You can also define structures as JSON objects and load them into griptape dynamically. Let's define a simple two-task pipeline that uses tools:
from decouple import config
from griptape.tools import WebScraper, Calculator
from griptape import utils
from griptape.memory import Memory
from griptape.tasks import PromptTask, ToolkitTask
from griptape.structures import Pipeline
from griptape.core import ToolLoader
scraper = WebScraper(
openai_api_key=config("OPENAI_API_KEY")
)
calculator = Calculator()
pipeline = Pipeline(
memory=Memory(),
tool_loader=ToolLoader(
tools=[calculator, scraper]
)
)
pipeline.add_tasks(
ToolkitTask(
tool_names=[calculator.name, scraper.name]
),
PromptTask(
"Say the following like a pirate: {{ input }}"
)
)
pipeline.run("Give me a summary of https://en.wikipedia.org/wiki/Large_language_model")
print(utils.Conversation(pipeline.memory).to_string())
Boom! Our first LLM pipeline with two sequential tasks generated the following exchange:
Q: Give me a summary of https://en.wikipedia.org/wiki/Large_language_model
A: Arr, me hearties! Large language models have been developed and set sail since 2018, includin' BERT, GPT-2, GPT-3 [...]
Versioning
griptape is in early development and its APIs and documentation are subject to change. Until we stabilize the API and release version 1.0.0, we will use minor versions (i.e., x.Y.z) to introduce features and breaking features, and patch versions (i.e., x.y.Z) for bug fixes.
Contributing
Contributions in the form of bug reports, feature ideas, or pull requests are super welcome! Take a look at the current issues and if you'd like to help please submit a pull request with some tests.
License
griptape is available under the Apache 2.0 License.
Release files for griptape 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| griptape-0.7.0.tar.gz | 37.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| griptape-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.8 kB
Release files / griptape-0.7.0.tar.gz
| Download URL | griptape-0.7.0.tar.gz |
|---|---|
| Size | 37.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3f0cb74f1944e2631055dfbf816e707db58b0ed4e65d7d0b8fceac8f6498a9d
|
|
BLAKE2b-256 checksum How to use checksums |
3bc3393fe0eb29f1fe21772afd29c95b552e50e8c2ca23d2919a4ae080ddad14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.9.16 Darwin/21.6.0
|
Release files / griptape-0.7.0-py3-none-any.whl
| Download URL | griptape-0.7.0-py3-none-any.whl |
|---|---|
| Size | 67.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c2736ce9de1ed6f6e41f2b0fd42fecde2be4e67db226be03a3d860ab45e9d09
|
|
BLAKE2b-256 checksum How to use checksums |
f40d12856c4c7bab7af13d529b7a4bf17655196f6130ab10c4fc1fb0afe23fb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.9.16 Darwin/21.6.0
|