Knowledge Base

Search the Knowledge Base

Build a ChatGPT App in 10 Minutes or Less

In this video, we'll show you how to build an app for the new ChatGPT Apps SDK in just a few minutes, without having to write any code yourself. Using Xano's visual builder, you can quickly spin up an MCP server to pass your data into components that users can interact with inside of ChatGPT. Install the template and use this example right away: https://www.xano.com/snippet/uPUYjvwn Chapters 00:00 Intro 00:37 What data are we working with? 01:20 Creating an MCP Server 01:48 The Data Tool (gets the data to show) 03:26 The Resource Tool (serves the UI to ChatGPT) 05:19 Connect the Tools & Final Setup 06:54 Demo 09:01 Outro Xano - The AI-first Visual Backend Dev Platform https://www.xano.com X https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Collaborative Drawing in Minutes Using Xano

Build a real-time collaborative drawing app in minutes with Xano. In this tutorial, I’ll show you how to go from “just a database” to powering websockets, authentication, file storage, and live image sharing. We’ll create tables, endpoints, and a real-time channel in Xano, then connect it to a frontend built with a free Cursor agent. Watch as two users draw together on the same canvas, save images, and pull them back from the database—all with just a few button clicks. 👉 Perfect for devs who want to see how Xano handles more than data. 👉 Learn how to set up real-time websockets, authentication, and Swagger-ready endpoints. 👉 See how easy it is to spin up collaborative apps with Cursor + Xano. 🔗 Try it out and start building your own collaborative tools today. Chapters 00:00 Xano beyond a database: collaborative drawing app demo 00:21 Setup: images table, real-time websockets, channel + triggers 02:37 API endpoints: upload image, fetch images, authentication + Swagger docs 05:22 Frontend with Cursor: prompt, SDK, testing collaborative canvas Xano - The Fastest No Code Backend Dev Platform https://www.xano.com X https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Getting AI to CALL your leads for you? | @elevenlabsio + @twilio + Xano

@elevenlabsio has incredible voice capabilities. @twilio brings reliable phone connectivity. With Xano, we can combine both to create something powerful—agents that actually talk with users over the phone. In this tutorial, I’ll show you how to: Use Xano’s Agent Builder to connect ElevenLabs + Twilio Set up inbound and outbound calls that trigger real-time agents Keep everything simple with Xano’s no-code backend 👉 Perfect for developers and builders who want to add voice AI to real phone calls. 👉 See how to move from setup to live testing in just a few steps. 🔗 Try it yourself and start creating phone agents powered by Xano today. https://www.xano.com/snippet/zMgFEwec Chapters 00:00 Overview and prerequisites 00:37 ElevenLabs agent + webhooks setup 04:01 Xano backend: DB, pre/post handlers, HMAC, analysis/feedback 20:42 Calling flow (outbound/inbound), knowledge base Xano - The Fastest No Code Backend Dev Platform https://www.xano.com X https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Collaborative Drawing in Minutes Using Xano

Build a real-time collaborative drawing app in minutes with Xano. In this tutorial, I’ll show you how to go from “just a database” to powering websockets, authentication, file storage, and live image sharing. We’ll create tables, endpoints, and a real-time channel in Xano, then connect it to a frontend built with a free Cursor agent. Watch as two users draw together on the same canvas, save images, and pull them back from the database—all with just a few button clicks. 👉 Perfect for devs who want to see how Xano handles more than data. 👉 Learn how to set up real-time websockets, authentication, and Swagger-ready endpoints. 👉 See how easy it is to spin up collaborative apps with Cursor + Xano. 🔗 Try it out and start building your own collaborative tools today. Chapters 00:00 Xano beyond a database: collaborative drawing app demo 00:21 Setup: images table, real-time websockets, channel + triggers 02:37 API endpoints: upload image, fetch images, authentication + Swagger docs 05:22 Frontend with Cursor: prompt, SDK, testing collaborative canvas Xano - The Fastest No Code Backend Dev Platform https://www.xano.com X https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Dynamic Agent Flows Made Easy | Agent Triggers

In this video, we'll show you an extension of the AI Agent Conversation History template, allowing you to have dynamic agent responses based on user data. For example, if a user is past due on their subscription, their chatbot features can be limited, while still giving an opportunity to retain the user. If you haven't seen the first video going over the AI Agent Conversation History template, check it out and install the template here: https://youtu.be/v5J16VYG-CA?feature=shared Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

AI Agent Observability | Free Xano Template

In this video, we'll showcase our new AI Agent Observability snippet, designed to give you super easy monitoring of your Agents built in Xano. Use the included Agent Dashboard, hosted right inside of your Xano instance, and get a birds-eye view into all of your agentic workflows in just a few minutes. Install the Snippet: https://www.xano.com/snippet/LyKzUNP9 Chapters 00:00 Intro 00:16 Using the Snippet (https://www.xano.com/snippet/LyKzUNP9) 04:31 Using the included Agent Dashboard 08:39 Recap & Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

AI Agent Conversation History | Free Xano Template

In this video, we'll go over using a snippet for Agents, designed to provide conversation history functionality right out of the box, as well as a working chatbot example that you can use in your Xano application right away. Install the snippet here: https://www.xano.com/snippet/rmFsF785/ 00:00 Intro 00:20 Using The Snippet 02:47 Using the Chatbot Example 03:55 Storing and Retrieving Conversation History 05:03 Extending the Example 05:54 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Quick and Easy Performance Insights

Performance Insights in Xano allow you to review the performance of specific function stacks, function types, and even individual functions, to help you more easily audit and take action to improve the performance of your application. Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Easy Array Manipulation in Xano | No more loops or Lambdas required!

We've introduced some new functions in Xano to help make the process of data manipulation in arrays so much easier. No longer are you forced to use time-consuming loops or complicated Lambda functions and filters to achieve drastic data transformation -- just use our new Map, Partition, or other new array functions in the visual builder today. Chapters 00:00 Intro 00:46 Map 02:00 Partition 02:47 Group By 04:12 Difference / Intersection / Union 06:39 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Reasoning vs Non-reasoning Models in Xano | Claude vs Gemini vs ChatGPT

** At the time of recording, GPT-5 was unavailable for use. Subscribe to Xano's YouTube channel for a continuation of this video, pitting the winner against GPT-5, very soon. Chapters 00:00 Intro 00:52 The Models and The Benchmark 04:13 What can the Agents do? 05:13 The Results 11:37 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Learn how to set up agentic AI flows in your CRM with WeWeb & Xano

Agentic CRM: Learn how to set up agentic AI flows in your CRM with #Xano and #WeWeb What we built in part 1: Single-tool chatbot over MCP in CRM If you missed it, check it out on WeWeb's channel here: https://www.youtube.com/live/pIbFhLfzcW0?feature=shared What we're upgrading to: CRM Copilot - Multi-agent system with tool chaining - Xano Agents architecture overview - New Agent tools to supercharge your CRM with Hunter.io, Exa.ai, and more! - WeWeb front-end magic showing agent tool visibility and smart navigation for seamless user experience (UX)

Go Beyond Chat: Visualize and Act on Your Data with Xano and Thesys

Application UI is changing dramatically. We’re entering a new era, one that moves away from static and generic interfaces into adaptive, personalized experiences. Join Daniel Petro, Developer Advocate, Xano, and Shawn Charles, Developer Advocate, Thesys, for a 60-minute session exploring the power of AI chatbots for database insights, specifically within the real estate sector. Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Using Agent Orchestration to Qualify Sales Leads

If you haven't watched Part 1 yet, check that out first: https://youtu.be/nJi9jnecLxU Agent Orchestration is the concept of building multiple AI agents, and having a single "Orchestration Agent" that can harness all of your individual, single-task agents to complete larger or more complex workflows automatically. In this video, Cameron will be carrying on the example of qualifying sales leads from our previous AI Agents video, and showing you how you can use Agent Orchestration in Xano to further automate your sales motions. 00:00 Intro 00:52 Review & Setup 01:55 Building a Web Search Agent 05:55 Building the Orchestration Agent 10:25 Using the Orchestration Agent 12:08 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Superpowered Sales Motions with Custom AI Agents

Chapters 00:00 Intro 00:54 Set-up and Data Walkthrough 02:36 Building your AI Agent 05:39 Creating AI Tools 10:41 Using the Agent 13:14 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Private AI for Security & Compliance | Deploy Ollama in Your Xano Instance

Tired of expensive API calls and worried about data privacy? In this comprehensive tutorial, we'll show you how to deploy Ollama as a microservice inside your Xano instance, giving you complete control over your AI models, while dramatically reducing costs. Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Tenant Center | Easy CI/CD and SaaS Scaling in Xano

Xano's Tenant Center is a game-changer for SaaS apps and teams collaborating together in our Visual Development environment. Use it to set up separate Dev, Stage, and Production environments, create isolated tenant databases, and easily deploy releases and new features to your users Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

AI Tools for Agents & MCP Servers

Want to learn more about MCP in Xano? ▶️ Playlist - https://www.youtube.com/playlist?list=PLOch5nUqQ_Y5jCKpaXiRLpOpxGhIwz0zV 📑 Docs - https://docs.xano.com/ai-tools/ Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Intro to AI Agents in Xano

Chapters 00:00 Intro / AI Agents Explained 02:26 Building your First Agent 05:52 Tools 07:08 Calling your AI Agent 08:21 Demo 10:41 Outro Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Custom Functions | Building Reusable Logic and Components in Xano

Xano - The Fastest No Code Backend Dev Platform https://go.xano.co/2SHxjxh Twitter https://x.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Part 2 - Deep Dive: MCP for Building Connected AI Agents

Did you miss Part 1? Check it out here: https://youtube.com/live/x-Dn54l9Bds?feature=share Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Outgoing Static IP for Unsupported Regions Proxy Guide

