AI Engine Functions API
Most of the endpoints depends on various instances and are considered parameters for the actual endpoint, but these are not meant to be passed directly by the user.
Instead, these instance-dependent elements are integrated and managed directly by the backend system. We refer to them as *name_parameter
, where the asterisk (*) is used to denote a specific instance-dependent parameter that the route relies on.
Mind that: to access these APIs, user must be authenticated and have the correct permissions.
Overview
The AI Engine Functions API allows you to interact with the DeltaV backend, allowing you to interact with your functions and more.
EndpointsPOST /v1beta1/functions/ GET /v1beta1/functions/ GET /v1beta1/functions/agent-functions/:agent_address/ GET /v1beta1/functions/:function_id/ PUT /v1beta1/functions/:function_id/ POST /v1beta1/functions/duplicate/:function_id/ DELETE /v1beta1/functions/:function_id/ PUT /v1beta1/functions/start-testing/:function_id/ PUT /v1beta1/functions/submit-for-review/:function_id/ PUT /v1beta1/functions/unpublish/:function_id/ PUT /v1beta1/functions/add-to-function-group/:function_id/:function_group_id/ DELETE /v1beta1/functions/remove-from-function-group/:function_id/:function_group_id/ GET /v1beta1/functions/:function_id/groups/ DELETE /v1beta1/functions/delete-functions-of-agent/:agent_address/ DELETE /v1beta1/functions/user/delete-all-functions/
Create a function
Endpoint:POST/v1beta1/functions/
Request
- Name
agent
- Type
- string
- Description
- Address of agent.
- Name
name
- Type
- string
- Description
- Name of function.
- Name
description
- Type
- string
- Description
- Description of function.
- Name
protocolDigest
- Type
- string
- Description
- Digest of protocol associated with the agent.
- Name
modelDigest
- Type
- string
- Description
- Digest of model associated with the protocol.
- Name
modelName
- Type
- string
- Description
- Request model name and protocol name separated by a slash character.
- Name
arguments
- Type
- JSON
- Description
- Properties of all request model arguments as a list. Every element contains the name of the respective argument, the fact that the argument is required or not (true/false), the type of the argument, and the description.
- Name
type
- Type
- string
- Description
- Type of the function. Can be PRIMARY or SECONDARY.
- Name
isDialogue
- Type
- boolean
- Required
- optional
- Description
- Default is true. Denotes if the registered function is dialogue or not.
- Name
metadata_properties
- Type
- JSON
- Required
- optional
- Description
- Optional JSON object. Gives user the option to add additional metadata related to the function. Currently only geo-location data is supported. Structure is {"geo_location":{"location":{"lat":${lat},"lon":${lon}},"radius":${radius}}} - see details below.
- Name
metadata_properties-geo_location
- Type
- JSON
- Description
- JSON object. Currently this is the only metadata supported. Structure is {"location":{"lat":${lat},"lon":${lon}},"radius":${radius}} - see details below.
- Name
metadata_properties-geo_location-location
- Type
- JSON
- Description
- JSON object. Latitude and longitude data relate. Structure is {"lat":${lat},"lon":${lon}} - see details below.
- Name
metadata_properties-geo_location-location-lat
- Type
- float
- Description
- Latitude related to the function.
- Name
metadata_properties-geo_location-location-lon
- Type
- float
- Description
- Longitude related to the function.
- Name
metadata_properties-geo_location-radius
- Type
- float
- Required
- optional
- Description
- Optional radius related to the function.
curl -X POST
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/ -d "{\"agent\":\"agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy\",\"name\":\"Stock price function\",\"description\":\"Retrieves the stock price of a share.\",\"protocolDigest\":\"proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a\",\"modelDigest\":\"model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2\",\"modelName\":\"StockPrice/StocksProtocol\",\"arguments\":[{\"name\":\"symbol\",\"required\":true,\"type\":\"string\",\"description\":\"The symbol of the share, for example: AAPL, GOOG, MSFT, etc.\"}],\"type\":\"PRIMARY\",\"metadata_properties\":{\"geo_location\":{\"location\":{\"lat\":52.205338,\"lon\":0.121817},\"radius\":10}}}"
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "CREATED", "isDialogue": false, "metadata": { "geo_location": { "location": { "lat": 52.205338, "lon": 0.121817 }, "radius": 10 } } }
Get all functions of a user
Endpoint:GET/v1beta1/functions/
Request
curl -X GET
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/
Responses
[ { "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "CREATED", "numInteractions": 100 }, { "uuid": "ebfa27ec-c978-4109-bb77-9d1809e3b0f6", "agent": "agent1q0vmxjv06dwdlppuvspmfyff4ys2t4mdndpa09gulpsuq90n22xqy8k89l8", "name": "Flights function", "description": "Searches for flight offers.", "protocolDigest": "proto:266661f975b0857631cc31b40f60c263aeabb0c7156ed6b2b940a23bfc6560a0", "type": "PRIMARY", "createdAt": "2023-10-22T21:08:47", "updatedAt": "2023-10-22T21:08:47", "status": "CREATED", "numInteractions": 150 } ]
Get all user's agent functions
Endpoint:GET/v1beta1/functions/agents-functions/{agent_address}/
Request
- Name
limit
- Type
- int
- Description
- The number of functions to return.
- Name
offset
- Type
- int
- Description
- The number of functions to skip.
curl -X GET
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/agents-functions/{agent_address}/
Responses
[ { "uuid": "ebfa27ec-c978-4109-bb77-9d1809e3b0f6", "agent": "agent1q0vmxjv06dwdlppuvspmfyff4ys2t4mdndpa09gulpsuq90n22xqy8k89l8", "name": "Flights function", "description": "Searches for flight offers.", "protocolDigest": "proto:266661f975b0857631cc31b40f60c263aeabb0c7156ed6b2b940a23bfc6560a0", "type": "PRIMARY", "createdAt": "2023-10-22T21:08:47", "updatedAt": "2023-10-22T21:08:47", "status": "CREATED", "numInteractions": 150 }, { "uuid": "c0f248ea-1d78-ca3f-fb31-1a14ceef12a6", "agent": "agent1q0vmxjv06dwdlppuvspmfyff4ys2t4mdndpa09gulpsuq90n22xqy8k89l8", "name": "Booking Protocol", "description": "Books a flight.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "type": "PRIMARY", "createdAt": "2023-10-22T21:08:47", "updatedAt": "2023-10-22T21:08:47", "status": "CREATED", "numInteractions": 150 } ]
Fetch a function
Endpoint:GET/v1beta1/functions/{function_id}/
Request
curl -X GET
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/{function_id}/
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "CREATED", "isDialogue": false, "metadata": null }
Update a function
Endpoint:PUT/v1beta1/functions/{function_id}/
Request
- Name
agent
- Type
- Optional[string]
- Description
- Optional - Address of agent.
- Name
name
- Type
- Optional[string]
- Description
- Optional - Name of function.
- Name
description
- Type
- Optional[string]
- Description
- Optional - Description of function.
- Name
protocolDigest
- Type
- Optional[string]
- Description
- Optional - Digest of protocol associated with the agent.
- Name
modelDigest
- Type
- Optional[string]
- Description
- Optional - Digest of model associated with the protocol.
- Name
modelName
- Type
- Optional[string]
- Description
- Optional - Request model name and protocol name separated by a slash character.
- Name
arguments
- Type
- Optional[[]JSON]
- Description
- Optional - Properties of all request model arguments as a list. Every element contains the name of the respective argument, the fact that the argument is required or not (true/false), the type of the argument, and the description.
- Name
type
- Type
- Optional[string]
- Description
- Optional - Type of the function. Can be PRIMARY or SECONDARY.
- Name
isDialogue
- Type
- boolean
- Required
- optional
- Description
- Default is false. Denotes if the registered function is dialogue or not.
- Name
metadata_properties
- Type
- JSON
- Required
- optional
- Description
- Optional JSON object. Gives user the option to add additional metadata related to the function. Currently only geo-location data is supported. Structure is {"geo_location":{"location":{"lat":${lat},"lon":${lon}},"radius":${radius}}} - see details below.
- Name
metadata_properties-geo_location
- Type
- JSON
- Description
- JSON object. Currently this is the only metadata supported. Structure is {"location":{"lat":${lat},"lon":${lon}},"radius":${radius}} - see details below.
- Name
metadata_properties-geo_location-location
- Type
- JSON
- Description
- JSON object. Latitude and longitude data relate. Structure is {"lat":${lat},"lon":${lon}} - see details below.
- Name
metadata_properties-geo_location-location-lat
- Type
- float
- Description
- Latitude related to the function.
- Name
metadata_properties-geo_location-location-lon
- Type
- float
- Description
- Longitude related to the function.
- Name
metadata_properties-geo_location-radius
- Type
- float
- Required
- optional
- Description
- Optional radius related to the function.
curl -X PUT
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/{function_id}/ -d "{\"agent\":\"agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy\",\"name\":\"Stock price function modified name\",\"description\":\"Retrieves the stock price of a share.\",\"protocolDigest\":\"proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a\",\"modelDigest\":\"model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2\",\"modelName\":\"StockPrice/StocksProtocol\",\"arguments\":[{\"name\":\"symbol\",\"required\":true,\"type\":\"string\",\"description\":\"The symbol of the share, for example: AAPL, GOOG, MSFT, etc.\"}],\"type\":\"PRIMARY\",\"metadata_properties\":{\"geo_location\":{\"location\":{\"lat\":52.205338,\"lon\":0.121817},\"radius\":10}}}"
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function modified name", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-23T21:28:46", "status": "CREATED", "isDialogue": false, "metadata": { "geo_location": { "location": { "lat": 52.205338, "lon": 0.121817 }, "radius": 10 } } }
Duplicate a function
Endpoint:POST/v1beta1/functions/duplicate/{function_id}/
Request
curl -X POST
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/duplicate/{function_id}/
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "CREATED", "isDialogue": false, "metadata": null }
Delete a function
Endpoint:DELETE/v1beta1/functions/{function_id}/
Request
curl -X DELETE
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/{function_id}/
Responses
{}
Start testing of a function
Endpoint:PUT/v1beta1/functions/start-testing/{function_id}/
Request
curl -X PUT
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/start-testing/{function_id}/
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "TESTING", "isDialogue": false, "metadata": null }
Submit a function for review
Endpoint:PUT/v1beta1/functions/submit-for-review/{function_id}/
Request
curl -X PUT
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/submit-for-review/{function_id}/
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "IN-REVIEW", "isDialogue": false, "metadata": null }
Unpublish a function
Endpoint:PUT/v1beta1/functions/unpublish/{function_id}/
Request
curl -X PUT
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/unpublish/{function_id}/
Responses
{ "uuid": "37da66a9-9649-4b7a-9112-f461a2bd923d", "agent": "agent1qdnt5j8wr7cyzupu759w79scp3uaz50m33lfqazsf2tpfz84qfazjgnvfvy", "name": "Stock price function", "description": "Retrieves the stock price of a share.", "protocolDigest": "proto:05c3504f6d6486792e8410c9d1c6d626991fc8e0007bae960acb2ab1dd83072a", "modelDigest": "model:4ec922f7f18419cf7c6742f96eb4543a7ed5c131af077ca2b267607f65e62eb2", "modelName": "StockPrice/StocksProtocol", "arguments": [ { "name": "symbol", "required": true, "type": "string", "description": "The symbol of the share, for example: AAPL, GOOG, MSFT, etc." } ], "type": "PRIMARY", "createdAt": "2023-10-22T21:28:46", "updatedAt": "2023-10-22T21:28:46", "status": "TESTING", "isDialogue": false, "metadata": null }
Add function to function group
Endpoint:PUT/v1beta1/functions/add-to-function-group/{function_id}/{function_group_id}/
Request
curl -X PUT
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/add-to-function-group/{function_id}/{function_group_id}/
Responses
{ "function": "be14fb4f-b7a5-4233-937d-cce29fb8a3ea", "functionGroup": "c02ed9ce-62df-46d1-bfaa-8c8b309a4a40" }
Remove function from function group
Endpoint:DELETE/v1beta1/functions/remove-from-function-group/{function_id}/{function_group_id}/
Request
curl -X DELETE
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/remove-from-function-group/{function_id}/{function_group_id}/
Responses
{}
Fetch all function groups that the function belongs to
Endpoint:GET/v1beta1/functions/{function_id}/groups/
Request
curl -X GET
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/{function_id}/groups/
Responses
[ { "uuid": "d5a8f3a4-f219-42ec-a09d-7225fb5b790a", "name": "My Functions", "isPrivate": true } ]
Delete all user's agent functions
Endpoint:DELETE/v1beta1/functions/delete-functions-of-agent/{agent_address}/
Request
curl -X DELETE
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/delete-functions-of-agent/{agent_address}/
Responses
{}
Delete all user's functions
Endpoint:DELETE/v1beta1/functions/user/delete-all-functions/
Request
curl -X DELETE
-H "Authorization: bearer <your token here>" -H "Content-Type: application/json"
https://agentverse.ai/v1beta1/functions/user/delete-all-functions/
Responses
{}