Skip to content

Commit

Permalink
Merge pull request #12 from jcooper-salt/discord-api-deployments
Browse files Browse the repository at this point in the history
Updated Discord & API sections
  • Loading branch information
scottbaggett authored Jun 18, 2024
2 parents 00059e5 + ada0160 commit 55fd0a9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
45 changes: 25 additions & 20 deletions docs/deploy-to-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@

## Overview

Deploy to API enables you to transform your workflows into production-ready APIs, allowing you to seamlessly integrated advanced AI capabilities into your app quickly.
`Deploy to API` enables you to transform your workflows into production-ready APIs, allowing you to seamlessly integrated advanced AI capabilities into your app quickly.

- **Scalability:** Your deployment will be able to handle increasing loads without compromising performance.
- **Accessibility:** Simplify the arduous process of deploying an AI workflow, and enable production-ready use with the click of a button.
- **Speed:** Lightning fast deployments enables rapid iteration of workflows.

## Deploying to API

1. Once your workflow is ready for production use, navigate to the deploy button in the workflow editor.
2. Select the "Deploy to API" option.
1. Once your workflow is ready for production use, navigate to the `Deploy` button in the workflow editor.
2. Select the `Deploy to API` option.
3. You will receive a unique endpoint that you can execute via CURL.

## Sending Inputs
![deployments1](images/deployments1.png)

### Example cURL Request
## Sending inputs

### Example cURL request

```
curl -X POST --location "<http://salt-api-dev.getsalt.ai/api/v1/deployments/7824a62e-8222-454d-9ef4-bf1c7746fed4/executions/>" \\
curl -X POST --location "<https://salt-api-dev.getsalt.ai/api/v1/deployments/7824a62e-8222-454d-9ef4-bf1c7746fed4/executions/>" \\
-H "Content-Type: application/json" \\
-d '{ "callback": "<CALLBACK URL>" }'
```

### Example Request Body
### Example request body

```json
{
Expand All @@ -48,26 +50,25 @@ When the CURL command and the respective object are executed, you will receive t
}
```

## Salt Input Node
## SaltInput node

The Salt Input Node is an official node developed by the Salt team. This node allows you to expose input parameters of your workflow for end user consumption.
The `SaltInput` node is an official node developed by the Salt team. Each one present in the workflow allows you to expose input parameters for the end user to interact with.

<aside>
ℹ️ It is recommended to give the Salt Input Node a unique name for easier reference in your request body.

ℹ️ It is recommended to give each SaltInput node a unique name for easier reference when constructing your request body. If a node is unnamed, it will be named by its node id number, e.g. "14".
</aside>

### Supported Value Types
### Supported value types

- RAW Types: Strings, Integers, Float, Boolean
- Reference Types: URLs
- Asset: Base64 Image / Video Data
- `RAW`: Strings, Integers, Float, Boolean
- `Reference`: URLs
- `Asset`: Base64 Image / Video Data

## Receiving a response via webhook

As workflow run time can vary from seconds to minutes, the output will not be available immediately. To retrieve the final result, please provide a webhook for us to call when the results are ready.
As workflow run time can vary from seconds to minutes, the output will not be available immediately. To retrieve the final result, make sure to provide a `<CALLBACK URL>` webhook in the request body for us to call when the results are ready.

### Example Response
### Example response

```json
{
Expand All @@ -78,14 +79,18 @@ As workflow run time can vary from seconds to minutes, the output will not be av

## Troubleshooting

### Common Errors
### Common errors

- **Incorrect Input Structure:** If you provide an incorrect input structure in the curl command, an error message will be received.
- **Incorrect input structure:** If you provide an incorrect input structure in the curl command, you will receive an error message.

### Example Error Response
### Example error response

```json
{
"error": "Invalid input structure"
}
```

---

[API-draft1](https://www.notion.so/API-draft1-8e7e8ca522264238962c4d7e8285119c?pvs=21)
16 changes: 11 additions & 5 deletions docs/deploy-to-discord.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Deploying to Discord

With Salt, you can deploy and run your workflows through the `Salt AI bot`.
With Salt, you can deploy and run your workflows through the `Salt AI` Discord bot.

When you’re ready to deploy, select the `Deploy` button in the top right corner. You will be prompted to give your workflow a name. Choose a unique, descriptive slug – your workflow will be discoverable by any Discord user using the Salt AI bot – then click `Deploy`.

![deployments1](images/deployments1.png)

You will see a confirmation screen when your deployment is complete. You can click to copy your workflow name to your clipboard.
You will see a confirmation screen when your deployment is complete. You can click to copy the workflow command to your clipboard.

You can manage and turn off your deployments at any time in the Deployments tab of your dashboard.

Expand All @@ -32,15 +32,21 @@ In any server with the Salt AI bot added, use the `/workflows` command to open t

![discord3](images/discord3.png)

Once your workflow is selected, click `Run workflow` to open the prompt box. Enter your prompt and click `Submit`. Your output will be generated and appear in the thread or channel where you posted your message. You can also choose to set your workflow as your default every time you use the bot.
Once your workflow is selected, click `Run workflow` to execute it. You can then fill in the workflow's input values, one for each SaltInput node in your workflow. Enter your string & integer values and click `Submit`. If the workflow has image or file attachments, you will be prompted to upload them in your direct messages.
Once the required inputs are filled in, your workflow will execute, and the outputs will appear in the thread or channel where you posted your message when they are finished generating.

![discord4](images/discord4.png)

## Showcasing your workflows in the Salt catalog

To make your workflows discoverable to others in the community, first **[join the Salt Discord](https://discord.gg/saltai)** and complete onboarding.
To share your workflows with the others in the community, first **[join the Salt Discord](https://discord.gg/saltai)** and complete onboarding.

Then, head to the **[#flow-catalog](https://discord.gg/FcbmPDf3E7)** channel and follow the example template to share your workflow. Be sure to run it using the Salt AI bot in a comment below and pin the comment, so others can easily grab and run it themselves.
Then, head to the **[#flow-catalog](https://discord.gg/FcbmPDf3E7)** channel and follow the example template to share your workflow. Be sure to run it using the Salt AI bot in a comment below and pin the comment, so others can easily find it and run it themselves.

## Troubleshooting errors

Sometimes, executions can fail based on errors in the workflow, such as invalid API keys. To fix this, you may have to make adjustments to the workflow, or get in touch with our support team for help.
Connection errors may also result in failed generation, or results that won't return even if the workflow is valid. In this case, you can `right-click` (or tap-hold on mobile) > `Apps` and select `Retry`. The execution will be run again, and could return a successful result if the issue was related to connection.

## Need help?

Expand Down
Binary file modified docs/images/deployments1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/discord1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/discord2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/discord3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/discord4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 55fd0a9

Please sign in to comment.