As some of you may be aware, while we do offer outgoing Static IP to some regions, it isn't available everywhere quite yet, so I'm writing a step-by-step guide on how to roll your own proxy, with a static IP, that you can use to funnel external API requests through that require a whitelisted IP address. Please note that this guide is not for the faint of heart and can get pretty technical. We are unable to troubleshoot any issues that may arise from using this guide, but if you have any questions feel free to reply to this thread and I'll do my best! If you're familiar with this process and have any concerns, corrections, or additions please let me know. I'm not a network administrator; just a friendly marketing team member trying to share some hopefully helpful info. Proceed at your own risk. What You'll Need A DigitalOcean account (use this link to get $200 in credit over 60 days once you spend $25) A domain name (It is highly recommended that you utilize a subdomain with some sort of obfuscated address. Just mash your keyboard a bit.) A cup of coffee ☕ Step-by-step In your DigitalOcean account, choose Droplets from the left-hand menu, and choose Create Droplet. Set up your droplet with the following settings: Your region and datacenter of choice Ubuntu OS, version 20.04 LTS x64 Droplet Type: Basic CPU Options: Regular, 1 CPU / 1 GB RAM Note that you may need to scale up your droplet depending on the volume of traffic. Your authentication method of choice. SSH key is a little more complex to set up, but also more secure. If you choose an SSH key, follow Digital Ocean's guide for how to generate that key. Click Create Droplet at the bottom of the page. In the left-hand menu, choose Networking > Reserved IPs Click Add a Reserved IP Choose Assign to Droplet, select your newly created droplet from the drop(let)-down menu, and confirm your selection. Head over to your domain registrar, and set up the following DNS settings. Record Type: A Host: 'proxy' or whatever subdomain you'd like to use Address: the new reserved IP of your droplet TTL: As fast as possible 🏎️ Head back to the Droplets section and click on the droplet you created earlier. On the next page, choose Access > Launch Droplet Console Copy and paste the following into the console. The commands should immediately begin executing. This will take a minute, so sit back and enjoy the show (and that cup of coffee we talked about.) apt update && apt upgrade -y apt install apt-transport-https ca-certificates curl software-properties-common -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" apt update apt install docker-ce -y Note: If you see a message about OpenSSH configuration, just press Enter to proceed. Once it's done, you'll be back at the prompt and ready to copy and paste some more. Copy and paste the following, same as before. This one should only take a second. Note that you may need to execute the last command separately -- if you see it just hanging out in your prompt, just press enter to run it. curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose Now that we have all the software installed that we need, let's make a folder for our proxy server files to live in. mkdir proxy_server && cd proxy_server Creating the Configuration Files Paste the following into your terminal and press enter (if necessary). nano Dockerfile This opens a program called 'nano', which is a horrific text editing experience that Linux nerds (respectfully) love. I'll make it as easy as I can! Just copy and paste the following code into your terminal. FROM nginx:alpine RUN apk add --no-cache nginx-mod-http-js openssl COPY nginx.conf /etc/nginx/nginx.conf COPY proxy.js /etc/nginx/proxy.js EXPOSE 443 CMD ["nginx", "-g", "daemon off;"] Press Crtl + X, then type Y and press enter. Let's do it again! nano nginx.conf Here's the content to paste. In this part, you'll need to replace proxy.example.com with the domain you're using. You can do this in nano (painfully) by using the arrow keys to navigate around, or just do it in your own text editor of choice and copy/paste from there. Note that you'll need to replace this in three spots: server_name, ssl_certificate, and ssl_certificate key load_module modules/ngx_http_js_module.so; events { worker_connections 1024; } http { js_import proxy.js; server { listen 443 ssl; server_name proxy.example.com; # Change to your subdomain ssl_certificate /etc/letsencrypt/live/proxy.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/proxy.example.com/privkey.pem; location / { js_content proxy.handleRequest; } } } Crtl + X, Y, and then enter. Again! nano proxy.js async function handleRequest(r) { const targetUrl = r.headersIn['X-Target-URL']; if (!targetUrl) { r.return(400, "X-Target-URL header is required"); return; } try { const response = await ngx.fetch(targetUrl, { method: r.method, headers: r.headersIn, body: r.requestBody }); r.headersOut['Content-Type'] = response.headers.get('Content-Type'); r.return(response.status, await response.text()); } catch (error) { r.return(500, `Error: ${error.message}`); } } export default {handleRequest}; One more time! nano docker-compose.yml version: '3' services: proxy: build: . ports: - "443:443" volumes: - /etc/letsencrypt:/etc/letsencrypt restart: unless-stopped More commands to paste! You might need to hit 'enter' on the last one. In these commands, we're just setting up some firewall rules. You'll have to confirm your changes with 'y' when prompted. ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw enable Now, we're going to set up an SSL certificate, which is required to make sure your connection to the proxy is secure. Make sure to replace your domain name in the second command before executing. You'll be asked a few questions to generate the certificate; pretty simple stuff. apt install certbot python3-certbot-nginx -y certbot --nginx -d proxy.example.com # Replace with your subdomain Finally, we'll build and run our proxy server. docker-compose up -d If all goes well... ...you should be ready to go! Head over to Xano, and create an External API Request. You'll send a request to your proxy, and send a header of X-Target-URL with the link the proxy should forward the request to. Give it a shot! If it didn't go well... That's okay! It might be hard for me to provide direct support on this, but I'll do my best! Is this secure? Relatively. There are more advanced options that you should probably consider implementing (that are outside of the scope of this guide) such as rate limiting and authentication. That being said, if your subdomain is obscure enough and you aren't sending client facing requests directly to it, it's safe by obscurity if nothing else.

Migrating Adalo Data to Xano

What's Happening? With Adalo's recent announcement regarding sunsetting their free plan, we wanted to make sure that the Adalo community had a place to send their data before servers are shut down, if you choose to not upgrade to a paid Adalo subscription or the new Maintenance Mode tier at this time. What are my options? Xano offers a free plan that allows up to 100,000 records. You'll have plenty of space to import your Adalo data while you determine next steps. Why use Xano for my data? Xano acts as the entire backend for your website or app. Adalo currently offers collections and limited conditional functionality when using Adalo by itself. Xano offers the same functionality as collections by giving you not only a place to store your data, but a visual API builder, enabling you to put together any sort of additional functionality you might need to power your app. The best part is that Xano is completely decoupled from whatever frontend you decide to use. This means that you will never be impacted by something like this again, and if you ever need to move to a new frontend, or you want to expand to multiple frontends, all you need to do is connect it to your existing Xano backend, and you're ready to go. Migrating Adalo data to Xano Create a free account at xano.com Click "Get Started for Free" and follow the instructions to create your free Xano account! Export your Adalo data Choose your collection, click the Records button, and download your data as CSV. Import your CSVs into Xano Xano can take a CSV and generate a database table for you while importing all of the data. Head over to the Database section from the left-hand menu Click Add Table and choose Import Data Choose the CSV option Select your CSV and review the data as shown. Choose your Primary Key -- this is usually going to be an ID field. Upload! That's it! You're done! You've just migrated your Adalo data to Xano's free plan. What's next? Join us for an Orientation session to learn more about Xano, what it can offer, and ask any questions you might have. You'll also walk away with a $100 credit* to use if you decide to upgrade to a paid Xano plan. Check out our From Idea to App video series to learn the basics of Xano Explore all of the different frontends that can connect to Xano (including Adalo!) * $100 credit available to new Xano subscribers only and delivered via email within 7 days after Orientation session has concluded

How to Group Records by a Timestamp Field

In this tutorial, I’ll walk you through how to group records by a timestamp field with options to group by month, day, hour, or any other time unit. By converting the timestamp field into a human-readable format, you can easily group by unique date or time format. You're welcome to download and install the snippet below to get a copy of what I've done, so you don't have to build it from scratch. Feel free to experiment with different time formats, and if you have any questions or need assistance, just let me know. https://www.xano.com/snippet/ilPFhqvm

Testing Realtime with Postman

I wanted to share a video tutorial with a no-code method to test your websocket connection using Postman. Below, you'll find the JSON you'll need to send to connect to a channel. If you have any questions, feel free to ask! { "action": "join", "options": { "channel": "channel_name" }, "payload": { "history": false, "presence": true } }

Comprehensive Error Handling with Try/Catch

No matter how careful and precise we may be, errors are a normal part of any app. Some errors are unknown to us and statements such as Try/Catch allow us to handle them with ease. These statements help us effectively identify, catch and gracefully recover from runtime errors, making sure that our app continues to run smoothly and maintain a consistent user experience. 1. Understanding the Try-Catch Block Source: https://javascript.info/try-catch The purpose of a try block is to house risky workflows that could potentially throw an error during runtime. These runtime errors could be, but aren’t limited to, trying to access a non-existent function or an undefined variable. The Catch block’s job is to be the safety net that will protect the app from crashing because of the error found inside our Try block. We can think of it as a backup plan in-case anything goes wrong while our users are working within our app. Example In the following image, we are simulating a situation where you might dynamically be fetching values and using them for calculations. In some cases, one of the values may be a 0 and would be used for a division workflow, which would end up with an error. Try Block: Perform calculation Catch Block: Return the error message The Result Inside Xano, when you select the Try/Catch function from our Utility Functions, you will see these 3 sections above and under the hood, we provide the following variables for you to use: If we had chosen “name”, this would be our result: If we had chosen “code”, this would be our result: However, if we had chosen “result” in this case, there would be nothing returned however you would be able to customize this “result” using an update variable to contain information you will find necessary. The great thing is that we can customize some of the other errors ourselves, which we will get into later into this article. 2. Exploring the Finally Block The purpose of the Finally block is to execute whether an error was thrown or not. We excluded it in the previous example to illustrate that the statement may or may not have anything configured so the choice to use it is entirely yours. Example In the following example, we are simulating a workflow where we are using a Google Cloud Storage function as well as the External API Request function as a back up if we don’t get the result we are expecting due to reasons unknown to us. In the first step, we define a variable that we will want to reference in multiple parts of our Try/Catch function. If all goes well, our GCS function will replace the value, skip to the Finally block and it’s business as usual. If not, we are using a conditional to check if the result from the GCS function is empty (but we are sure the value exists) and if so, we use the Throw error function. With this function, we can define our own custom error that will give us more context over the issue. Going back to the variables provided to us in this Try/Catch function, If we choose “name”, this is the result: If we choose “code”, this is the result: If we choose “message”, this is the result: If we choose “result”, this is the result, which you will notice is exactly what we defined in the Throw error step: The remainder of the steps in our current workflow will be where we update our final_result variable to give us the result of the API call, along with the built-in result variable. The final result being as follows: Another way we can explore throwing errors, is through the use of the Pre-Condition function, which we will be diving into, in just a few. Circling back to the current use case, other native feature pairings we could explore are using the Direct Database Query in the Try block and Query All Records in the Catch block or a Lambda Function and a long-winded Custom Function. The goal here is to consider what backup configurations would match the configuration we have in our Try block so that our app still proceeds with the actions it’s meant to do. The thinking behind this is “If this is my Plan A, what can I do for Plan B that still gives the same outcome. Then Finally, tell me which one worked.” 3. Advanced Concept: Nested Try/Catch and Retrying For more complex workflows, it may be necessary to nest these functions inside each other to enable more layered error handling. It may also be necessary to have your app log these events (Successful or Failed) inside a table for later reference or to have it rerun the workflow at a later stage if the workflows failed. In this last example, we are simulating the signing of a Certificate of Completion whereby the Administrator User will submit their signature to append to the document that will be sent to their Student User upon completing a course. In the event that it fails, we try to regenerate it with an already existing signature by another Administrator so that the end goal, which is to certify our Student, still goes through. In our Try block, we are attempting the first API call with the dynamic signature. Then we use our Pre-Condition to throw the error if our status is not 200 and lastly, we create an event variable that will be useful for our Event Log table that will tell us whether the first attempt succeeded or failed. In our Catch block, we have another Try block that will first replace our most recent event variable then Add a Record to our Event Log table then run a similar function whose difference is it not accepting a dynamic signature. From there it is met with another Pre-Condition that will throw an error as well or proceed to replace our event with one similar to our first one but with 2 in brackets to indicate that this was a second attempt. In the case that the error did get thrown, our inner Catch block’s job is to replace the event variable to show that we are now at another stage where the workflow has failed for the second time and therefore we would like to log this to our Scheduler table that will be linked to a task that will attempt to generate the PDF. In here, we will want to track the inputs provided so that we can reuse them without the need for manual intervention. Our inner Finally block contains nothing but our outer Finally will log our second event that will either tell us whether the second attempt failed or not. Going back to the variable provided for us in this Try/Catch function, If we choose “name” or “code”, we would get the same result as our first scenario where we do not have a customized error message. However, if we choose message or result, our result will be the values we defined inside our Pre-Condition, with message taking the Error Message input and Result taking the Payload input: 4. Best Practices in Using Try-Catch-Finally It is important to be able to identify which scenarios absolutely need this function. Overusing it could lead to configurations that are hard to follow (for your collaborators) and maintain, while underusing them could leave your app vulnerable to errors that would cause a stain on your user experience. Here are some tips to keep in mind: Only use the Try/Catch function wherever there might be possibilities of errors. Use the Catch block to log errors for debugging purposes and to create descriptive errors that will provide much needed context to your users and your teammates. Avoid excessive performance overhead by using alternative functions for error handling in workflows that are less prone to errors. (Pre-conditions, If-Statements, etc) Avoid being overly broad and be specific when customizing your error messages so that you are able to identify exactly which part of the workflow broke and what the exact cause was. Additional Resources Remember, error handling is an ongoing learning process. Here are some resources for further exploration: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function ********************************************************************************** Test Your Knowledge! Bug Blast - Taming Errors with Try-Catch The following program calculates total spending per customer from a data file. But wait! There are bugs lurking in the code, and your task is to identify them and use try-catch statements to handle these errors, ensuring the program runs smoothly. Getting Started Step 1. Install the following snippet inside your workspace https://www.xano.com/snippet/gF1HpzUw Need help installing snippets? Check out our Preview and Add a Snippet Instructions Step 2. Download the sample data with records for 21 unique clients https://x9qk-rkcz-tbuf.n7.xano.io/vault/k0U06HzM/4lDrtrogHAFRVdplEy7TxmcQOUo/DlaqZg../bad_data.rtf Step 3. Paste the data from the file inside the Run and Debug Step 4. When you run the API, the bug you will see is “Numbers required for mathematical operations” Checklist (✅ Required 🔍 Optional) ✅ Final Result should include 21 items ✅ Identify where the error was coming from and explain how to prevent it 🔍 Throw custom error with payload 🔍 Create a event logger table to track each event inside the workflows By completing this activity, you'll gain a practical understanding of how try-catch statements work and their importance in error handling. You'll also practice debugging techniques and improve your programming problem-solving skills.

