forgeant docs-test-0
Build LLM-powered agents in C++
Loading...
Searching...
No Matches
param_schema.hpp
Go to the documentation of this file.
1#ifndef FORGEANT_SCHEMA_PARAM_SCHEMA_HPP
2#define FORGEANT_SCHEMA_PARAM_SCHEMA_HPP
3
5#include <string>
6
7namespace forgeant {
8
9template <typename T>
11 static_assert(sizeof(T) == 0, "ParamSchema not specialized for this type. "
12 "Use FORGEANT_PARAMS or specialize ParamSchema<T>.");
13};
14
15template <>
16struct ParamSchema<std::string> {
17 static Json schema() { return Schema::string().build(); }
18};
19
20template <>
21struct ParamSchema<int> {
22 static Json schema() { return Schema::integer().build(); }
23};
24
25template <>
26struct ParamSchema<double> {
27 static Json schema() { return Schema::number().build(); }
28};
29
30template <>
31struct ParamSchema<bool> {
32 static Json schema() { return Schema::boolean().build(); }
33};
34
35} // namespace forgeant
36
37#endif // FORGEANT_SCHEMA_PARAM_SCHEMA_HPP
Definition json.hpp:27
static SchemaBuilder string()
static SchemaBuilder number()
static SchemaBuilder integer()
static SchemaBuilder boolean()
Definition agent.hpp:25
static Json schema()
Definition param_schema.hpp:32
static Json schema()
Definition param_schema.hpp:27
static Json schema()
Definition param_schema.hpp:22
static Json schema()
Definition param_schema.hpp:17
Definition param_schema.hpp:10