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 Schedule app in Pipedream is a powerful tool that allows you to trigger workflows at regular intervals, ranging from every minute to once a year. This enables the automation of repetitive tasks and the scheduling of actions to occur without manual intervention. By leveraging this API, you can execute code, run integrations, and process data on a reliable schedule, all within Pipedream's serverless environment.