deplyr
Log Indeplyr.com
  • Welcome
  • How-to Guides
    • Use AI in actions
    • Use App Data Storage
    • Use App Requirements Doc
  • Use App Versions
  • Use Realtime App Logger
  • Share Your Apps
  • Integrations
    • Using Google Sheets for Apps
    • Using Airtable for Apps
    • Using the Xero Integration
Powered by GitBook
On this page
  • Purpose
  • Usage Examples
  • Prompting Tips
  1. How-to Guides

Use AI in actions

Learn how to call an LLM inside of backend actions with our ai object.

Purpose

Use an LLM to generate text or analyze an image. Text generation with prompt alone; image analysis with prompt and imageBase64.

Method

await ai.process(options)

Parameters:

  • prompt (string, required)

  • imageBase64 (string, optional)

  • contentType (string, optional, default: "image/jpeg")

Usage Examples

// LLM will think of a joke
const joke = await ai.process({ prompt: "Tell me a joke" });
// LLM will analyze your image
const analysis = await ai.process({
  prompt: "What's in this image?",
  imageBase64: "base64", // Image must be in base64 format
  contentType: "image/jpeg" // (Optional)
});

Prompting Tips

You should tell the chat to “use ai”, for example:

Use AI to tell me a joke

PreviousWelcomeNextUse App Data Storage

Last updated 3 months ago