tools namespace
Classes
- struct function_call
- Function-call item emitted by a Responses model.
- struct function_tool
- Local executable function tool plus its JSON schema.
Functions
-
auto function_call_from_item(const nlohmann::json& item) → std::
optional<function_ call> - Parse a Responses output item as a function call when possible.
-
auto function_call_output(std::
string call_id, std:: string output) → nlohmann::json - Build the structured input item that returns output for a function call.
-
auto function_tool_definition(const function_
tool& tool) → nlohmann::json - Convert one local function tool to the Responses tool-definition object.
-
auto function_tool_definitions(const std::
vector<function_ tool>& tools) → nlohmann::json - Convert a list of local function tools to a Responses
toolsarray. -
auto run_function_tool(const std::
vector<function_ tool>& tools, const function_ call& call) → nxt:: task<std:: string> - Find and execute a local tool, returning a JSON error string on failure.
Function documentation
std:: optional<function_ call> nxt:: ai:: tools:: function_call_from_item(const nlohmann::json& item)
#include <nxtai/tools.hpp>
Parse a Responses output item as a function call when possible.
nlohmann::json nxt:: ai:: tools:: function_call_output(std:: string call_id,
std:: string output)
#include <nxtai/tools.hpp>
Build the structured input item that returns output for a function call.
nlohmann::json nxt:: ai:: tools:: function_tool_definition(const function_ tool& tool)
#include <nxtai/tools.hpp>
Convert one local function tool to the Responses tool-definition object.
nlohmann::json nxt:: ai:: tools:: function_tool_definitions(const std:: vector<function_ tool>& tools)
#include <nxtai/tools.hpp>
Convert a list of local function tools to a Responses tools array.
nxt:: task<std:: string> nxt:: ai:: tools:: run_function_tool(const std:: vector<function_ tool>& tools,
const function_ call& call)
#include <nxtai/tools.hpp>
Find and execute a local tool, returning a JSON error string on failure.