Agent

Structured agent calling

Local IDE Access

Most model providers grant access to a terminal or console to your agents while this could be a desired behavior its token expensive and time consuming compared with modern APIs, AgentBase grants access to your own IDE in order to cache, test and deploy the generated code for your prompts.

Usage

The /agent endpoint is used to send messages or commands to your agents. This is particularly useful for triggering Natural Language Tasks or tools from different models.

This endpoint will not call a function in your API normally, calling Agent will result in token consumption for your selected model.

The Return in the endopoint can be passed around through all the agents sequence you desing, extending, calling new tools or calling internal endpoints as assistants.

POST /agent

Create a new function, installs dependencies, builds tests and executes the resulting code

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

agent

string

Name of the agent

prompt

string

The instructions for AgentBase to transform in to code

data

object

The data example or parameters for your function to work

tools

array

List of internal functions to call whenever the agent decides is necessary. A default list is passed to all agents additional to your own.

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

Response

{
  "session_id": 1,
  "state": {
    "message" : "message example"
  },
  "status" : {
    "code" : 1,
    "status" : "waiting for user",
    "error": null
  },
  "error": null
}

Last updated

Was this helpful?