How to choose between the UUID and the sequential ID as the Primary key in Xano?

Choosing the appropriate primary key format is critical to the database and system’s performance, scalability, and data integrity. Read full article here: https://anishgandhi.com/how-to-choose-between-the-uuid-and-the-sequential-id-as-the-primary-key-in-xano

Create a Robust Scheduler in Xano

Introduction First, i’d like to give you some definitions: xTask: the tasks as defined in Xano a task: an event that is triggered at a certain date & time to execute a process a job: a process to be executed by a task The actual way to manage tasks in Xano is pretty limited: xTasks aren’t executed in parallel. if you set a task to be recurrent, If one xTask isn’t finished before it is supposed to fire again, then it’s not fired again. A xTask will always do the same thing. Hence, you need to create as many xTasks as exist different jobs to get done. Depending on the plan you’re on, you can be quickly limited. Some xTasks need to be fired on a minute frequency, some others on an hourly or daily basis. In Xano, you have to set a frequency per xTask. So you have to create a xTasks based on its frequency. if you execute several jobs in one xTask but one is longer than expected, the required frequency for the others is not met and they become late. As you can see, there are some limitations on xTasks. That’s why in this article, i propose we will build a robust scheduler to allow you to organize and schedule the execution of various tasks, even programming recurring tasks, whatever the task duration is, without blocking other tasks to be executed. What is a scheduler? The goal of a scheduler is to arrange, control, and manage the execution of tasks. These tasks can be one-time actions or recurring jobs. A scheduler might offer a range of functionalities and allow a wide variety of actions and processes. Its main functionalities are: create and schedule a task execute the task when planned log task execution result Designing the Scheduler Global design Here’s, at an abstract level, what the Scheduler does: You create a task that is to execute a job You schedule the task When the time has come, you execute the job the task is supposed to do you log the result of the task Requirements Some requirements about the Scheduler: if a task (which can trigger several jobs) takes longer than its trigger frequency, it must not, as much as possible, prevent other tasks to be triggered if a task is suspended, it mustn’t prevent other tasks to be triggered Fine-tuned design So, based on xTasks limitations and our requirements, we’ll have to create a Scheduling system that allows tasks to be executed in parallel when they are based on the same frequency, and if possible, prevent a maximum of tasks from getting stuck if one takes longer. So first, we’ll need several “clock” engines to be able to run in parallel and trigger tasks. Second, for a given frequency, we’ll need to balance tasks between these clocks. If one task takes longer, the other “clock” engines are able to run other tasks. Then to prevent a task from being surely “late”, we’ll create “clock engines” based on several frequencies. Implementing the Scheduler Diving into Task creation and scheduling To schedule a job to run at a specific date, you require two essential components: A repository for your task that includes both the timing instructions for when the job should be executed and the necessary information for executing the job itself. A scheduling system that triggers the task execution at the designated time. Task repository The best Task repository, in the context of Xano, is a table where all the needed informations are stored. Let’s create this table called Tasks👍 Scheduling system The scheduling system will be made out of several components: a function to create a new task a function to execute the job associated to the task a scheduling mechanism to check and execute the right tasks on right time Function task_new Let’s call it: task_new it needs several parameters: pJob (text) : the job that needs to be run when task is executed pParameters (json): : the JSON that will contain the data needed by the job pExecutionDate (timestamp) : the date & time to execute the task pTimer (enum) : the timer that will execute the task its purpose is to add an entry to the Tasks table to handover the task to the scheduler. Step1: all the DB operations inside this function will be executed “at once” at the end of it. Step1.1: inserting the new task in the DB with first set of values step 1.2: determining the scheduler id to trigger the task. If the timer is minute then we calculate the schedulerId according to the new task Id modulus 3 (result is 0,1 or 2). Else it is set to 0. I’ll explain later, when dealing with the scheduling mechanisms, why this calculation specifically. It’s based on the incremental id from the table Tasks. Step 1.3: setting the scheduler Id Function task_runJob Let’s call it: task_runJob This function will trigger the according sub-function related to the job. As a parameter, it receives the Task stored in the Tasks table. it’s algorithm is very simple: Based on the Tasks.tsk_job label, it executes the according function, transmitting to this function the .tsk_parameters JSON field needed by this function to achieve its purpose. This if-statement is to be reproduced as many times as you have different jobs to be executed, each corresponding to a .tsk_job. Then it returns a result to the scheduler that will update the task’s status accordingly. A few things to consider: The result of this function, as the result coming back from all the job_* functions is structured almost like an API response The status will be stored into the .tsk_status field and the result in the .tsk_result field. The job_* functions if they are to be recurrent can call the task_new function to reschedule itself Scheduling mechanism Now, we have to implement the “clock engines” that will properly trigger each of these tasks, right on time. For this, we’re going to use Xano’s Tasks. But remember that a xTask can’t be triggered while the same previous one is not finished, no matter the frequency. And one of our requirements is to prevent, as much as possible, tasks from getting stuck if a previous one is not finished. Here's how to ensure that the maximum number of tasks are triggered when they're supposed to be. We’re going to create 5 xTasks: 3 to handle 1 minute timer 1 to handle 1 hour timer 1 to handle 3hrs timer Minute xTask Let’s create a new task and name it: cron_m00 And here’s its function stack: It is scheduled to be triggered every minute. Here’s the description of the algorithm, step by step: Step1: Querying all the tasks which .tsk_status is pending, execution date & time is in the past,.tsk_timer = minute and .tsk_schedulerId = 0. Which means: all the task to be executed each minute, affected to scheduler Id 0, that are waiting to be triggered and which execution date & time is before now. This allows tasks that hadn’t been executed (when cron_m00 was disabled for maintenance for example). Note that if the task was suspended, it is not taken into account. Step2: a loop on each task to set each task to the processing status This is done in the case that one day, Xano authorizes a xTask to get triggered if previous one is not finished. Step 3: a loop on each task to execute its job Step 3.1: we create a variable that contains the current time Step 3.2: we call the task_runJob with the current task information as its input parameter. Step 3.3: once the job is done for this task, we calculate its duration step 3.4: we edit the task with more informations about its execution and result Now that we have created this xTask, we duplicate it twice and rename them, respectively cron_m01 and cron_m02. The only modifications needed in these xTasks are on the first step where you modify the scheduler Id, respectively to 1 and 2. WIth this plus the setting of a SchedulerId to each task based on Tasks.id modulus 3 allows to balance the tasks amongst 3 “clock engines”. That way, each minute, 3 tasks are executed: if one takes too much time. For cron_m01: For cron_m02: Then you clone cron_m02 and name it cron_h00. The modifications to do in this new task are : modify the Query All Criterias: Change the timer frequency to Every Hour: Duplicate one last time this cron_h00 and name it cron_3h00. The modifications to do in this new task are : modify the Query All Criterias: Change the timer frequency to Every 3 Hours: Don't forget to enable each of your xTasks! Using this Scheduler Now, each time you want to schedule a specific task, either one-time task or a recurring task you have to: Create a job_<jobName> function that will handle the job execution You modify the task_runJob function to add the new .tsk_job to be handled (cf. the if-statement to be cloned as needed in the function) You use the task_new function to add any new task with the good parameters: pJob = a name that’ll be used to set a precise process to be executed pTimer = minute for jobs that take a few seconds pTimer = hour for jobs that take a few minutes pTimer = 3h for jobs that take less than 3 hours Here’s the final schema for the Scheduler system: Please, leave a comment or any feedback, correction, improvements, ... :)

Stripe Mobile Elements Checkout Implementation

