Your First Midio App
Last updated
Was this helpful?
Last updated
Was this helpful?
In this guide you will learn how to set up a basic web API in Midio using several nodes from the Http package. , and let’s begin.
Create our API endpoint
Add a new endpoint by searching for Http Endpoint
in the .
Configure it to handle requests to /poem
with a query param named query
using the following path value: /poem?query
. Leave the other parameters at their default values.
Your Endpoint
node should look like this:
Responding to requests
Add an Http Response
node and hook it up to the endpoint node we added previously, in order to respond to requests. You can also add some dummy data to the body
input if you want.
Test our endpoint using ‘Http.Fetch’
The easiest way to test out our endpoint is to click “Go to app” button in the project header, and modify that url to target our new endpoint, which will be something like:
https://<your-project-name>.midio.dev:<port>/poem?query=testing
Add LLM Chat Complete
Add an instance of OpenAI Chat Complete
.
Give it a system message like: “Write a short haiku style poem based on the users request.”
Provide an API key
Add it to Midio as a secret
Add an instance of Get Environment Variable
, select our key from the dropdown menu, and connect it to the api key
input in our Chat Complete
node.
Connect the Chat Complete
node to our endpoint.
Congratulations! You've made your first AI-driven application in Midio. You can easily experiment with it directly from Midio using the Http FetchUrl
node, like so:
Check our our for recipes and examples of how common tasks, like , and looping is done in Midio.
The is a good place to look for definitive information about every aspect of Midio.
The section contains a comprehensive overview of all nodes available out of the box in Midio.