Zoonk.AI.AISchema (Zoonk v0.1.0-dev)
View SourceDefines schema specifications for structured AI outputs.
This module lets you create JSON Schema definitions to ensure AI responses follow a specific structure.
It supports nested schemas and field definitions with various data types.
Summary
Functions
Adds fields to the schema.
Functions
Adds fields to the schema.
Examples
iex> AISchema.add_field(%AISchema{}, %{name: "string"})
%AISchema{schema: %{properties: %{name: %{type: "string"}}}}
iex> AISchema.add_field(%AISchema{}, %{age: "integer", name: "string"})
%AISchema{schema: %{properties: %{age: %{type: "integer"}, name: %{type: "string"}}}}
iex> AISchema.add_field(%AISchema{}, %{courses: [%{title: "string"}]})
%AISchema{schema: %{properties: %{courses: %{type: "array", items: %{type: "object", properties: %{title: %{type: "string"}}}}}}}
iex> AISchema.add_field(%AISchema{}, [%{title: "string"}])
%AISchema{schema: %{type: "array", items: %{type: "object", properties: %{title: %{type: "string"}}}}}