-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·35 lines (29 loc) · 1.25 KB
/
main.cpp
File metadata and controls
executable file
·35 lines (29 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "common.hpp"
#include "ollama_client.hpp"
#include "server.hpp"
#include "config.hpp"
#include "commands.hpp"
int main()
{
LOG("Reading config");
g_config->fromFile("config.json");
g_cmd->registerCommand("GETWEATHER", "A tool that retrieves current weather data for a specified city (By calling real-time weather data API)",
helper_functions::getWeather);
auto comfyBaseDir = g_config->getValue<std::string>("comfy.fs_location");
if (!std::filesystem::exists(comfyBaseDir) || !std::filesystem::is_directory(comfyBaseDir))
{
LOG("Base directory for comfy does not exist: {}", comfyBaseDir);
LOG("Image generation will be disabled");
}
else
{
g_cmd->registerCommand("GENIMG", "A tool that generates an image based on an image description",
helper_functions::generateImage, false);
}
g_cmd->registerCommand("GENAUDIO", "A tool that generates music (as an audio file) based on a description",
helper_functions::generateMusic, false);
LOG("Starting backend");
auto webserver = std::make_unique<server>(g_config->getValue<std::string>("server.bind_address"), g_config->getValue<int>("server.bind_port"));
webserver->listen();
return 0;
}