nxtai/tools.hpp file

Namespaces

namespace nxt
namespace nxt::ai
namespace nxt::ai::tools

Classes

struct nxt::ai::tools::function_call
Function-call item emitted by a Responses model.
struct nxt::ai::tools::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 tools array.
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.