Skip to content

Commit

Permalink
Add CustomGPT Action article for Tray.ai (#1581)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecote-tray authored Dec 9, 2024
1 parent d5ba7dc commit 7347395
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
5 changes: 5 additions & 0 deletions authors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,8 @@ erickgort:
name: "Erick Gort"
website: "https://www.linkedin.com/in/erick-gort-32ab1678/"
avatar: "https://avatars.githubusercontent.com/u/189261906?v=4"

kylecote-tray:
name: "Kyle Cote"
website: "https://github.com/kylecote-tray"
avatar: "https://avatars.githubusercontent.com/u/53836176"
74 changes: 74 additions & 0 deletions examples/chatgpt/gpt_actions_library/gpt_action_trayai_apim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# GPT Action Library: Tray.ai API Management Operations

## Introduction

This page provides an instruction & guide for developers building a set of GPT Actions across a set of applications. Before you proceed, make sure to first familiarize yourself with the following information:
- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)
- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)
- [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)

This particular GPT Action(s) provides an overview of how to connect to a **Tray.ai API Management Operations**.

### Value + Example Business Use Cases

**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to APIs created through API Management in Tray.ai.

**Example Use Cases**:
- Tray.ai is a middleware that composes workflows, handles workflow action scaling, and interfaces with hundreds of 3rd party APIs
- You have a custom operation running in Tray.ai workflow(s) that you'd like to incorporate into a GPT.
- You would like to govern access to actions for your organization/team under a single API interface

## Application Information

### Application Key Links

Check out these links from the application before you get started:
- Application Website: https://tray.ai/universal-automation-cloud/api-management
- Application API Documentation: https://tray.ai/documentation/tray-uac/api-management/api-management-overview/

### Application Prerequisites

Before you get started, make sure you go through the following steps in your Tray.ai environment:
- Set up a Tray.ai account
- Create a project with a set of simple API Management Operations

### Application Workflow Steps

Below is an example of a building and extending a basic set of API Management operations:\
![Tray.ai APIM Create Operation Gif](../../../images/gptactions_trayai_createoperation.gif)

## ChatGPT Steps

### Custom GPT Instructions

Once you've created a Custom GPT, you should add Instructions to the GPT providing context about the GPTs role, and the actions it is able to perform. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.

### OpenAPI Schema

Once you've created a Custom GPT, download the API specification from your Tray.ai project, copy the contents, and paste it into your Custom GPT action
schema. Once pasted, update your schema's `openapi` property to version `3.1.0`.

Below are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.

### Pre-Action Steps

Before you set up authentication in ChatGPT, please take the following steps in the application:
- Create a new role with the name `full`
- Create a new policy specifying name, operations to allow, and policy rules with `"Authentication" == True` and role is `full`
- Create a new client with roles set to `full`
- Save your API Token for future steps

![Tray.ai APIM Create Operation Gif](../../../images/gptactions_trayai_createclientcredential.gif)


### In ChatGPT

In ChatGPT, click on "Authentication" and choose **"API Key"**. Enter in the information below.

- **API Key**: (Paste your API Key provided by the Tray.ai API Management Client)
- **Auth Type**: Bearer

### FAQ & Troubleshooting

- *Auth/Forbidden Error:* Ensure you have properly entered your API key and have set the `Auth Type` as `Bearer`.
- *Tray.ai Internal Error:* You can configure responses back to your CustomGPT configuring error handling and responding back with error messages.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gptactions_trayai_createoperation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1750,3 +1750,13 @@
- gpt-actions-library
- chatgpt
- chatgpt-communication

- title: GPT Actions library - Tray.ai APIM
path: examples/chatgpt/gpt_actions_library/gpt_action_trayai_apim.md
date: 2024-11-26
authors:
- kylecote-tray
tags:
- gpt-actions-library
- chatgpt
- chatgpt-middleware

0 comments on commit 7347395

Please sign in to comment.