GenAI.Tool.Schema.Number
(GenAI Core v0.3.1)
Copy Markdown
Represents a schema for number types, including integers and floating-point numbers.
Summary
Functions
Convert Json map to a GenAI.Tool.Schema.Number struct, handling naming conventions.
Check if json is of type
Types
Functions
Convert Json map to a GenAI.Tool.Schema.Number struct, handling naming conventions.
Examples
Is of Type
iex> GenAI.Tool.Schema.Number.from_json(%{"type" => "number", "description" => "A number value"})
{:ok, %GenAI.Tool.Schema.Number{description: "A number value"}}Not of Type
iex> GenAI.Tool.Schema.Number.from_json(%{"type" => "string"})
{:error, :unrecognized_type}
Check if json is of type
Examples
Is of Type
iex> GenAI.Tool.Schema.Number.is_type(%{"type" => "number"})
trueNot of Type
iex> GenAI.Tool.Schema.Number.is_type(%{"type" => "string"})
false