Skip to content

Create an application from scratch

You can deploy a Griptape Cloud app using the Griptape CLI or the web browser interface. To deploy an app using the Griptape CLI, follow the Getting Started using CLI tutorial. To get started using one of the prebuilt sample applications, follow the Getting Started using Samples tutorial. If you're feeling adventurous and you want to create an application from scratch, continue with the following instructions.

Creating an application from scratch

Griptape Cloud expects a certain structure within your application.

Your .zip archive file should contain the following files at the root directory, not in a sub-directory.

Filename Description
app.py This is the main entry point for you application. Griptape Cloud will look for an init_structure method that returns a supported Griptape structure such as an Agent, Pipeline, or Workflow
.env Currently, Griptape Cloud uses .env files to set application environment variables. This file should have KEY=VALUE pairs for any variables you'd like set in your application's container
requirements.txt The list of libraries your application depends upon inclusive of the version of the griptape framework you are targetting.

Warning

Currently Griptape Structures like Agents, Pipelines, and Workflows will default to using OpenAI if a specific driver is not implemented in the application. Make sure you either set an OPENAI_API_KEY value in your .env or load up your appropriate alternative credentials.

Here is a sample application template you can use as a starting point for your app.

app.py
from dotenv import load_dotenv
from griptape.structures import Agent, Structure

load_dotenv()

def init_structure(*args, **init_params) -> Structure:
    return Agent()
Your requirements.txt file should look like this. Add any other dependencies you wish to be installed into your application's runtime environment.

requirements.txt
griptape==0.21.1
python-dotenv

Preparing for upload

Griptape Cloud expects a zip file when you're uploading your own application from your local machine. You can zip your application files using whatever method you choose, but ensure that the app.py, requirements.txt, and .env files are all in the top level directory of your archive.

Tip

If you're on a Mac, navigate into your application directory and run zip -r app.zip . -x "__MACOSX" to avoid zipping the Mac file system directories. This won't break your application, but they will show up in the Cloud IDE.

At this point, you're ready to upload your application to Griptape Cloud.

E Uploading your application to Griptape Cloud

While logged in to Griptape Cloud, you'll see a button labeled + New App on your left side bar. Click that button to navigate to the New App screen.

New App Screen

CLick on the Upload an app icon. A file upload dialog will appear. Select the zipped application archive and click Upload.

Running your app on Griptape Cloud

Naviate to your application's main page using the left side navigation bar. When the application is first being deployed, you'll find a blue indicator light on the top left side of the page. When it's green, you're ready to proceed.

Status Indicator

Congratulations. You're ready to run your first Griptape Cloud app. In the right hand side of the in-browser IDE, you'll find a conversational interface to your application. Anything you type in place of Enter a prompt will be sent to the application.

Poetry users (unsupported, but functional)

Alternatively, you can use poetry. It will take care of locking dependencies for you, although it has its own requirements such as needing a pyproject.toml file.

poetry export --without-hashes --format=requirements.txt > requirements.txt