This post is a tag alone for my post in Draftbit community. If you happen to use Xano + Draftbit, you might find it helpful. I am going to talk about the Xano side here and for Draftbit, please check out the link. This is a tutorial on how to implement Sripe Mobile Elements for your app with minimal custom code. The result is the following: iOS Android The Why: I found posts how to implement Stripe Links, but Links are not really for mobile apps . So, I wanted to implement a native checkout look and feel that all of us are used to. Luckily, Stripe Mobile Payment Element is just that. The How – High-Level: My goal was to minimize custom code, so I leveraged built-in Draftbit functionality whenever possible + Xano as my backend. High level, the flow executes as follows and I will go in detail for each step below. 1) On screen focus: a. Get Stripe publishable key via API call to Xano b. Initialize Stripe using custom function c. Create payment Intent using API call to Stripe via Xano d. Initialize Payment Sheet using custom function and client secret you get in the previous step response 2) On Pay button press a. Open payment sheet using custom function. Important: The flow above works for both Android and for iOS, but it is kind of annoying, because once you created a payment intent and before a user clicked “Pay”, you need to keep track of user actions. For example, if a user changed the cart and the payment amount changed, you’ll need to update payment intent. For simplicity, I won’t go into those details here, but here are the Stripe docs on the subject. If you care about iOS only, you can simplify the flow above, like this: 1) On screen focus: a. Get Stripe publishable key via API call to Xano b. Initialize Stripe using custom function 2) On Pay button press a. Create payment Intent using API call to Stripe via Xano b. Initialize Payment Sheet using custom function and client secret you get in the previous step response c. Open payment sheet using custom function. This way you create payment intent AND present payment sheet only when Pay button is clicked. User can still back out or cancel payment and then change cart etc, and the once they click Pay again, new payment intent is created etc. In other words, you don’t have to worry about tracking and updating existing payment intent. Note, that Stripe asks you to only create one payment intent per session and then update is as needed, so this is not Stripe like… but if you want to push the MVP out of the door, it works. And you can clean up later. The How – Details: Stripe: - Register and find your API keys under Developer => API keys Xano: - Go to Settings and save your Publishable Key and Secret Key as Environment Variables. Click Manage button to do so. - Create an API group and two APIs in it (as a reminder we are ignoring other APIs you can use to manage the lifecycle of payment intents) o /get-publishable-key § With this one you just return the publishable key you just saved as an Environment variable. o /create-payment-intent § To create this one, use curl command from Stripe docs here. To do so, in Xano add External APi Request => import curl => paste curl command from Stripe you just copied. § You will need to make two changes: instead of a placeholder amount, specify an “amount” as an input of your function stack; instead of hard-coded api key, specify you secret key that you saved as an Env variable. § Note: Stripe deals in cents, so $10 is represented as 1000. So, you’ll need to handle is somewhere, for example like I did by multiplying amount by 100. § As you make this call to Stripe, it will return a whole payment intent object with a bunch of stuff we don’t need at this point, so for our purposes your Xano endpoint can just return clientSecret. Draftbit - please check out the rest of the details in the Draftbit community.

How -To: Manage Datasource on Webhooks

