Integrate ChatGPT with 1,000 other apps
Today, we've released a new set of OpenAI actions:
- Chat — Interact with the Chat API
- Solve specific problems — Use actions to Summarize Text, Classify Items into Categories, and more.
- Create Transcription — Transcribe audio to text in any language
- Create Embeddings — Create embeddings for search, recommendations, and other relatedness problems.
These supplement the existing Create Image (DALL·E 2) and Create Completion actions.
AI adds intelligence to automations
ChatGPT and other AI products simplify all sorts of real-world tasks. With the right prompt, the output of these APIs can be magical. The models feel intelligent.
Their output can also be laughingly wrong. But most problems don't require perfect accuracy. When we summarize Slack posts to Discourse, we're OK with a few bad topic titles.
More than anything, it's just fun to play around with these tools.
Pipedream developers understand all of this. They've been building workflows to connect AI APIs to our 1,000+ other integrations. We want to simplify these integrations as much as possible. Pipedream actions are our preferred abstraction. They provide a UI for quickly connecting to any API, and you can extend them with code to implement custom logic.
Try the new Chat action here:
The Chat API uses the same
gpt-turbo-3.5 model that powers ChatGPT. It's faster, cheaper, and better than the existing completion models:
gpt-3.5-turboperforms at a similar capability to
text-davinci-003but at 10% the price per token, we recommend
gpt-3.5-turbofor most use cases.
To chat with the API, just provide a User Message:
You can also provide optional System Instructions, which guides the Chat API's output. For example,
"You are a REST API that returns JSON" instructs the chat message to return JSON, which can be used with other APIs in the same workflow. Or you can specify more general instructions, like
"You are a helpful assistant", to provide friendly output for humans.
The action returns the response in the
generated_message property, along with the
original_messages_with_assistant_response is especially useful. The OpenAI Chat docs say:
Because the models have no memory of past requests, all relevant information must be supplied via the conversation
When you use the ChatGPT web UI, it maintains this state for you. You can ask a series of questions about the same topic, and it will remember prior questions and answers. Since the Chat API doesn't keep this state, you have to pass prior chat responses in the Prior Message History prop:
You can continue to chain Chat actions to produce conversations, passing
original_messages_with_assistant_response in the Prior Message History each time. See this workflow for an example.
You can also set any of the optional params you would traditionally pass to the Chat API, like
max_tokens, and more:
Summarize, Categorize, and Translate any text
The Chat API is good at a lot of specific tasks. You can summarize text, classify items into categories, translate one language to another, and more. Copy these example workflows and modify for your use case:
We’ve built actions that perform each of these tasks. For example, the Summarize Text action can summarize any text. You can pass a max length for the summary, specify additional details ("Explain this like I’m 5"), and pass any params the OpenAI APIs support.
The actions output data in the JSON structure you'd expect. When you use the Classify Items into Categories action:
It returns JSON you can use in future steps:
Transcribe audio to text
The new Audio API uses the
whisper-1 model to transcribe audio into text.
You can provide either a URL to an audio file, or pass a path to a file you've saved from a previous step:
Copy this workflow to get started.
Build your own OpenAI actions
All Pipedream components — sources and actions — are hosted on our GitHub repo. For example, when you use the Chat action, you can find that code here.
We welcome all contributions: you can improve a prompt template, modify a prop description, or make any changes to the code. And you can add your own actions, too.
To add a new helper action like Translate Text, you just need to define a few methods:
userMessage define the instructions and prompt.
summary defines the summary displayed at the top of the action, and
formatOutput defines the data returned from the step: