Official C SDK for building Nebo apps.
mkdir build && cd build
cmake ..
make#include <nebo/nebo.h>
static int my_execute(const char *input_json, char **output, int *is_error) {
*output = strdup("Hello from C!");
*is_error = 0;
return 0;
}
static const char *actions[] = {"greet", NULL};
int main(void) {
nebo_schema_builder_t *sb = nebo_schema_new(actions);
nebo_schema_string(sb, "name", "Who to greet", 1);
char *schema = nebo_schema_build(sb);
nebo_schema_free(sb);
nebo_tool_handler_t tool = {
.name = "greeter",
.description = "Says hello.",
.schema = schema,
.execute = my_execute,
};
nebo_app_t *app = nebo_app_new();
nebo_app_register_tool(app, &tool);
int ret = nebo_app_run(app);
free(schema);
return ret;
}See Creating Nebo Apps for the full guide.