From 59bf4e52c19bc3b851fdc5d474829bd6c24c5557 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 21 May 2025 22:24:49 -0700 Subject: [PATCH 1/5] Update openai.mdx --- docs-v2/pages/connect/mcp/openai.mdx | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/docs-v2/pages/connect/mcp/openai.mdx b/docs-v2/pages/connect/mcp/openai.mdx index 0368d486d2179..7356de04633b6 100644 --- a/docs-v2/pages/connect/mcp/openai.mdx +++ b/docs-v2/pages/connect/mcp/openai.mdx @@ -143,3 +143,82 @@ curl -X POST https://api.openai.com/v1/chat/completions \ + +## Testing in OpenAI's API Playground + +OpenAI provides an API playground for developers to test prompts and tool calling: +[https://platform.openai.com/playground/prompts](https://platform.openai.com/playground/prompts?models=gpt-4.1) + +1. Navigate to [OpenAI's playground](https://platform.openai.com/playground/prompts?models=gpt-4.1) and sign in with your OpenAI account +2. Click the **Create** button in the **Tools** section, then select **Pipedream** +3. You'll need to these inputs to get set up: + +- [Pipedream project ID](#copy-your-project-id) +- [Pipedream environment](#define-the-environment) +- [Developer access token](#generate-an-access-token) + + + +### Copy your project ID + +1. Open an existing Pipedream project or create a new one at [pipedream.com/projects](https://pipedream.com/projects) +2. Click the **Settings** tab, then copy your **Project ID** + +### Define the environment + +- Since you're testing for yourself, you should use `development` +- Use `production` when you're ready to ship your app to users + +### Generate an access token + +**First, create an OAuth client in Pipedream:** + +1. Visit the [API settings](https://pipedream.com/settings/api) for your workspace +2. Click the **New OAuth Client** button and give it a name +4. Copy the client ID and secret + +**Next, get an access token:** + +In the client credentials model, as a developer, you exchange your OAuth client ID and secret for a short-lived access token to make API requests. + + + +```javascript +import { createBackendClient } from "@pipedream/sdk/server"; + +// Initialize the Pipedream SDK client +const pd = createBackendClient({ + environment: PIPEDREAM_ENVIRONMENT, + credentials: { + clientId: PIPEDREAM_CLIENT_ID, + clientSecret: PIPEDREAM_CLIENT_SECRET, + }, + projectId: PIPEDREAM_PROJECT_ID +}); + +const accessToken = await pd.rawAccessToken(); + +console.log(accessToken); +``` + + +```bash +curl https://api.pipedream.com/v1/oauth/token \ + -H 'Content-Type: application/json' \ + -d '{ + "grant_type": "client_credentials", + "client_id": "", + "client_secret": "" + }' +``` + + + + + +### Playground limitations + +- The server URL that's defined in OpenAI's playground uses two static fields. In practice, you'll define those dynamically in your app: + - `external_user_id`: `demo-openai-user-123` + - `app_slug`: `google_calendar` +- You'll also define the `project_id` and `pipedream_environment` in you env once, then use the Pipedream SDK or REST API to get a fresh access token. \ No newline at end of file From 99c3e9a2d35e1078217871b88eca0b07d2bf1403 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 21 May 2025 22:40:03 -0700 Subject: [PATCH 2/5] Update openai.mdx --- docs-v2/pages/connect/mcp/openai.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs-v2/pages/connect/mcp/openai.mdx b/docs-v2/pages/connect/mcp/openai.mdx index 7356de04633b6..bcda294305acf 100644 --- a/docs-v2/pages/connect/mcp/openai.mdx +++ b/docs-v2/pages/connect/mcp/openai.mdx @@ -151,7 +151,7 @@ OpenAI provides an API playground for developers to test prompts and tool callin 1. Navigate to [OpenAI's playground](https://platform.openai.com/playground/prompts?models=gpt-4.1) and sign in with your OpenAI account 2. Click the **Create** button in the **Tools** section, then select **Pipedream** -3. You'll need to these inputs to get set up: +3. You'll need these inputs to get set up: - [Pipedream project ID](#copy-your-project-id) - [Pipedream environment](#define-the-environment) @@ -160,7 +160,7 @@ OpenAI provides an API playground for developers to test prompts and tool callin ### Copy your project ID - + 1. Open an existing Pipedream project or create a new one at [pipedream.com/projects](https://pipedream.com/projects) 2. Click the **Settings** tab, then copy your **Project ID** @@ -175,7 +175,7 @@ OpenAI provides an API playground for developers to test prompts and tool callin 1. Visit the [API settings](https://pipedream.com/settings/api) for your workspace 2. Click the **New OAuth Client** button and give it a name -4. Copy the client ID and secret +3. Copy the client ID and secret **Next, get an access token:** @@ -207,8 +207,8 @@ curl https://api.pipedream.com/v1/oauth/token \ -H 'Content-Type: application/json' \ -d '{ "grant_type": "client_credentials", - "client_id": "", - "client_secret": "" + "client_id": "", + "client_secret": "" }' ``` @@ -221,4 +221,4 @@ curl https://api.pipedream.com/v1/oauth/token \ - The server URL that's defined in OpenAI's playground uses two static fields. In practice, you'll define those dynamically in your app: - `external_user_id`: `demo-openai-user-123` - `app_slug`: `google_calendar` -- You'll also define the `project_id` and `pipedream_environment` in you env once, then use the Pipedream SDK or REST API to get a fresh access token. \ No newline at end of file +- You'll also define the `PIPEDREAM_PROJECT_ID` and `PIPEDREAM_ENVIRONMENT` in you environment once, then use the Pipedream SDK or REST API to get a fresh access token. \ No newline at end of file From d511c664c2c91012cceea9b41e2893095cd7b1d4 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 21 May 2025 22:40:22 -0700 Subject: [PATCH 3/5] Merge branch 'danny/mcp-openai-docs' of github.com:PipedreamHQ/pipedream into danny/mcp-openai-docs From 8ae0b5da5bcf80ee48f7b737af0c3980ac86c409 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 21 May 2025 22:40:25 -0700 Subject: [PATCH 4/5] Update pnpm-lock.yaml --- pnpm-lock.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04caccdb3f1e9..b68571f6d6bd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11468,8 +11468,7 @@ importers: specifier: ^1.4.1 version: 1.6.6 - components/scrapecreators: - specifiers: {} + components/scrapecreators: {} components/scrapegraphai: dependencies: @@ -15455,6 +15454,14 @@ importers: specifier: ^6.0.0 version: 6.2.0 + modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/cjs: {} + + modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/esm: {} + + modelcontextprotocol/node_modules2/zod-to-json-schema/dist/cjs: {} + + modelcontextprotocol/node_modules2/zod-to-json-schema/dist/esm: {} + packages/ai: dependencies: '@pipedream/sdk': From b740f082e966dc98ff6a1efa2832bc24682040ed Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 21 May 2025 22:44:17 -0700 Subject: [PATCH 5/5] Update openai.mdx --- docs-v2/pages/connect/mcp/openai.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/connect/mcp/openai.mdx b/docs-v2/pages/connect/mcp/openai.mdx index bcda294305acf..b857977e928a2 100644 --- a/docs-v2/pages/connect/mcp/openai.mdx +++ b/docs-v2/pages/connect/mcp/openai.mdx @@ -208,7 +208,7 @@ curl https://api.pipedream.com/v1/oauth/token \ -d '{ "grant_type": "client_credentials", "client_id": "", - "client_secret": "" + "client_secret": "" }' ``` @@ -221,4 +221,4 @@ curl https://api.pipedream.com/v1/oauth/token \ - The server URL that's defined in OpenAI's playground uses two static fields. In practice, you'll define those dynamically in your app: - `external_user_id`: `demo-openai-user-123` - `app_slug`: `google_calendar` -- You'll also define the `PIPEDREAM_PROJECT_ID` and `PIPEDREAM_ENVIRONMENT` in you environment once, then use the Pipedream SDK or REST API to get a fresh access token. \ No newline at end of file +- You'll also define the `PIPEDREAM_PROJECT_ID` and `PIPEDREAM_ENVIRONMENT` in your environment once, then use the Pipedream SDK or REST API to get a fresh access token. \ No newline at end of file