Skip to content

Commit

Permalink
Merge pull request #16 from get-salt-AI/new-docs-theme-and-content
Browse files Browse the repository at this point in the history
New docs theme and content
  • Loading branch information
scottbaggett authored Jul 18, 2024
2 parents 7e402d2 + 1c57e87 commit f84387a
Show file tree
Hide file tree
Showing 23 changed files with 1,074 additions and 161 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ __pycache__/
# C extensions
*.so

material/
examples/
# Distribution / packaging
.Python
build/
Expand All @@ -25,7 +27,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST

.DS_Store
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down Expand Up @@ -157,4 +159,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/
61 changes: 61 additions & 0 deletions docs/concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Salt AI: Core Concepts

Welcome to Salt AI! This guide introduces you to the fundamental concepts and terminology you'll encounter while using our platform. Understanding these core concepts will help you navigate Salt AI more effectively and build powerful AI-driven applications.

## Workflows

[https://app.getsalt.ai/workflows](https://app.getsalt.ai/workflows)

A workflow is the central element in Salt AI. It's a visual representation of an AI-driven process, composed of interconnected nodes that define a series of operations.

**Key aspects of workflows:**

- Visual programming interface
- Modular and customizable
- Represent complex AI processes without coding

## Nodes

Nodes are the building blocks of workflows. Each node represents a specific function or operation within your AI process.

**Types of nodes include:**

- Input nodes (e.g., SaltInput)
- Processing nodes
- AI model nodes
- Output nodes (e.g., SaltOutput)

## Connections

Connections are the links between nodes that define how data flows through your workflow. They determine the order of operations and how information is passed from one node to another.

## AI Models

AI models are pre-trained machine learning models that can be integrated into your workflows. Salt AI supports various types of models for tasks such as:

- Image generation
- Natural language processing
- Audio processing
- And more

## Inputs and Outputs

- **Inputs:** Data or parameters that your workflow processes. These can be defined using SaltInput nodes.

- **Outputs:** The results produced by your workflow, typically generated by SaltOutput nodes.

## Execution

Execution is the process of running a workflow. During execution, data flows through the nodes in your workflow, with each node performing its designated operation.

## Workflow Sharing

Salt AI enables easy workflow sharing through:

- JSON export of entire workflows
- Embedding workflow data in output images
- Drag-and-drop recreation of workflows from output images

Understanding these core concepts will provide you with a solid foundation for working with Salt AI. As you explore the platform, you'll discover how these elements work together to create powerful, flexible AI applications.

For more detailed information on any of these concepts, please refer to our comprehensive documentation or reach out to our community support forums.
108 changes: 65 additions & 43 deletions docs/deploy-to-api.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
# Deploying workflows via Salt API
# Deploying Workflows via Salt API

## 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.
The `Deploy to API` feature in Salt AI allows you to transform your workflows into production-ready APIs, enabling seamless integration of advanced AI capabilities into your applications.

- **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.
Key benefits:

## Deploying to API

1. Once your workflow is [ready for production use](https://docs.getsalt.ai/workflows/#preparing-your-workflow-for-deployment), 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.
- **Scalability:** Your deployment can handle increasing loads without compromising performance.
- **Accessibility:** Simplify the complex process of deploying an AI workflow with a single click.
- **Speed:** Lightning-fast deployments enable rapid iteration of workflows.

![deployments1](images/deployments1.png)
## Deploying to API

<aside>
ℹ️ The most recent job execution must be successful in order to proceed with deployment.
</aside>
1. Ensure your workflow is [ready for production use](https://docs.getsalt.ai/workflows/#preparing-your-workflow-for-deployment).
2. In the workflow editor, locate and click the `Deploy` button.
3. Select the `Deploy to API` option.
4. You'll receive a unique endpoint for executing your workflow via API calls.

## Sending inputs
![Deployment Process](images/deployments1.png)

### Example cURL request
> **Note:** The most recent job execution must be successful to proceed with deployment.
```
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>" }'
```
## Making API Requests

### Example request body
### Example cURL Request

```json
{
"callback": "<CALLBACK URL>",
```bash
curl -X POST https://salt-api-dev.getsalt.ai/api/v1/deployments/7824a62e-8222-454d-9ef4-bf1c7746fed4/executions/ \
-H "Content-Type: application/json" \
-d '{
"callback": "https://your-callback-url.com",
"workflow_input": {
"input_name": {
"value": "My text input",
Expand All @@ -45,56 +40,83 @@ curl -X POST --location "<https://salt-api-dev.getsalt.ai/api/v1/deployments/782
"url": "https://imageurl.com/my-image.png"
},
"value_type": "REFERENCE"
}
}
}'
```

### Request Body Structure

```json
{
"callback": "<CALLBACK URL>",
"workflow_input": {
"<input_name>": {
"value": "<input_value>",
"value_type": "<RAW|REFERENCE|ASSET>"
},
...
}
}
```

When the CURL command and the respective object are executed, you will receive this response:
### Response to API Request

Upon successful submission, you'll receive a response containing the execution ID:

```json
{
"execution_id": "d919a4b6-01cc-4e1a-ad7a-c59a066576b8"
}
```

## SaltInput node
## Understanding the SaltInput Node

The `SaltInput` node allows you to expose input parameters for end-user interaction within your workflow. Each one represents an input property in the `workflow_input` object of your API call's request body.
The `SaltInput` node is crucial for exposing input parameters in your workflow. Each `SaltInput` node corresponds to an input property in the `workflow_input` object of your API request.

<aside>
ℹ️ 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>
> **Best Practice:** Assign unique names to each `SaltInput` node for easier reference in your API requests. Unnamed nodes will use their node ID (e.g., "14") as the input name.
### Supported value types
### Supported Value Types

- `RAW`: Strings, Integers, Float, Boolean
- `Reference`: URLs
- `Asset`: Base64 Image / Video Data
1. `RAW`: For basic data types (Strings, Integers, Floats, Booleans)
2. `REFERENCE`: For URL inputs
3. `ASSET`: For Base64-encoded image or video data

## Receiving a response via webhook
## Receiving Results via Webhook

Workflow run times can vary from seconds to minutes. To manage this, Salt delivers results asynchronously via a webhook. Provide a callback URL to receive the final results once they are ready.
Due to varying execution times, Salt AI delivers results asynchronously through a webhook. Provide a callback URL in your request to receive the final results.

### Example response
### Example Webhook Response

```json
{
"output_name": ["<https://storage.googleapis.com/>....."],
"output_name": ["https://storage.googleapis.com/...."],
"execution_id": "d919a4b6-01cc-4e1a-ad7a-c59a066576b8"
}
```

## Troubleshooting

### Common errors
### Common Errors

- **Incorrect input structure:** If you provide an incorrect input structure in the curl command, you will receive an error message.
1. **Invalid Input Structure:** Occurs when the request body doesn't match the expected format.
2. **Missing Callback URL:** Ensure you provide a valid callback URL for receiving results.
3. **Deployment Not Found:** Check that you're using the correct deployment ID in your API endpoint.

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

```json
{
"error": "Invalid input structure"
"error": "Invalid input structure",
"details": "Missing required field 'workflow_input'"
}
```

## Best Practices

1. **Input Validation:** Implement thorough input validation in your workflow to handle unexpected inputs gracefully.
2. **Error Handling:** Design your workflow to handle potential errors and provide meaningful error messages.
3. **Versioning:** Consider implementing versioning for your deployed APIs to manage changes over time.
4. **Monitoring:** Use Salt AI's monitoring tools to track the performance and usage of your deployed workflows.

By following this guide, you can effectively deploy your Salt AI workflows as scalable, production-ready APIs. For further assistance or advanced use cases, please refer to our additional documentation or contact our support team.
66 changes: 34 additions & 32 deletions docs/deploy-to-discord.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,55 @@
# Deploying and running workflows on Discord
# Deploying and Running Workflows on Discord

## Deploying to Discord

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`.
Salt AI offers a unique feature that allows you to deploy and run your workflows through the `Salt AI` Discord bot. This guide will walk you through the process of deploying your workflows to Discord and using them within the Discord platform.

![deployments1](images/deployments1.png)

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.
## Deploying to Discord

![deployments2](images/deployments2.png)
When you're ready to deploy your workflow to Discord:

Salt’s Discord integration lets you easily put your workflows in the hands of real users as lightweight applications with no front-end development required. Keep reading to learn how.
1. Click the `Deploy` button in the top right corner of the workflow editor.
2. You'll be prompted to give your workflow a name. Choose a unique, descriptive slug – this will be how users discover your workflow through the Salt AI bot.
3. Click `Deploy` to finalize the process.

## Installing the Salt AI Discord bot
After successful deployment, you'll see a confirmation screen. You can copy the workflow command to your clipboard from this screen.

You can easily add the Salt AI bot to any server or to your own account (accessible by DM) by selecting the `Add to Server` button [here](https://discord.com/oauth2/authorize?client_id=1113909066587185274) or on the deployment confirmation screen.
You can manage and deactivate your deployments at any time in the Deployments tab of your dashboard.

![discord1](images/discord1.png)
## Installing the Salt AI Discord Bot

![discord2](images/discord2.png)
To use Salt AI workflows in Discord:

## Running workflows in Discord
1. Go to the [Salt AI bot authorization page](https://discord.com/oauth2/authorize?client_id=1113909066587185274).
2. Click the `Add to Server` button.
3. Select the server where you want to add the bot, or choose to add it to your direct messages.

Once your workflow has been deployed to Discord, it is ready to be used by you and other users.
## Running Workflows in Discord

In any server with the Salt AI bot added, use the `/workflows` command to open the directory. You can enter the name of your workflow directly, copy and paste it, or simply type the `/workflows` command with your workflow’s name (example: `/workflow sample-workflow`) in the chat field to get started.
Once your workflow is deployed and the Salt AI bot is added to your server:

![discord3](images/discord3.png)
1. Use the `/workflows` command in any channel where the bot is present.
2. You can directly enter your workflow's name or use the command format `/workflow your-workflow-name`.

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.
3. Click `Run workflow` to execute it.
4. Fill in the required input values (one for each `SaltInput` node in your workflow).
5. For image or file attachments, you'll be prompted to upload them in your direct messages.
6. After submitting all inputs, your workflow will execute, and the outputs will appear in the original thread or channel.

![discord4](images/discord4.png)
## Showcasing Your Workflows

## Showcasing your workflows in the Salt catalog
To share your workflows with the Salt AI community:

To share your workflows with the others in the community, first **[join the Salt Discord](https://discord.gg/saltai)** and complete onboarding.
1. Join the [Salt Discord](https://discord.gg/saltai) and complete onboarding.
2. Go to the [#flow-catalog](https://discord.gg/FcbmPDf3E7) channel.
3. Follow the example template to share your workflow.
4. Run your workflow using the Salt AI bot in a comment and pin the comment for easy access.

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

## Troubleshooting errors
- If executions fail due to workflow errors (e.g., invalid API keys), you may need to adjust your workflow or contact our support team.
- For connection errors, you can retry the execution by right-clicking (or tap-holding on mobile) > `Apps` > `Retry`.

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](https://discord.com/channels/1151592612525002822/1212167911771217961) 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?

## Need help?
If you encounter any issues or have questions about the Discord deployment feature, please reach out to our team via the [#support](https://discord.com/channels/1151592612525002822/1212167911771217961) channel in our Discord.

This guide is based on the beta version of Salt. Should you run into any issues or have questions, get in touch with our team via the [#support](https://discord.com/channels/1151592612525002822/1212167911771217961) channel in our Discord.
Salt's Discord integration allows you to easily share your workflows with real users as lightweight applications, without the need for front-end development. This feature bridges the gap between AI development and user interaction, making your AI applications more accessible and interactive.
Loading

0 comments on commit f84387a

Please sign in to comment.