This topic was automatically generated from Slack. You can find the original thread here.
is there a way to connect to use pipedream to execute on GPT “actions” - I don’t have a zapier account and prefer not to get one
This topic was automatically generated from Slack. You can find the original thread here.
is there a way to connect to use pipedream to execute on GPT “actions” - I don’t have a zapier account and prefer not to get one
Yes, you can use Pipedream to execute actions with OpenAI’s GPT models without needing a Zapier account. Pipedream supports OpenAI as an integrated app, and you can interact with it using pre-built actions or by writing custom code within a Pipedream workflow. To use the pre-built OpenAI components in Pipedream: 1. Search for “OpenAI” in the Pipedream UI to find the available triggers and actions. 2. Choose the specific action you want to use, such as “Complete a prompt with GPT-3” or another GPT model. If you need to write custom code to interact with OpenAI’s GPT models, you can do so using a Node.js code step within a Pipedream workflow. Here’s an example of how you might write a custom Node.js code step to send a prompt to GPT-3 and receive a completion: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { openai: { type: "app", app: "openai", } }, async run({steps, $}) { const prompt = "Translate the following English text to French: 'Hello, world!'"; // Replace with your prompt return await axios($, { url: "https://api.openai.com/v1/engines/davinci/completions", method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${this.openai.$auth.api_key}`, }, data: { prompt: prompt, max_tokens: 150, }, }); }, });
Remember to replace the prompt
variable with the text you want to send to GPT-3. This code uses the axios
library provided by Pipedream to make an HTTP POST request to the OpenAI API. If you have any further questions or need assistance setting this up, please visit Pipedream’s support page.
just to confirm, are you building your own GPT and want to execute custom actions from that GPT? If so, yes.
In step 3 of this guide, the URL can point to a Pipedream workflow with an HTTP trigger. You can add auth to that endpoint (and configure that auth in the action settings in OpenAI), and have requests to /
return the OpenAPI spec documenting how the actions / endpoints work. Then the GPT will make requests to those endpoints, trigger your workflow, and you can run whatever logic you’d like within the workflow. Let me know if that helps.