Access 200+ AI Models with a Single AI API
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
ai_ml_api: {
type: "app",
app: "ai_ml_api",
}
},
async run({steps, $}) {
const data = {
"model": "mistralai/Mistral-7B-v0.1",
"messages": [
{
"role": "system",
"content": "You are an AI assistant who knows everything.",
},
{
"role": "user",
"content": "Tell me, why is the sky blue?"
},
]
}
return await axios($, {
method: "POST",
url: `https://api.aimlapi.com/chat/completions`,
headers: {
Authorization: `Bearer ${this.ai_ml_api.$auth.api_key}`,
},
data,
})
},
})
The ServiceNow API lets developers access and manipulate records, manage workflows, and integrate with other services on its IT service management platform. These capabilities support automating tasks, syncing data across platforms, and boosting operational efficiencies.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
servicenow: {
type: "app",
app: "servicenow",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.servicenow.$auth.instance_name}.service-now.com/api/now/table/incident`,
headers: {
Authorization: `Bearer ${this.servicenow.$auth.oauth_access_token}`,
},
})
},
})