GenAI.Tool.Schema.Bool
(GenAI Core v0.3.1)
Copy Markdown
Represents a schema for boolean types, converting JSON schema attributes to Elixir struct fields.
Summary
Functions
Convert Json map to a GenAI.Tool.Schema.Bool struct, handling naming conventions.
Check if json is of type
Functions
Convert Json map to a GenAI.Tool.Schema.Bool struct, handling naming conventions.
Examples
Is of Type
iex> GenAI.Tool.Schema.Bool.from_json(%{"type" => "boolean", "description" => "A boolean value"})
{:ok, %GenAI.Tool.Schema.Bool{description: "A boolean value"}}Not of Type
iex> GenAI.Tool.Schema.Bool.from_json(%{"type" => "number"})
{:error, :unrecognized_type}
Check if json is of type
Examples
Is of Type
iex> GenAI.Tool.Schema.Bool.is_type(%{"type" => "boolean"})
trueNot of Type
iex> GenAI.Tool.Schema.Bool.is_type(%{"type" => "string"})
false