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