OPS this documentaion is not up to date to replact commit 8e44c11385
The API requires the system to be started as a server
This page provides API calls (without code examples) and describes how to handle requests and potential calls.
This page assumes a basic knowledge of programming, API usage, and JSON.
This page contains
Base line for all API calls
This API uses TCP and requires a JSON data package containing the 'endpoint' and the corresponding data.
{
"type": "ADD_TOOL", // This is a enum value from the [API endpoints enum]()
"data": {} // This JSON object contains the expected data for the API endpoint
}
this package can ether be compressed using gzip or sent raw Note: Currently, encryption and authentication are not available.
API Requests
Add a tool
Endpoint: ADD_TOOL
To add a tool, send a tool package and ensure that your system is set up to handle tool calls from the AI.
Tool json
{
"name": "a_tool_name", // The name for the tool, this is used for the AI and the backend to know where to send the required tool use
"description": "A description for the tool that describes what it dose", // A simple description for the tool
"arguments": [
{
"type": "string", // This is an enum value. Please refer to [Constants](https://server.4zellen.se:3000/Chat_things/NeuroDock/wiki/Constents#type-enums) wikipage
"name": "a_name_for_the_argument" // This is the argument variable name, so this is what you whuld refer to in your code to read the value
}
],
"required": ["a_name_for_the_argument"], // An array containing the argument name's to indicate witch is required and witch isn't
"response": "void" // This is an enum of what is the expected response type, this is mostly only for the backend and isn't required but helps to verify if the data returned is correct before giving it to the AI, the enum values are the same as the argument type but void is also accepted
}
Example of the in built tool get_current_date if it where to be defined with this API
{
"name": "get_current_date",
"description": "Get the current date",
"required": [],
"response": "string"
}
view Tool Handeling to see how this is done in code
Send a question
Endpoint: QUERY
This is probably the simplest API endpoint since it only requires the query data.
{
"type": "QUERY", // The API endpoint based on the [API endpoints enum]()
"data": {
"message": "The query" // the query/question
}
}
That is the whole API data package to request a qurry, this then get a response from the RESPONSE API endpoint
Advance options
If your query requires a tool call, include a "tools" key in the data object. This key should contain an array of the tools that the query requires.
{
"type": "QUERY", // The API endpoint based on the [API endpoints enum]()
"data": {
"message": "The query", // the query/question
"tools": [] // This array contains all the tool's you whant to call
}
}
example
{
"type": "QUERY", // The API endpoint based on the [API endpoints enum]()
"data": {
"message": "This is the current data %0", // the `%X` is used to spesify where the X'th tool's response shuld be put, the responses is in a json format and if not specified the response will always be put in json format at the start
"tools": ["get_current_date"]
}
}
example of what %0 whuld be in a call to get_current_date
{
"result": "Thu Feb 20 20:30:05 CET 2025", // the response from the tool
"tool": "get_current_date" // what tool was used
}