import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
watsonx_ai: {
type: "app",
app: "watsonx_ai",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.watsonx_ai.$auth.region}.ml.cloud.ibm.com/ml/v4/deployments`,
headers: {
Authorization: `Bearer ${this.watsonx_ai.$auth.oauth_access_token}`,
},
params: {
version: `2023-07-07`,
},
})
},
})
WatsonX AI uses OAuth authentication. When you connect your WatsonX AI account, Pipedream will open a popup window where you can sign into WatsonX AI and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any WatsonX AI API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://iam.cloud.ibm.com/identity/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=urn:ibm:params:oauth:grant-type:apikey
&
apikey={{custom_fields.api_key}}
POST
https://iam.cloud.ibm.com/identity/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=urn:ibm:params:oauth:grant-type:apikey
&
apikey={{custom_fields.api_key}}