Skip to content

Compile an action

POST
/api/v1/actions/compile
curl --request POST \
--url http://localhost:11044/api/v1/actions/compile \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "description": "example", "inputTypeNames": [ "example" ], "llmModel": "example", "llmTemperature": 1, "name": "example", "outputTypeName": "example", "referenceNames": [ "example" ], "toolNames": [ "example" ] }'

Compiles a natural language description into a PromptedActionSpec. Uses the AI to generate a Jinja2 prompt template and saves to the world’s config/actions directory. The output type defaults to BackgroundMessage when not specified.

What to compile into a world action. name names the action and its file, config/actions/<name>.yml, which is overwritten if it exists; description is the natural-language brief an LLM turns into the Jinja2 prompt. inputTypeNames, toolNames and referenceNames default to empty, outputTypeName to com.embabel.agent.spec.model.BackgroundMessage; llmModel (default: the platform default) and llmTemperature (default 0.0) are saved on the action and also drive the compiling call, which uses 0.1 when the temperature is not positive

Media typeapplication/json

The body of POST /actions/compile: a description an LLM turns into a prompted action, saved to the world’s config/actions directory.

object
description
required

What the action should do, in natural language; the LLM writes the prompt template from it, and it is kept as the action’s description

string
inputTypeNames

Types the action takes as input, by name from GET /actions/available-types; each becomes a template variable named after the type’s simple name in lower camel case. Omitted means none

Array<string>
unique items
llmModel

Model the action runs on, which also writes its template; omitted uses the platform’s default model

string
llmTemperature

Sampling temperature the action runs at; 0.0 when omitted. Writing the template uses 0.1 when this is 0 or less

number format: double
name
required

Name of the action and of its file, config/actions/<name>.yml; a world action already saved under that name is overwritten

string
outputTypeName

Type the action produces, by name; omitted or blank means com.embabel.agent.spec.model.BackgroundMessage

string
referenceNames

Skills, reference documents or memory the action may draw on, by name from GET /actions/available-references; omitted means none

Array<string>
toolNames

Tools the action may call, by name from GET /actions/available-tools; omitted means none

Array<string>

Example generated

{
"description": "example",
"inputTypeNames": [
"example"
],
"llmModel": "example",
"llmTemperature": 1,
"name": "example",
"outputTypeName": "example",
"referenceNames": [
"example"
],
"toolNames": [
"example"
]
}

Compilation result

Media type*/*
object
key
additional properties
string

Compilation failed

Media type*/*

A refused action operation: not found, not editable, not deletable, or a compilation that failed

object
message
required

Why, written to be shown, naming the action

string
status
required

Always error

string
Allowed values: error