echodict/llama.cpp
version https://git-lfs.github.com/spec/v1 oid sha256:cfc44b7ba25614df70e6b65e3341cae0310163bd32fd31a6b928a542df433faf size 30786
0773
1#pragma once2 3#include "server-common.h"4#include "server-http.h"5 6struct server_tool {7 std::string name;8 std::string display_name;9 bool permission_write = false;10 11 virtual ~server_tool() = default;12 virtual json get_definition() = 0;13 virtual json invoke(json params) = 0;14 15 json to_json();16};17 18struct server_tools {19 std::vector<std::unique_ptr<server_tool>> tools;20 21 void setup(const std::vector<std::string> & enabled_tools);22 json invoke(const std::string & name, const json & params);23 24 server_http_context::handler_t handle_get;25 server_http_context::handler_t handle_post;26};27 