Function

Token saving capabilities and recommendations

tUsage

After a function is created you can make direct usage of the function:

POST /function

The return, data, logs and code of the function can be passed around through different agents trough the agent sequence you decide.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

function

string

Name of the function

data

object

The data example or parameters for your function to work

errors

array

List or possible errors your function needs to catch

version

number

The version of the function to execute

bearer_token

string

Auth0 user session token to validate and ACL to database

Response

{
  "run_id": 1,
  "return": {
    "message" : "message example"
  },
  "error": null
}
//body example
{
    "function": "create_lead"
    "prompt": "create a new lead and send an email to the sales team with the info",
    "data" : {
        "email": "[email protected]"
        "subject": "subject example"
        "message": "message example"
    },
    "return" : {
        "agent_message" : {
            "type" : "string"
            "description" : "the customer success agent message"
        }
    }
}

Last updated

Was this helpful?