yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tool_schema_builder.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_SERVICE_AI_TOOL_SCHEMA_BUILDER_H_
2#define YAZE_SRC_CLI_SERVICE_AI_TOOL_SCHEMA_BUILDER_H_
3
4#include <string>
5#include <string_view>
6#include <vector>
7
8#include "absl/status/statusor.h"
10#include "nlohmann/json_fwd.hpp"
11
12namespace yaze::cli {
13
14// Normalizes prompt-catalogue and legacy asset tool schema shapes into a single
15// provider-neutral function declaration array. Provider adapters can then build
16// their native payloads from the same source data.
18 public:
19 static nlohmann::json BuildFunctionDeclarations(
20 const std::vector<ToolSpecification>& tool_specs);
21
22 static absl::StatusOr<nlohmann::json> ResolveFunctionDeclarations(
23 const PromptBuilder& prompt_builder);
24
25 static absl::StatusOr<nlohmann::json> ParseFunctionDeclarations(
26 std::string_view schema_json);
27
28 static absl::StatusOr<nlohmann::json> LoadFunctionDeclarationsFromAsset(
29 const std::string& relative_path = "agent/function_schemas.json");
30
31 static nlohmann::json BuildOpenAITools(
32 const nlohmann::json& function_declarations);
33
34 static nlohmann::json BuildGeminiTools(
35 const nlohmann::json& function_declarations);
36
37 static nlohmann::json BuildAnthropicTools(
38 const nlohmann::json& function_declarations);
39
40 private:
41 static absl::StatusOr<nlohmann::json> NormalizeFunctionDeclarations(
42 const nlohmann::json& schema_json);
43};
44
45} // namespace yaze::cli
46
47#endif // YAZE_SRC_CLI_SERVICE_AI_TOOL_SCHEMA_BUILDER_H_
static nlohmann::json BuildGeminiTools(const nlohmann::json &function_declarations)
static nlohmann::json BuildFunctionDeclarations(const std::vector< ToolSpecification > &tool_specs)
static nlohmann::json BuildAnthropicTools(const nlohmann::json &function_declarations)
static absl::StatusOr< nlohmann::json > LoadFunctionDeclarationsFromAsset(const std::string &relative_path="agent/function_schemas.json")
static absl::StatusOr< nlohmann::json > ResolveFunctionDeclarations(const PromptBuilder &prompt_builder)
static nlohmann::json BuildOpenAITools(const nlohmann::json &function_declarations)
static absl::StatusOr< nlohmann::json > ParseFunctionDeclarations(std::string_view schema_json)
static absl::StatusOr< nlohmann::json > NormalizeFunctionDeclarations(const nlohmann::json &schema_json)
Namespace for the command line interface.