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