Code Monkey home page Code Monkey logo

griptape's Introduction

griptape

PyPI Version Tests Docs Griptape Discord

Griptape offers developers the ability to build AI systems that operate across two dimensions: predictability and creativity.

For predictability, software structures like sequential pipelines and directed acyclic graphs (DAGs) are enforced. Creativity, on the other hand, is facilitated by safely prompting LLMs with tools that connect to external APIs and data sources. Developers can move between these two dimensions according to their use case.

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. By default, Griptape uses OpenAI Completions API to execute LLM prompts.

With Griptape, you can create structures, such as Agents, Pipelines, and Workflows, that are composed of different types of tasks. Let's build a simple creative agent that dynamically uses two tools with shared memory.

from griptape.memory.tool import TextToolMemory
from griptape.structures import Agent
from griptape.tools import WebScraper, TextMemoryBrowser


# Define memory to be shared between tools.
memory = TextToolMemory()

# WebScraper enables LLMs to load web pages.
web_scraper = WebScraper(
    output_memory={"get_content": [memory]}
)

# TextMemoryBrowser enables LLMs to query, summarize and extract data from memory.
memory_browser = TextMemoryBrowser(
    input_memory=[memory]
)

# Agents can use multiple tools to creatively solve problems
agent = Agent(
    tools=[web_scraper, memory_browser]
)

agent.run(
    "based on https://www.griptape.ai/, tell me what Griptape is"
)

And here is the output:

Q: based on https://www.griptape.ai/, tell me what Griptape is
A: Griptape is an opinionated Python framework that enables developers to fully harness the potential of LLMs while enforcing strict trust boundaries, schema validation, and activity-level permissions. It offers developers the ability to build AI systems that operate across two dimensions: predictability and creativity. Griptape can be used to create conversational and autonomous agents.

During the run, the Griptape agent loaded a webpage, stored its full content in temporary memory, and finally queried it to answer the original question.

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.

griptape's People

Contributors

vasinov avatar collindutter avatar kyleroche avatar kozlice avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.