Multi Step Functions

Overview

Use a flow that creates diferent steps and prompts the returns as parameters for the next.

Prompt Engineering

The easiest way to generate this behavior is with clear steps and actions and the prompt Generate, create, etc.

1. Generate a function to fetch all users 2. Generate a function to fetch all invoices for the users in the array.

Usage

Leverage Base to easily design your API and prototype apps, UX, or screens. To experiment with different outcomes, set "cached" to false

Using /base with "cached" is equivalent to direclty calling the function after is creation, all none neccesary params will be ignored.

POST /base

Creates a new flow with one or more actions, installs dependencies, builds tests and executes the resulting code.

Actions can be agents, backend functions, or cloud functions.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

name

string

Name of the flow to summarize the actions

prompt

string

The instructions for AgentBase to transform in to code

data

object

The data example or parameters for your function to work

schedule

string

The cron calendar for the function to run automatically

return

object

The data example of your expected return

model

string

The model to run for your prompt

errors

array

List or possible errors your function needs to catch

cached

boolean

It will use the last version of the function whenever is available to save time and tokens

Response

{
  "run_id": 1,
  "return" : {
        "users_count":"count"
  },
  "error": null
}

Body Example


{
    "function": "analyze_user_invocies",
    "prompt": "find the users with a login in the last 20 days, then find the users invoices with a due balance and send the users an email with a payment reminder",
    "data" : {
    },
    "return" : {
        "users_count":"count"
    }
}

Last updated

Was this helpful?