Hi there, Just a quick tip about how to manage your datasources when dealing with webhooks and test/production environment. It'll mainly depend if the third party tool allow test/production environment (and differentiate webhooks accordingly), like Stripe or Api.video. Or not. In the first case, managing datasource is pretty simple: you create a function that'll hold all the algorithm that you have to develop. You declare 1 parameters to this function: - payload as JSON (that you'll get through the Get All Input function) (the headers and others are in the env variables) You create your first endpoint naming it /mywebhook/test and set it then like that: Then, you duplicate that endpoint and name it /mywebhook/production Then, in you third party tool, on each test & production environment you register the respective webhook endpoints. In the second case, here: Determine at the beginning of your endpoints : Check on the payload the value that determine the destination DB if the webhook addresses the production DB you have to rebuild the API Payload (and remove /change) then information that sets the destination DB, else you will enter in an endless loop) and Headers and add to those Headers the x-data-source that will point to your production you call the endpoints recursively and return its result else proceed with your algorithm into the test DB I hope this may help some of you that are wondering how to solve such a problem. if you have any comment or event better way to do it, plz, share 😄

Configure Input Methods

Have you ever found yourself adding an input, and while you're there, you notice something that says “configure input”, and you've always wondered what it was? Well, today that's what we're going to cover. At the moment, these are only available for Text, Integer, Password, and Decimal inputs. Our core focus for this post will be Text Inputs. We’re going to look into examples of how you can implement each method and give context as to why you would opt to use them. Without wasting any more time, let’s get into it! Starting off with the Trim method. You’ve probably seen this a lot because it is a default in the text inputs and its purpose is to get rid of any unwanted whitespace at the beginning or end of your inputs. This ensures consistency and makes sure that your values can be easily reused without worry of unwanted extra spaces. An example where having this is beneficial is when saving a user’s first and last name. Assuming you might want to create an email for the user based on those inputs, not trimming will add inconsistencies that might cause errors down the road. The next 2 methods are min and max; these allow you to limit the length of your input so that users don’t go beneath or beyond a certain amount of characters. Doing so will ensure that your your data is consistent and follows a strict structure before getting processed. This kind of method would be beneficial for text-based form inputs and regular inputs such as usernames and passwords. Next, the StartsWith method, which is where you define prefixes to the data. Using this method helps enforce a predefined pattern which reduces the risk of errors or invalid data and it provides additional information about the type or purpose of the input.. It is beneficial for inputs such as phone-numbers and unique identification fields. Next up is the Prevent method. Just as it suggests, this method blacklists certain words, characters or even numbers or any other unwanted content. This is beneficial for inputs such as passwords, usernames and for social media/community apps, it helps moderate content that is posted by users. The next 2 are upper and lower. These can be achieved inside the function stack however, you might want to apply the method directly on the input as it comes in. These allow formatting data as uppercase or lowercase and are beneficial for fields that may need to be compared or searched. In the case that your users provide their own email addresses, using the lowercase method will ensure that this data is consistent even if the user types it using different cases. The next 3 are AlphaOK, DigiOK and OK. The AlphaOK method allows only characters from the alphabet while the DigiOK method allows only numerical characters and lastly the OK method gives you more granular control over which alphabetic and numerical characters you would like to allow. The first 2 are effective for scenarios where only numeric or alphabetic values are expected whereas the last method is effective for more restricted inputs. Examples for these could be: AlphaOK: When saving streetnames and countries. DigiOK: When saving phone-numbers and personal identification numbers. OK: When saving seat numbers for theatre booking systems where there are a limited amount of seat rows and numbers. Lastly, We have the Pattern method. Similar to the lower and upper methods, this can be achieved in the function stack. This one allows you to define patterns for valid input. This is especially useful when you need to ensure that user-provided data adheres to a specific format, such as phone numbers, website URLs or usernames. In conclusion, understanding and implementing various input methods plays a pivotal role in maintaining data integrity and consistency within your applications. Stay tuned for future discussions on input methods tailored for different data types, and feel free to experiment with these methods we discussed today to discover the optimal combination that suits your application's unique requirements! PS: Is there a specific topic you'd like us to explore? Let us know your suggestions for future posts!

Xano Transform: SET Filter

In our next installment of using the Xano Transform engine, we're introducing some updates to the SET filter, enabling you to use inline expressions to transform and manipulate your data faster than ever. 📚 See the documentation HERE. 📺 GET Filter Updates Video 📺 Expression Data Type Video Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Xano Transform: GET Filter

In this video, we'll go over some updates to our GET filter, enabling the use of the Xano Transform Engine to supercharge your ability to parse through your data in more complex ways. You can now use an easy-to-learn inline syntax right in the GET filter, replacing the need for separate traversal and comparison functions and filters. 📚 Xano Transform - GET Filter Documentation If you haven't already, make sure to check out our video and documentation on the new Expression data type, which can be helpful before diving into the GET filter updates. 📺 Video 📚 Expression Data Type Docs Xano - The Fastest No Code Backend Dev Platform https://www.xano.com Twitter https://twitter.com/nocodebackend Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

Introducing the Expression Data Type

Expression is a brand new data type in Xano that allows you to write inline expressions using a simple syntax, performing anything from basic to complex operations, without the need to chain multiple functions and filters together to do so. It's a brand new way to build in Xano, and we can't wait to see how you use it. We highly recommend reviewing the full Expressions documentation along with this video when getting started. Subscribe to Xano's Channel for Weekly New Content https://www.youtube.com/c/nocodebackend

More GPT fun with Xano APIs

I will do a video for this in the next few days, but had to share 😀 I was able to do a Post API call from my custom GPT into Xano for my test app that gets a recipe based on a protein you select. It was a lot easier than I thought it would be. I created a new table in Xano (recipes) and a POST API to add a recipe to the table. I got the new swagger documentation and updated it with the changes that need to be made for it to be compatible in a custom GPT action (see video below for specifics of how to do this -- only 2 simple changes). I pasted the new swagger (openapi) documentation into the GPT action that was created in my first video, below. You will see the original GET api and the new POST api if you updated the openapi documentation correctly. Then, 1. I simply tested the GET api (just click the "test" button) to get the list of proteins from my Xano database 2. My GPT asked what protein I wanted to use. I selected one. 3. The GPT shared a recipe based on that protein 4. As a quick test of its ability to "just call the POST API" I gave it these instructions... "use the recipe information to call the postRecipeNew action. The name of the recipe should be populated in the name property, the ingredients and instructions should be populated in the instructions property and add the final sentences after the instructions as part of the description property" 5. It called the POST API in my Xano workspace based on the instructions above and the recipe was added to my new recipe table ("name", "description", and "instructions")!! As a next step, I will add the instructions to my GPT to call the POST api to the configuration so it is a way to "favorite" a recipe. [UPDATE] I was able to tell my GPT to "save the recipe" and it figured out how to do it without me having to do any specific configuration. It called the POST API and put the right data in the right fields for the API 😳 It may have "learned" from my instructions in #4 above? Also, I looked at the GPT Configuration info and there wasn't a reference to using the POST api in any fashion...I guess I have to figure out the edges of what it can do and what I don't have to teach it. First video I did for GPT & Xano (get a list API) https://youtu.be/wKusxgGZWWE

Create a GPT That Calls an API in Xano

Learn how to build a new GPT in ChatGPT (OpenAI). The GPT will be configured to call an authenticated / secured API in Xano. This video will show how easily you can create a GPT interface that uses your proprietary data via a Xano API.

OpenAI Function Pack (Snippet) 55 Installable Functions Included

Hi everyone this is a follow-up to my introduction to OpenAI thread you can view here. I'm excited to share a new snippet containing over 50 functions that make working with OpenAI and Xano quick and easy. You can add these functions directly to your function stack with a single click, giving your app AI powers instantly. Quick Start Account Requirement: A Xano account is necessary, available for free. Snippet Installation: Install the Snippet on any Xano instance even our Build plan. API Key: An OpenAI API key is required for operation. This key needs to be added as the open_ai_api_key environment variable within your workplace settings after installing the snippet. More details on where to find this here Warning OpenAI's API is a pay per request service and can be expensive, be sure to confirm which model you are using and consult their pricing page for further details before getting started. Table of Contents What's Included? Installation Models Chat / Text Completions Images Audio Assistants Fine-tuning Embeddings Error Handling / Request Log / Troubleshooting What's included? Included are all the available endpoints provided by OpenAI 55 Functions 1 Database (A log that records each request) 1 API Group - (Can be deleted after installation) 1 API Endpoint - (Can be deleted after installation) 1 Environment Variable - This is where you insert your OpenAI API Key Within each category shown above are multiple endpoints or functions that you can perform. These functions enable you to do things such as create images, describe what an image is, start a chat conversation, translate an audio file or url to a transcript and much more. How do these functions work? You are able to add custom functions to your function stack, for example, you might want to generate an image as part of a workflow. We can add the Create Image function to your function stack. Within the custom function, all of the available parameters for the function are available as inputs. The only required item for this function is the Prompt and Model the other fields are optional and will default to null. Our prompt and the only input we need to configure to get started is: A laptop near a window in a stylish skyrise apartment with an X logo on it. The Functions Response: { "result": { "created": 1701235536, "data": [ { "revised_prompt": "Visualize an image of a modern laptop situated by a large window inside a chic, high-rise apartment. The laptop should have an 'X' logo affixed to it. The window provides a panoramic view of the bustling city below. The room's decorating style is minimalist, with subtle hints of luxury. The light filtering through the window sparkles against the laptop's sleek finish, suggesting an early morning atmosphere. The scene should overall evoke a sense of modern urban living combined with technology.", "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-c0vZYfhzt6L7XJqSl9ZysuSL/user-Y1hVkgcTcYOYMGP6LtyZkbw2/img-nleh0BjwQe3xZ1tvj8TWIcsR.png?st=2023-11-29T04%3A25%3A36Z&se=2023-11-29T06%3A25%3A36Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-29T00%3A43%3A42Z&ske=2023-11-30T00%3A43%3A42Z&sks=b&skv=2021-08-06&sig=5%2B1KyxT85ChNCBraOJslIxjWz8286H8JYgtIKkTDKDY%3D" } ] }, "status": 200 } The Result: Setting this process up takes seconds after installing the snippet making building with AI faster than ever. Installing the snippet To install the snippet head over to the snippet page and click install. Sign in with your account and select which instance you would like to install the snippet to. Then go into the instance you installed the snippet into, in the desired workspace head to the marketplace >purchased on the side menu and click install on the the OpenAI Snippet. This will add then functions, table and environment variable to your workspace. You will then need to visit your workspace Settings and under System Variables click "Manage" and add your OpenAI API Key to the "open_ai_api_key" environment variable and save. More details on where to find your OpenAI Key here Your AI functions are now ready to be used in your function stack, head to custom functions when adding a logic block to your function stack, or better yet type in the functions name. Tip: You are able to search OpenAI to return all of the custom functions. An overview of the functions Further information about each set of functions can be found by clicking the link provided as the header of each section. This will take you to OpenAI's API reference docs for the particular function which help further explain the input parameters and their expected format. Reading OpenAI's general documentation can also be quite helpful to further understand how the functions work: OpenAI Documentation Models Models are what power OpenAI's various functions, each function can utilize various models that impact the capabilities, quality, and cost of performing a request. Custom models can also be created by fine-tuning a model with additional data. List models - Returns a list of available models. Retrieve model - Returns the details of a specific model. Delete a fine-tuned model Chat Chat is what powers non-assistant-based text completion requests and also vision (having chatGPT describe what it sees in an image). Whether creating a conversation or asking for a single response the chat completion function is what you'd use. The function is quite extensible, for example, you can control the response_format input to determine if you'd like a response in text or json output. (JSON output is only available on the latest GPT-4 models) Create chat completion - single message Allows you to input one system and one user message Create chat completion - list of messages Accepts an array of messages Creat message object - This is a simple function that makes creating a message object easier. You could use this function multiple times in a function stack and add each function output to the end of an array to construct the "messages" array required as an input for the Create chat completion - list of messages function. Here's a video showing you how you can create a chatbot leveraging your Xano database to store and retrieve conversations and messages. You can replace the external api requests in the video with the Create chat completion function included in the snippet to speed up the process! Images OpenAI's image generation capabilities have increased greatly with the release of their dall-e-3 model and can now produce high-definition images with intricate detail. The included functions allow you to generate new, varied, and edited images. Some of the functions included don't yet support dall-e-3, such as Create image edit Create image - Generate one or multiple images based on the input parameters and model selected. Create image edit - Edit an existing image Create image variation - Create a variation of an existing image Create Description from Image - File Upload input - Returns a description of the image (uses the Chat completions endpoint) Create Description from Image - URL Input - Returns a description of the image (uses the Chat completions endpoint) Audio OpenAI have powerful audio models that allow you to both transcribe text from Audio, and convert text into Speech. These functions enable you to implement powerful audio solutions and also provides language translation capabilities as well. Create Speech - Text to Audio - Generates audio from the input text. Create Transcription - Audio to Text - Transcribes audio into the input language. Create Translation - Audio to Text - Translates audio into English. Embeddings Embeddings are a fundamental concept in machine learning and natural language processing (NLP), used to convert complex, high-dimensional data like text or images into a lower-dimensional, dense vector space. What are Embeddings? Representation: Embeddings are representations of data in a format suitable for processing. They transform raw data like words, sentences, or images into vectors of real numbers. Dimensionality Reduction: They reduce the dimensionality of data, making it easier to handle and process, especially for machine learning algorithms. Capture Semantics: In NLP, word embeddings capture the semantic meaning of words. Words with similar meanings are represented by vectors that are close together in the embedding space. Contextual Relationships: Advanced embeddings (like those from BERT or GPT models) capture context and relationships between words in a sentence, not just individual word meanings. Note you currently are only able to store vectors (embeddings) in your Xano database (This would be to keep a copy of the vector) - In order to utilize the vectors you'd need to leverage a vector database such as https://www.pinecone.io/ Example App Workflow - Knowledge Base FAQ Bot You could generate embeddings for your product documentation or knowledge base using OpenAI's API. Then you could store those embeddings in a vector database like Pinecone and use Xano to query the database to create a chatbot trained on your own data. Step one generating embeddings and storing them in Pinecone You would then be able to create a chatbot workflow that would leverage OpenAIs Embeddings and Chat Completions APIs via querying Pinecone for related information. Generate embeddings using the function: Create embeddings Moderation Given an input text, outputs if the model classifies it as violating OpenAI's content policy. Create moderation Assistants / Agents Assistants are a powerful new tool that enable you to create custom chatbots and agents that can leverage tools, function calling and documents. This means you can upload data directly to OpenAI that your assistants can query to improve the accuracy and reliability of their responses. This technique is called Retrieval-augmented Generation (RAG). Each assistant can leverage it's own custom data, tools and instructions enabling many automation possibilities. Unlike the chat completions endpoint assistant conversations (threads ) and messages are also stored by OpenAI. Functions Overview Assistants - Create Assistant This function allows you to create a new assistant. An assistant is an AI entity that can be programmed with specific skills, knowledge, and capabilities. The creation process involves defining its characteristics and the tools it can access. Retrieve Assistant This feature enables you to fetch details about an existing assistant. It's useful for monitoring an assistant's performance, accessing its configuration, and understanding its capabilities and limitations. Modify Assistant Modify Assistant is a crucial function that allows you to update the settings or capabilities of an existing assistant. This could include altering its knowledge base, changing its response style, or updating its tool access. Delete Assistant This function is used to permanently remove an assistant. It's an important tool for managing the lifecycle of assistants, ensuring that only relevant and necessary assistants are active. List Assistants List Assistants provides an overview of all the assistants created under your account. This function is essential for managing multiple assistants and understanding the scope of your AI deployment. Create Assistant File This function allows you to upload a specific file to an assistant. It's useful for providing the assistant with additional data or instructions that are not part of its initial programming. Retrieve Assistant File Retrieve Assistant File enables you to access a file previously uploaded to an assistant. This is crucial for verifying the content an assistant has access to and ensuring it's up-to-date. Delete Assistant File Use this function to remove a file from an assistant's database. It's vital for data management and ensuring that assistants only have access to current and relevant information. List Assistant Files This feature provides a list of all files associated with a particular assistant. It's an essential tool for tracking the resources your assistant has access to. Threads Create Thread Initiate a new threaded conversation with an assistant. Threads are a series of messages that provide context and continuity in interactions with the assistant. Retrieve Thread Access a specific thread's history and details. This is crucial for reviewing past interactions and understanding the context of a conversation. Modify Thread This function allows you to edit the properties of an existing thread. It could be used for changing the thread's status or its associated metadata. Delete Thread Remove a thread permanently. This function is important for managing conversation history and ensuring privacy and data cleanliness. Messages Create Message Send a new message within a thread. This function is the primary method of interacting with an assistant, allowing for questions, commands, or information exchange. Retrieve Message Access a specific message within a thread. It's important for reviewing the details of a conversation and understanding the assistant's responses. Modify Message Edit the contents or properties of an existing message. This could be used for correcting mistakes or updating information in ongoing conversations. List Messages View a list of all messages within a specific thread. This function provides an overview of the conversation history. Retrieve Message File Access a file that's been attached to a message. This is useful for reviewing documents or data exchanged in the course of a conversation. List Message Files See a list of all files attached to messages within a thread. This function is essential for tracking document exchanges and data references in conversations. Runs Create Run Initiate a new operation or task within a thread. Runs can represent specific actions or processes that the assistant carries out in response to messages. Retrieve Run Access details of a specific run. This is crucial for monitoring the status and outcome of tasks assigned to the assistant. Modify Run Change the parameters or settings of an ongoing run. This function allows for dynamic adjustments to tasks based on new information or changing requirements. List Runs Get an overview of all runs associated with a thread. This is important for tracking the assistant's activities and understanding the scope of its operations. Submit Tool Outputs Provide feedback or results back to the assistant after a run. This is crucial for closed-loop operations where the assistant's actions require validation or further input. Cancel Run Terminate an ongoing run. This function is necessary for stopping tasks that are no longer needed or correcting misdirected actions. Create Thread and Run Start a new thread and initiate a run simultaneously. This is useful for streamlined operations where the conversation and task commencement are closely linked. Files List Files View all files stored or associated with your account. This function is critical for managing the data your assistants have access to. Upload File Add a new file to your account. This allows you to provide new data or resources for your assistants to use in their operations. Delete File Permanently remove a file from your account. This is essential for maintaining data hygiene and ensuring that only relevant and necessary files are available. Retrieve File Access a specific file from your account. This function is vital for reviewing the content available to your assistants. Retrieve File Content Extract and view the contents of a file. This is important for verifying the information your assistants are using for their tasks and responses. Fine-tuning in machine learning refers to the process of taking a pre-trained model and further training (or "fine-tuning") it on a more specific dataset. This approach is particularly popular in contexts where a large, general-purpose model has been trained on a vast dataset and you want to adapt it to a more specific task or dataset (Like GPT 3.5 from OpenAI) Here's a brief overview of the process: Start with a Pre-trained Model: You begin with a model that has already been trained on a large, generic dataset. This model has learned a wide range of features and patterns relevant to its initial training task. Select a Specific Task or Dataset: Choose a more focused task or dataset for which you want the model to perform well. This dataset is usually much smaller than the one used for initial training. Continue Training: The pre-trained model is then further trained (fine-tuned) on this new dataset. During this phase, the model adjusts its weights and parameters to better suit the specific task. Adjust Learning Rate: Often, a lower learning rate is used during fine-tuning to make smaller adjustments to the model's weights, preventing overfitting on the new dataset. Evaluation and Use: After fine-tuning, the model is evaluated to ensure it performs well on the specific task. It can then be used for predictions or analysis in its new domain. Fine-tuning is especially useful in scenarios where retrieval methods (RAG) using embeddings isn't performing acceptably due to large input context required and the cost associated with this potentially. Fine-tuning generally is considered after RAG effectiveness has been tested. Fine-tuning Customize AI models with fine-tuning functionalities: Create fine-tuning job List fine-tuning jobs Retrieve fine-tuning job Cancel fine-tuning List fine-tuning events Files Efficient file management through AI with functions like: List files Upload file Delete file Retrieve file Retrieve file content Error Handling / Request Log / Troubleshooting Each function containing an API request has a response with two objects: Result & Status Errors can be determined by both the status (not 200) and an error message appearing within the result object. Function Log - (API Request history) Included in the snippet is a log table that records a copy of each API request that's sent to OpenAI you are able to view these requests for troubleshooting. There is a Create log function which adds to this table and is used in most of the functions. This can be removed from each function if you don't wish to record a copy of each request. Additional Documentation Further information about each set of functions can be found by clicking the link provided as the header of each section. This will take you to OpenAI's API reference docs for the particular function which help further explain the input parameters and their expected format. Reading OpenAI's general documentation can also be quite helpful to further understand how the functions work: OpenAI Documentation Support & Improvement Requests If you are having trouble using one of the functions or have a suggestion on how they could be improved please direct all of your feedback to this thread as a comment.

Build and Deploy a Bubble-Xano Chef AI APP | Bubble, Xano

Develop Chef AI, a Bubble and Xano app that helps you generate the recipe using the ingredients provided by the user. In this video tutorial, you'll embark on a culinary and technological journey where you'll: - Master the setup of CRUD (Create, Read, Update, Delete) APIs in Xano. - Learn the intricacies of calling Xano APIs from within the Bubble platform. - Dive into the use of Atomic Fusion for a seamless development experience. - Build a Bubble SaaS (Software as a Service) platform from the ground up, tailored for culinary applications.

OpenAI API Overview: ChatGPT, DALL-E, Whisper and more.

Table of Contents How to Leverage OpenAI with Xano What is OpenAI? What does OpenAI do? How can I utilize OpenAI with Xano? API Pricing Authentication / Headers Requesting organization Making requests Models Chat Models Vector Representations and Embeddings What are Embeddings? What are Tokens? Token Limits Audio Models Transcribe Translate Image Models Generate Edit Variation Completions Edits What is OpenAI? OpenAI is an AI company based in San Francisco. They are best known for developing GPT-3, a powerful LLM trained on billions of words from the Internet. GPT-3 shows how LLMs can be applied in many creative ways without needing to code. With a bit of guidance, these models can build simple apps, generate content, converse, and more. OpenAI Overview Slides: What does OpenAI do? OpenAI has developed several powerful AI models that are available to the public, including GPT, a natural language processing model. GPT can write coherent and convincing text, answer questions, and even generate code. Other models developed by OpenAI include DALL-E, which can generate images from textual descriptions, and Whispers which can transcribe audio files to text. They also have an embedding API that allows for converting text/documents into vector representations which are useful for adding context to prompts with larger datasets. How can I utilize OpenAI with Xano? Open AI has made their models accessible via API, meaning we can directly interact with the models using Xano. These models are mostly powered by human language text inputs which makes it extremely accessible and easy to work with. With a small amount of effort, huge results can be achieved. Getting Started To get started you can familiarize yourself with OpenAi’s API reference docs here: API Reference If you don’t know what you are looking at that’s ok we’ll explain how you can use the reference and models throughout this article. OpenAI’s API Pricing Unlike ChatGPTs web app, utilizing OpenAI’s API is a paid service. You can find a full breakdown of the API pricing here: OpenAI Pricing API Cost Warning Models such as GPT-4 can be expensive. Providing GPT4 with its biggest possible input prompt (32k tokens) can cost $1.92 USD for the input processing. And then if the output is at it's maximum output size (32k tokens) it will cost $3.84 for the response totaling $5.76 USD for a single API call. Be sure to understand the costs of the model prior to using it. Authentication / Headers The OpenAI API uses API keys for authentication. Visit your API Keys page to retrieve the API key you'll use in your requests. You’ll need to register for an OpenAI account if you haven’t already. Create an environment variable via the Settings section in Xano and add your OpenAI API Key. All OpenAI API requests should include your API key in an Authorization HTTP header as follows: Authorization: Bearer OPENAI_API_KEY How can you do this in Xano? When adding an external API request to your function stack you will notice there is an input field for headers. Headers are an Array so in order to add something to the headers we can use the PUSH filter which adds an item to the end of an array. We need to push our Authorization string through in order to Authenticate our requests you can paste the example in. Authorization: Bearer $OPENAI_API_KEY However, we want to update the string to dynamically include our OpenAI API key which we stored as an environment variable. We can do this using the REPLACE filter. It will look like this: Don't forget to save your changes! Requesting organization - For users who belong to multiple organizations, you can pass a header to specify which organization is used for an API request. Usage from these API requests will count against the specified organization's subscription quota. (Skip this if you are only part of one organization). Example curl command: curl https://api.openai.com/v1/models \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -H 'OpenAI-Organization: org-c0vZYfhzt6L7XJqSl9ZysuSL' Making requests You can make requests to OpenAI's API endpoints using Xano. For example: curl https://api.openai.com/v1/chat/completions \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -d '{ "model": "gpt-3.5-turbo", "messages": [ {"role": "user", "content": "Say this is a test!"} ], "temperature": 0.7 }' These example curl requests can be found throughout the API reference docs and can be copied and imported into Xano saving a heap of time. Start by copy the example curl request from the model you would like to utilize: When adding an external API request to your function stack you’ll see the IMPORT CURL button in the top right-hand corner. Pasting in the curl will populate the required input fields as per the API docs specifications. You will just need to update the prompt input and add your API key via the steps shown above. Try it out for yourself using the example curl provided above. 💪🔥🤖 Models List models GET https://api.openai.com/v1/models Lists the currently available models, and provides basic information about each one such as the owner and availability. Example curl: curl https://api.openai.com/v1/models \ -H 'Authorization: Bearer $OPENAI_API_KEY' Chat Models ChatGPT 3.5 & 4 The OpenAI Chat API is a powerful tool that allows developers to integrate AI-powered conversational capabilities into their applications. The API uses models like gpt-3.5-turbo to generate responses in a chat-like format. Here's a breakdown of how to use the API: Endpoint: The endpoint to create a chat completion is POST <https://api.openai.com/v1/chat/completions>. Body Parameters Required: model: The ID of the model to use 'gpt-3.5-turbo' is a recommended model. messages: An array of message objects that describe the conversation so far. Each message object should have a role (either 'system', 'user', or 'assistant') and content (the content of the message). Optional: temperature and top_p: These parameters control the randomness of the model's output. You generally should alter one or the other, but not both. n: The number of chat completion choices to generate for each input message. stream: If set to true, partial message deltas will be sent as they become available. (Not supported with Xano currently) stop: Sequences where the API will stop generating further tokens. max_tokens: The maximum number of tokens to generate in the chat completion. presence_penalty and frequency_penalty: These parameters can be used to control the model's tendency to introduce new topics or repeat itself. logit_bias: This allows you to modify the likelihood of specified tokens appearing in the completion. user: A unique identifier representing your end-user. Response: The response from the API will include the ID of the chat completion, the created timestamp, the generated message from the assistant, and usage information. Here's an example curl to try yourself: curl https://api.openai.com/v1/chat/completions \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -d '{ "model": "gpt-3.5-turbo", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ] }' Here are four sample applications that could be built using this API: Customer Support Chatbot: You can create a chatbot that can handle customer inquiries, provide information about products or services, and help resolve common issues. Virtual Assistant: You can build a virtual assistant that can help users with tasks like setting reminders, sending emails, or finding information online. Interactive Storytelling: You can create an interactive storytelling application where the user can have a back-and-forth conversation with characters in the story. Language Learning App: You can build an app where users can practice conversing in a new language with an AI assistant. Tutorial Video: Vector Representations (Embeddings) Vector representations, or embeddings, are a way to represent words or pieces of text as mathematical vectors that capture their semantic meaning. OpenAI offers an embeddings API that allows you to generate vector representations for input texts. These embeddings can then be used to add context to prompts for OpenAI's models or stored in a vector database for later use. For example, you could generate embeddings for your product documentation or knowledge base using OpenAI's API. Then you could store those embeddings in a vector database like Pinecone and use Xano to query the database to create a chatbot trained on your own data. The chatbot could handle questions about your products and documentation using the semantic information captured in the embeddings. Why are Embeddings needed? The reason why embeddings are important is due to limitations with the amount of text that can be give to a model or the “prompt size”. Each model has a token limit which defines how large the prompt can be. What are tokens? Tokens can be thought of as pieces of words. Before the API processes the prompts, the input is broken down into tokens. These tokens are not cut up exactly where the words start or end - tokens can include trailing spaces and even sub-words. Here are some helpful rules of thumb for understanding tokens in terms of lengths: 1 token ~= 4 chars in English 1 token ~= ¾ words 100 tokens ~= 75 words Or 1-2 sentence ~= 30 tokens 1 paragraph ~= 100 tokens 1,500 words ~= 2048 tokens Model Token Limits gpt-3.5-turbo - 4,096 tokens - (Approx 3072 Words) gpt-4 - 8,192 tokens (Approx 6144 Words) gpt-4-32k - 32,768 tokens (Approx 24576 Words) Embeddings can extend the memory capabilities of models Embeddings and the semantic search capabilities they provide are for when you need to work with data that exceeds a model's token limit. You are instead able to search a vector database for related content (context) returning only relevant or related components from your dataset effectively extending the memory capabilities of the model. Create embeddings POST https://api.openai.com/v1/embeddings Creates an embedding vector representing the input text. Request body model: ID of the model to use. input: Input text to embed, encoded as a string or array of tokens. Other parameters. user: A unique identifier for the end-user. Example Curl: curl https://api.openai.com/v1/embeddings \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "input": "The food was delicious and the waiter...", "model": "text-embedding-ada-002" }' ResponseThe response will include the embedding vector for the input text. You can store this vector in a vector database such as Pinecone. Example App Workflow - Knowledge Base FAQ Bot You could generate embeddings for your product documentation or knowledge base using OpenAI's API. Then you could store those embeddings in a vector database like Pinecone and use Xano to query the database to create a chatbot trained on your own data. Step one generating embeddings and storing them in Pinecone You would then be able to create a chatbot workflow that would leverage OpenAIs Embeddings and Chat Completions APIs via querying Pinecone for related information. Audio Models Whisper Audio Translation Model by OpenAI What is Whisper? Whisper is a neural net developed by OpenAI that provides high-level accuracy in English speech recognition. Whisper is trained on 680,000 hours of multilingual and multitask supervised data collected from the web, allowing it to be robust against various accents, background noises, and technical language. The architecture of Whisper is a simple end-to-end approach, implemented as an encoder-decoder Transformer. It can handle tasks such as language identification, phrase-level timestamps, multilingual speech transcription, and to-English speech translation. Example Applications: Whisper could be used to develop robust voice interfaces for applications in various industries. It can be utilized in transcribing multilingual speeches, making it useful in global conferences, online classes, and more. Create transcription POST https://api.openai.com/v1/audio/transcriptions Transcribes audio into the input language. Request body file: The audio file object to transcribe. model: ID of the model to use. Only whisper-1 is currently available. Other parameters to control the model's output. language: The language of the input audio. Response The response will include the transcription of the audio file. Example Request: curl https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/audio.mp3" \ -F model="whisper-1" An example application using the transcription endpoint You could build an audio transcription service. Workflow Overview: Now, let's go over the step-by-step instructions on how to build this application: Set up your Xano account: Sign up for a Xano account and create a new project. Create the API endpoint: Use Xano's visual API builder to create a new endpoint /transcribe. This endpoint should accept POST requests and the request body (input) should be an audio file. You can import the following curl via your external API request, being sure to update your API key and adding the file path to be an audio file/file resource input curl https://api.openai.com/v1/audio/transcriptions \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -H 'Content-Type: multipart/form-data' \ -F file='@/path/to/file/audio.mp3' \ -F model='whisper-1' Transcribe the audio: When a request is received at the /transcribe endpoint, pass the audio file to the Whispers model for transcription. The Whispers model will convert the speech in the audio file to text. Return the transcribed text: The text output from the Whispers model should be returned in the response from the /transcribe endpoint. Set up the database: Create a database table in Xano to store the audio files and their corresponding transcriptions. You will need to create a table with columns for the audio file and the transcribed text. Store the audio and transcriptions: After the audio has been transcribed, store both the audio file and the transcribed text in the database. Test the application: Finally, test the application by sending an audio file to the /transcribe endpoint and checking that the transcribed text is returned in the response and stored in the database. Create translation POST https://api.openai.com/v1/audio/translations Translates audio into English. Request body file: The audio file object to translate. model: ID of the model to use. Only whisper-1 is currently available. ResponseThe response will include the English translation of the audio file. You can use Whisper to develop voice interfaces or transcribe multilingual speech. Image Generation What is DALL-E? DALL-E is a neural network developed by OpenAI that generates images from text descriptions. It is a 12-billion parameter version of GPT-3 trained to generate images from text descriptions, using a dataset of text–image pairs. DALL-E has capabilities like creating anthropomorphized versions of animals and objects, combining unrelated concepts in plausible ways, rendering text, and applying transformations to existing images. Create image POST https://api.openai.com/v1/images/generations Creates an image given a prompt. Request body prompt: A text description of the desired image(s). n: The number of images to generate. Must be between 1 and 10. size: The size of the generated images. Must be '256x256', '512x512', or '1024x1024'. Other parameters. user: A unique identifier for the end-user. Example Curl - (Generate 2 images) curl https://api.openai.com/v1/images/generations \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -d '{ "prompt": "A cute baby sea otter", "n": 2, "size": "1024x1024" }' Be sure to update your input prompt and API key. ResponseThe response will include URLs to the generated images. (2) You can use DALL-E to generate images for advertising, digital art, education, and more. Example Workflow: Image Edit Image Edit endpoint: POST https://api.openai.com/v1/images/edits This endpoint accepts an original image and a prompt and generates an edited version of the image based on the prompt. For example, you could provide a picture of a red ball and a prompt of 'change the ball to blue” and get back an edited image with a blue ball. Example Application: An ecommerce product customizer. A user could upload a product image like a t-shirt or phone case and enter a text prompt to customize the design, color, or look of the product. The image edit endpoint would generate an edited version of the product image with the customizations, allowing the user to preview the changes before purchasing. Example Request: curl https://api.openai.com/v1/images/edits \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -F image='@otter.png' \ -F mask='@mask.png' \ -F prompt='A cute baby sea otter wearing a beret' \ -F n=2 \ -F size='1024x1024' Image Variation Image Variation endpoint: POST https://api.openai.com/v1/images/variations This endpoint takes an input image and generates stylistic variations of that image. For example, you could provide a landscape photo and get back multiple variations that adjust the brightness, color palette, cropping, etc. The output images are creatively adapted versions of the original photo. Example Application: A social media content generator. With an image variation API, you could build an app to generate curated social media content for influencers or brands. The user would provide a photo they want to post, and the image variation endpoint would return multiple variations of that photo with different stylings. The user could then select the variation they like best to auto-post to their social media profiles, saving time and ensuring high quality, unique content. This type of application could work with photos of products, lifestyle shots, portraits, food, etc. The image variation endpoint is able to creatively adapt images in many domains. Example Request curl https://api.openai.com/v1/images/edits \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -F image='@otter.png' \ -F mask='@mask.png' \ -F prompt='A cute baby sea otter wearing a beret' \ -F n=2 \ -F size='1024x102 Completions OpenAI's Completions endpoint generates natural language completion of prompts. It uses models like GPT-3 to continue and complete partial sentences or generate long-form text based on a prompt. Some main uses of the Completions endpoint include: Generating long-form text: You can provide a prompt like 'Here is a draft blog post: ' and GPT-3 will generate the rest of the blog post for you. Story or creative writing: Give GPT-3 a prompt with some starter sentences or characters and it can generate full short stories, creative fiction pieces, or screenplays. Conversation or question answering: Provide some initial messages or questions to simulate a conversation and GPT-3 will generate responses to continue the conversation. Idea expansion: Give GPT-3 a one or two sentence prompt describing an idea and it can expand on points, examples, and details to build out the concept. Paraphrasing or summarizing: Provide text you want to paraphrase or summarize and GPT-3 can rephrase it in different words with the same meaning or condense longer text into a shorter summary. Create completion POST https://api.openai.com/v1/completions Creates a completion for a prompt and parameters. Request body model: ID of the model to use. prompt: The prompt(s) to generate completions for. max_tokens: The maximum number of tokens to generate. Other parameters to control the model's output.user: A unique identifier for the end-user. Example Curl curl https://api.openai.com/v1/completions \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer $OPENAI_API_KEY' \ -d '{ "model": "text-davinci-003", "prompt": "Say this is a test", "max_tokens": 7, "temperature": 0 }' Response The response will include the completion for the prompt. The completions endpoint is able to return answers to questions and can be used in a multi step process to provide useful results. Example App: SEO Optimized Blog Post Generator The user logs into the application. The user navigates to the blog article creation page. The user inputs the topic or initial idea for the blog article. The application sends this initial input to Xano. Xano sends this topic to OpenAI's Davinci Model. OpenAI's model returns suggested keywords to Xano. Xano returns these keywords to the blog article creation page. The user reviews and selects the desired keywords. The user lists the topics they'd like to cover in the blog in short sentences. The application sends these topic sentences to Xano. Xano sends these topics to OpenAI's Davinci Model. OpenAI's model returns SEO-optimized suggestions to Xano. Xano returns these suggestions to the blog article creation page. The user reviews and incorporates these suggestions into the blog article. The user saves the blog article, which is stored in the Xano database. The user can then publish the blog article when ready. This demonstrates how you can use the completions endpoint in a multi-step process to create guided user experiences. Video Example - Create a Restaurant Review Generator: Edits The Edits endpoint allows you to provide an input text and instructions for how to edit that text, and it will return the edited text. For example, you could provide the input 'What day of the wek is it?' and the instruction 'Fix the spelling mistakes' and get back 'What day of the week is it?'. This endpoint uses models like the Text Davinci Edit model which has been trained on a dataset of (input, instruction, output) examples to learn how to apply edits. Example Application: An automated proofreading tool. You could build an app that allows users to submit any text content like blog posts, articles, or short stories and get AI-powered edits and proofreads. The workflow would be: User submits their text content. The app sends the text to the Edits endpoint with the instruction 'proofread and correct any errors'. The Edits endpoint returns the text with all spelling, grammar, and punctuation edits. The edited text is shown to the user. They can then choose to accept all edits, pick and choose edits, or undo any edits they don't want. Once the user approves the final edits, the text is saved as the proofread version. This type of automated proofreading tool could save content creators a lot of time and ensure high-quality writing. The Edits API allows you to easily build a proofreading experience with OpenAI models that have been trained on massive datasets to properly apply edits for grammar, spelling, and style. Create edit POST https://api.openai.com/v1/edits Creates an edit for the provided input and instruction. Request body model: ID of the model to use. You can use 'text-davinci-edit-001' or 'code-davinci-edit-001'. input: The input text to edit. instruction: The instruction telling the model how to edit the input. Other parameters. ResponseThe response will include the edited input text. Example Request: curl https://api.openai.com/v1/edits -H 'Content-Type: application/json' -H 'Authorization: Bearer $OPENAI_API_KEY' -d '{ 'model': 'text-davinci-edit-001', 'input': 'What day of the wek is it?', 'instruction': 'Fix the spelling mistakes' }'

How to handle and upload multiple images from Wized to Xano

Learn how to manage an array of blobs in Wized and how to send those properly to Xano. #webflow #wized #xano #tutorial #nocode #lowcode #visualdevelopment Wized clonable: https://app.wized.com/clone/ISmLamVkAd34Wza6Tk84 Our socials X (James) : https://twitter.com/jamesabadfe / jamesabadfe X (Ald) : https://twitter.com/aldgallardo Instagram: https://www.instagram.com/jamesabadf/ / jamesabadf Webflow Profile: https://webflow.com/@jamesabad Wized: https://wized.com/?via=james Xano: https://xano.io/gnsldrqh Book a free consultation for your next project 👇 https://www.produlis.com
Ald Gallardo
·Co-founder at Produlis | Webflow, Wized and Xano Agency

How to set up your Corse policy for Wized with Xano

How to enable your Xano corse policy to work with Wized server, your staging environment and production. 2 minutes tutorial [ Our socials ] X (James) : https://twitter.com/jamesabadfe / jamesabadfe X (Ald) : https://twitter.com/aldgallardo Instagram: https://www.instagram.com/jamesabadf/ / jamesabadf Webflow Profile: https://webflow.com/@jamesabad Wized: https://wized.com/?via=james Xano: https://xano.io/gnsldrqh Book a free consultation for your next project 👇 https://www.produlis.com #Webflow #Wized #Xano #NoCode #LowCode #wwx #supabase #webapp #saas #ai #webflowcms #clientfirst
Ald Gallardo
·Co-founder at Produlis | Webflow, Wized and Xano Agency

Good practices with fuzzy search | Produlis WWX Agency FT

How to properly set up a search filter with #webflow #wized and #xano, and also good practices with the #fuzzysearch functionality Xano has. Wized Clonable https://app.wized.com/clone/VMOcIDfXfvbaRp3UGiQ3 Webflow Clonable https://webflow.com/made-in-webflow/website/tutorial-pagination [ Our socials ] X (James) : https://twitter.com/jamesabadfe / jamesabadfe X (Ald) : https://twitter.com/aldgallardo Instagram: https://www.instagram.com/jamesabadf/ / jamesabadf Webflow Profile: https://webflow.com/@jamesabad Book a free consultation for your next project 👇 https://www.produlis.com
James Abad
·Co founder - Produlis

Chatgpt with Webflow, Wized and Xano | Produlis WWX Agency FT

Tutorial links Webflow clonable https://webflow.com/made-in-webflow/website/wizedtutorials Wized clonable https://app.wized.com/clone/an7Kq3iz78V2pG0wLzlW Xano https://www.xano.com/snippet/NQI7hTc7 Our socials X (James) : https://twitter.com/jamesabadfe / jamesabadfe X (Ald) : https://twitter.com/aldgallardo Instagram: https://www.instagram.com/jamesabadf/ / jamesabadf Webflow Profile: https://webflow.com/@jamesabad Book a free consultation for your next project 👇 https://www.produlis.com
James Abad
·Co founder - Produlis

Connect Xano (@nocodebackend) to Weweb (@weweb_io) with real-time messaging

Realtime can be a complicated setup, but it opens new possibilities! I show you how to connect Weweb and Xano to use real-time web socket push connections for the first time. Resources: Custom code I used: https://scripttag.statechange.ai/shared/a32785cc-26d7-4a6a-aa57-c020eeb8507c Xano Realtime docs: https://docs.xano.com/building-features/realtime#enabling-realtime
Ray Deck
Ray Deck
Xano Expert
·Lead Mentor @ statechange.ai

Dynamic staging and production environment for WWX

Video information Learn how to set up a dynamic staging and production environment for your Webflow, Wized and Xano project. You have to do this for every single project you build with #webflow , #wized and #xano
James Abad
·Co founder - Produlis

Stripe subscription flow with Webflow, Wized and Xano.

In this tutorial you will learn about setting up the credit card details of a customer without charging them directly, just like Uber or other apps do it. And then learn how to set up a subscription or any other type of payment with the stored payment method. Xano Snippets with all API Enpoints https://www.xano.com/snippet/bDq1wB37
James Abad
·Co founder - Produlis

Sync Airbnb with Xano using Webflow and Wized for the frontend. EP. 1

In this series of tutorials you will learn how to connect #airbnb with #xano and create a simple frontend to create booking with #webflow, #wized and #easypick calendar. Episode 1 of 4.
James Abad
·Co founder - Produlis

Community Challenges Instructions

Ready to dive into our Community Challenges? These challenges are a great way to learn new skills 📚, challenge yourself 🧗 , and showcase your abilities in the community 🏆. Whether you're a beginner looking to get your hands dirty or an experienced builder seeking to test your skills, these challenges are a great way to get your practice reps in 💪. Find the instructions below! 👇 📺 Video Instructions 📄 Step-by-Step Guide Install Community Challenges Snippet: https://www.xano.com/snippet/XwN5GThx You only need to install the snippet once, and you'll be able to solve any of the available challenges. Need help installing snippets? Check out our Preview and Add a Snippet Instructions Access the challenge_function Run the challenge_function with your email address associated with your community profile and the challenge_id. The challange_id can be found in the challenge graphic. After you run the function, it will provide you with both the instructions necessary to undertake the challenge and the data required to complete it. Congratulations! You've successfully begun the challenge! 🎉 Build the logic to solve the challenge. This can be done within the function stack inside the challenge_function function that was included in the snippet. 🛠️ Once you have a solution to the challenge you would like to submit, post your result as the result variable within the API provided. Execute this function to check if your answer is correct. You are allowed to submit your answer multiple times. Keep in mind that these challenges are designed to facilitate your learning, so feel free to ask for help if you have any questions. Happy learning! 📚

Challenge #34 - Value Collector

Objective: Extract the property values from an object and return them in an array. Define an Object: Create an object named book with the following properties: title with the value The Great Gatsby author with the value F. Scott Fitzgerald year with the value 1925 genre with the value Fiction Extract the Property Values: Use a function to extract all the property values of the book object into an array. Return this array as a variable named values_array. Submit your result contained in the variable values_array. Expected Result: Submit the variable values_array as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #33 - Key Extractor

Objective: Extract the property names (keys) from an object and return them in an array. Define an Object: Create an object named person with the following properties: firstName with the value John lastName with the value Doe age with the value 30 occupation with the value Engineer Extract the Property Names: Use a function to extract all the property names (keys) of the person object and store them in an array. Return this array as a variable named keys_array. Submit Your Result: Submit your result contained in the variable keys_array. Expected Result: Submit the variable keys_array as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #32 - Filter Non-Empty Entries from an Array

Objective: Create an array containing various elements, including empty values, and return a new array with only the non-empty entries. Instructions: Define the Array: Create an array variable named mixed_array and assign it the values [0, "apple", "", [], "orange", null, 23, [], "banana", 0, ""]. Filter Non-Empty Entries: Create a second array variable named filtered_array and use a filter to create an array that contains only the non-empty entries from mixed_array. Submit the array contained in the variable filtered_array. Expected Result: Submit the variable filtered_array as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #31 - Flatten a Multi-Dimensional Array

Objective: Create a multi-dimensional array and flatten it into a single-dimensional array. Instructions: Define the Multi-Dimensional Array: Create an array variable named nested_array and assign it the values [[1, 2, 3], [4, 5], [6, 7, 8, 9]]. Flatten the Array: Create a new variable named flattened_array and use a filter to combine all the elements from the sub-arrays in nested_array into a single, flat array. Submit the array contained in the variable flattened_array. Expected Result: Submit the variable flattened_array as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #30 - Add Item to Beginning of Array

Objective: Create an array and add a new element to the beginning of it. Instructions: Define the Array: Create an array variable named colors and assign it the initial values ['blue', 'green', 'yellow']. Add an Item: Add the color red at the beginning of the array colors. Submit the updated array contained in the variable colors. Expected Result: Submit the variable colors as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #29 - Add Item to End of Array

Objective: Create an array and add a new element to the end of it. Instructions: Define the Array: Create an array variable named numbers and assign it the initial values [1, 2, 3]. Add an Item: Using a filter, add the number 4 to the end of the array numbers. Submit the updated array contained in the variable numbers. Expected Result: Submit the variable numbers as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #28 - Count Items in Array

Objective: Create an array and count the number of items it contains. Instructions: Define the Array: Create an array variable named item_list and assign it the values [5, 10, 15, 20, 25]. Count the Items: Create a new variable named item_count and use a filter to calculate the number of items in item_list. Submit your result contained in the variable item_count. Expected Result: Submit the variable item_count as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Challenge #19 - Case Converter

Objective: Convert a string to all lowercase letters. Instructions: Define the Initial Text: Create a variable named input_text and assign it the value HELLO WORLD. Convert the Text: Create a variable named lowercase_text and use a filter to convert the value of input_text to all lowercase letters. Submit your result contained in the variable lowercase_text. Expected Result: Submit the variable lowercase_text as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

Text Substitution - Challenge #18

Objective: Substitute text within a URL using a dynamic variable. Instructions: Define the Base URL: Create a variable named base_url and assign it the value https://api.example.com/users/%s/details. Create a Dynamic User Name: Create a second variable named user_name and assign it the value CakeLover. Combine the URL and User ID: Create a variable named final_url and use a filter to combine base_url and user_name so that the %s in base_url is replaced with the value of user_name. Submit your result contained in the variable final_url. Expected Result: Submit the variable final_url as your answer. See example below: Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx

How to Group Data by Date

The focus of this conversation is on formatting transaction data for integration with the Bubble app by grouping transactions by date and ensuring the data structure is compatible. Initially, the user was receiving raw transaction data without proper field separation, causing issues in Bubble. They needed the transactions grouped by date, with each date containing its respective transactions as an array. The solution involved modifying the query and function stack to create the correct data structure. Steps included: Using an aggregate function to group transactions by date. Creating objects with date fields and transaction data arrays. Debugging and testing the query output to ensure the correct structure. After implementing these changes, the transaction data was correctly grouped by date, making it usable within Bubble's repeating groups.

Dates Displaying Incorrectly in Frontend (Adalo)

The focus of this conversation is on resolving an issue related to an API call within Adalo that involves integrating with Xano, specifically around time zone handling and data formatting. Initially, there were errors (HTTP 500 and 400) occurring due to incorrect date and time formatting between Adalo and Xano. The user was guided to change the time zone handling in the API calls from New York time to UTC. By running tests and examining the database records, they confirmed that the issue was due to the incorrect time zone conversion.

Adding a Custom CC to Sendgrid API Call

The focus of this conversation is on adding a CC (carbon copy) field to an email using a specific programming approach. Initially, the user was trying to add the CC field but faced issues with the expected data structures, receiving errors about mismatched types. The discussion included creating a CC variable to hold an array of CC objects, and then ensuring these objects have the correct key-value pairs (name and email). The user shared their current approach, which involved manipulating JSON inputs and handling arrays and objects. They received guidance on how to properly format the CC objects and push them into the array, including renaming variables and restructuring data to fit the expected format. They also discussed the importance of consulting documentation for required fields. Finally, after debugging and testing, they successfully created the CC field with the correct structure, ensuring the email function worked without errors. We cover practical implementation details such as creating and manipulating JSON objects, handling arrays in function stacks, and debugging data structure mismatches.

Tips: Uploading Files Bigger than 2GB

The focus of this conversation is on managing large file transfers, particularly wav and zip files exceeding 2GB. Key points covered include: The limitations and costs associated with storing large files directly in Xano. Recommendations to use external services like Amazon S3, Google Cloud Storage, or Uploadcare for handling large file storage. Explanation of how Uploadcare provides frontend components to handle direct uploads from the client, bypassing Xano, and sending notifications to Xano via webhooks. Guidance on orchestrating file transfers using API keys, Xano as a conductor, and handling notifications for successful uploads. Ensuring that Xano's integration is efficient by only handling structured data and orchestrating rather than processing large files directly. We also discussed finding relevant documentation and video resources for integrating external file storage services and managing webhooks to notify Xano of successful uploads.

Implementing Nested Channels in Realtime

The focus of this conversation is on implementing real-time nested channels for each user in an app, ensuring that these channels are private and require authentication. Key points covered include: Setting up real-time channels and ensuring each user has a dedicated private channel. Connecting to these channels via Postman for testing, and addressing issues related to establishing connections and authenticating users. Enabling anonymous connections temporarily to test nested channels. Using a base channel with unique identifiers for each user to maintain private communication. Adding authentication tokens to WebSocket connections in Postman by configuring headers properly. Disabling anonymous connections and ensuring messages are only sent to authenticated users. We covered practical implementation details such as testing nested channels with anonymous connections, dynamically generating private channels based on user IDs, and configuring Postman to authenticate WebSocket connections using tokens.

Sending an API Request from Shopify through Custom HTML/JavaScript

The focus of this conversation was on troubleshooting an issue with a custom HTML button in Shopify used for signing up via an API. Key points covered include: The issue where the form submission is not triggering any network events when sending data to Xano. Verification that the API endpoint URL is correct. Ensuring that the HTML and JavaScript are correctly set up, including checking for multiple instances of IDs causing conflicts. Adding console logs to debug and confirm that the form submission event is firing. We resolved the problem by identifying and removing duplicate elements with the same IDs and ensuring the JavaScript was correctly targeting the updated IDs. This allowed the form submission to successfully trigger and send data to the API.

Troubleshooting Realtime Connection

The focus of this conversation is on the practical implementation details of integrating Xano WebSockets to enable real-time updates within an application. Initially struggling with establishing and maintaining a stable connection and effectively managing message exchanges across sessions, the discussion pivoted towards troubleshooting the setup, specifically focusing on the correct configurations for channel connections.