This is a standalone Node.js application that interacts with the Griptape API to initiate a structure run, poll for its status, and print the results once the run is completed.
griptape-node-app
├── src
│ ├── app.js # Entry point of the application
│ └── utils
│ └── api.js # Functions for interacting with the Griptape API
│ └── threads.js # Functions to interact with Conversation Threads via the Griptape API
├── package.json # npm configuration file
├── env.example # Example file containing environment variables for configuration
└── README.md # Project documentation
-
Clone the repository:
git clone <repository-url> cd griptape-node-app
-
Install dependencies:
npm install
-
Create a
.env
based on theexample.env
file in the root directory and add your Griptape API key and endpoint URLs:GRIPTAPE_API_URL=https://cloud.griptape.ai/api GRIPTAPE_API_KEY=your_Griptape_Cloud_api_key STRUCTURE_ID=the Structure ID of the Structure that you wish to invoke
To run the application, use the following command:
node src/app.js
This application utilizes the Griptape API to perform the following actions:
- Create a Structure Run: Initiates a structure run using the Griptape API.
- Poll for Event Status: Continuously checks the status of the structure run until it is completed, then retrieves and prints the results.
This project is licensed under the MIT License.