LogoLogo
HomeExploreDocsAPIBlogContact
  • 🗃️Gooey.AI Docs
  • Changelog
  • 📖Guides
    • 🤖How to build an AI Copilot?
      • AI Prompting: Best practices
      • Curate your Knowledge Base Documents
      • Advanced Settings
      • Prepare Synthetic Data
      • Conversation Analysis
        • Glossary
      • Building a Multi-Modal Copilot
      • Frequently Asked Questions about AI Copilot
      • How to Automate Data Export?
    • 🚀How to deploy an AI Copilot?
      • Deploy to Web
      • Deploy to WhatsApp
      • Deploy to Slack
      • Deploy to Facebook
      • Broadcast Messages (via web or API)
      • Add buttons to your Copilot
    • ⚖️Understanding Bulk Runner and Evaluation
      • 💪How to set up Bulk Runner?
      • 🕵️‍♀️How to set up Evaluations?
      • How to use Bulk Run via API
    • 👄How to use AI Lip Sync Generator?
      • Lip Sync Animation Generator (WITH AUDIO FILES)
      • LipSync videos with Custom Voices
      • Set up your API for Lipsync with Local Folders
      • Tips to create great HD lipsync output
      • Frequently Asked Questions about Lipsync
    • 🗣️How to use ASR?
      • 📊How to create language evaluation for ASR?
    • How to use Compare AI Translations?
      • Google Translate Glossary
    • How does RAG-based document search work?
    • 🧩How to use Gooey Functions?
      • ✨LLM-enabled Functions
      • How to use SECRETS in Functions?
      • 🔥How to connect FirebaseDB to Copilot
    • 🎞️How to create AI Animations?
    • 🤳How to make amazing AI Art QR Codes?
      • API tips on AI Art QR Codes
    • 🖼️Create an AI Image with text
      • AI Image Prompting
      • API Tips for AI Image Generator
    • 📸AI Photo Editor
      • Build your avatar with AI
    • 🧑‍🏫How to use Gooey.AI’s Image Model Trainer?
    • 🔍Generate “People Also Ask” SEO Content
    • 🌐How to create SEO-Optimized content with AI?
    • How to use Workspaces?
      • How to use Version History?
      • How to add SECRETS in your Workspace?
    • 🍟How can I get free credits?
  • 😇CONTRIBUTING
    • Contributing
    • Documentation Style Guide
  • 🤓API REFERENCE
    • Getting started
    • API Generator
    • Rate Limits
    • Error Codes
  • 🍭ENDPOINTS
    • Copilot
    • Lipsync
    • Lipsync TTS
    • AI Art QR Generator
    • AI Animation Generator
    • Compare AI Image Generator
    • Gooey.AI on GitHub
Powered by GitBook
LogoLogo

Home

  • Gooey.AI
  • Explore Workflows
  • Sign In
  • Pricing

Learn

  • Docs
  • Blog
  • FAQs
  • Videos

Developers

  • How-to Guides
  • Get your Gooey.AI Key
  • Github
  • API Endpoints

Connect

  • Book a Demo
  • Discord
  • Team
  • Jobs

@Dara.network / Gooey.AI / support@gooey.ai

On this page
  • Where are LLM-enabled Functions useful?
  • How do LLM-enabled Functions work?
  • How to use LLM-enabled Functions?
  • Step 1
  • Step 2
  • Step 3
  • Step 4

Was this helpful?

Edit on GitHub
  1. Guides
  2. How to use Gooey Functions?

LLM-enabled Functions

Last updated 6 months ago

Was this helpful?

Where are LLM-enabled Functions useful?

There are many scenarios where we don't need to run the Functions for every Copilot query. For example:

  • User wants to calculate data in between the conversation (like an HVAC CFM Calculation)

  • LLM needs to do a Google search to respond to the query

  • LLM needs to do a look-up weather API and answer the query

How do LLM-enabled Functions work?

When the user sends a query in Natural Language, the LLM determines the following:

  1. does the query require a function?

  2. which part of the text should be passed as an argument in the function?

In the example below, the query is about CFM calculations which are commonly used in HVAC installations.

How to use LLM-enabled Functions?

Using LLM-enabled Functions is exactly the same as "BEFORE" and "AFTER" functions

Step 1

Step 2

Create your PROMPT Function:

  • create a basic fetch call for the weather of any location

  • create a serper

async ({ lat, long }) => {
  // Use Open-Meteo's public API for fetching weather data
  let url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${long}&current_weather=true`;
  let response = await fetch(url);
  let data = await response.json();
  return { weather: data.current_weather };
};
async ({ query }) => {
  var myHeaders = new Headers();
  myHeaders.append("X-API-KEY", "your API key");
  myHeaders.append("Content-Type", "application/json");
  
  var raw = JSON.stringify({
    "q": query
  });
  
  var requestOptions = {
    method: 'POST',
    headers: myHeaders,
    body: raw,
    redirect: 'follow'
  };
  
  let ret = await fetch("https://google.serper.dev/search", requestOptions);

  return { search_results: await ret.json() };
};

Step 3

Hit Submit, if your code is working fine you will get your outputs on the right side. Use the “Save as New” button and update the run name.

Step 4

Now head over to the Gooey workflow where you want to add the saved functions.

Head over to the example below:

Check the Functions option, and choose “PROMPT” from the dropdown and add your Saved example. And then hit "SUBMIT!

You can check your Functions output in the Workflow at the end of the page in "Details" section.

Head over the

You can find more

A basic Weather API call ()

An API call for serper - a service for google search ()

📖
🧩
✨
Functions workflow
examples here
link here
link here
LogoFarmer.Chat - with current weather data • Copilot by Computational Mama aka Ambika • Gooey.AI
A flowchart which shows the different flows