# GenAI Core v0.3.1 - Table of Contents

Generative AI Wrapper: Core Protocols and Logic

## Pages

- [Contributing](readme.md)
- [Change Log](changelog.md)
- [Todo](todo.md)
- [CONTRIBUTING](contributing.md)
- [LICENSE](license.md)

## Modules

- [GenAI](GenAI.md)
- [GenAI.ChatCompletion](GenAI.ChatCompletion.md): Encodes a LLM ChatCompletion response.

- [GenAI.ChatCompletion.Choice](GenAI.ChatCompletion.Choice.md)
- [GenAI.ChatCompletion.Usage](GenAI.ChatCompletion.Usage.md)
- [GenAI.Config](GenAI.Config.md): Module for fetching, and setting global or per process default config settings.

- [GenAI.Document.ContentBlock](GenAI.Document.ContentBlock.md)
- [GenAI.Document.Link](GenAI.Document.Link.md)
- [GenAI.Document.PDF](GenAI.Document.PDF.md)
- [GenAI.Document.Text](GenAI.Document.Text.md)
- [GenAI.ExternalModel](GenAI.ExternalModel.md)
- [GenAI.Graph](GenAI.Graph.md): A module representing a graph structure in the GenAI system.
This module defines the structure and behavior of a graph,
including its nodes and the ability to append new nodes.

- [GenAI.Graph.Link](GenAI.Graph.Link.md): Represent a link between two nodes in a graph.

- [GenAI.Graph.MermaidProtocol](GenAI.Graph.MermaidProtocol.md): Mermaid Encode Protocol.

- [GenAI.Graph.MermaidProtocol.Helpers](GenAI.Graph.MermaidProtocol.Helpers.md): Helpers for generating Mermaid graphs using the GenAI.Graph.MermaidProtocol protocol.

- [GenAI.Graph.Node](GenAI.Graph.Node.md): Represent a node on graph (generic type).

- [GenAI.Graph.NodeBehaviour](GenAI.Graph.NodeBehaviour.md): Behaviour Graph Node Elements must adhere to.

- [GenAI.Graph.NodeProtocol](GenAI.Graph.NodeProtocol.md): Protocol for managing Graph Nodes.

- [GenAI.Graph.NodeProtocol.DefaultProvider](GenAI.Graph.NodeProtocol.DefaultProvider.md): Default provider for GenAI.Graph.NodeProtocol.
Uses function_exported? to invoke the passed module's implementation if any for calls.

- [GenAI.Graph.Root](GenAI.Graph.Root.md): The root data structure that contains nested graphs, nodes and other structures.

- [GenAI.Helpers](GenAI.Helpers.md): A collection of helper functions for VNextGenAI.

- [GenAI.InferenceProvider.DefaultProvider](GenAI.InferenceProvider.DefaultProvider.md): Inference Provider Default Provider.

- [GenAI.InferenceProvider.Helpers](GenAI.InferenceProvider.Helpers.md): Inference Provider Helpers.

- [GenAI.InferenceProviderBehaviour](GenAI.InferenceProviderBehaviour.md)
- [GenAI.Legacy.NodeProtocol](GenAI.Legacy.NodeProtocol.md)
- [GenAI.Media.Job](GenAI.Media.Job.md): A handle for an ASYNC (submit -> poll -> download) media generation (ADR-016) —
the shape long-running providers (music/video) return instead of inline bytes.
- [GenAI.Media.Request](GenAI.Media.Request.md): A media-generation request (ADR-016). The consumer facade `GenAI.generate_media/2`
takes one of these, the Router picks a provider, and the provider's `generate_media/2`
fulfils it.
- [GenAI.Media.Router](GenAI.Media.Router.md): Routes a `GenAI.Media.Request` to a provider that DECLARES support for its
(input, output) modality (ADR-016 D4 + dmitri N2: an explicit registry, not a
hand-waved candidate set).
- [GenAI.Message](GenAI.Message.md): GenAI.Message is now a unified message structure.
It's contents may include tool calls, results, images, audio, text blurbs, etc.
- [GenAI.Message.Content.AudioContent](GenAI.Message.Content.AudioContent.md): Represents image part of chat message.

- [GenAI.Message.Content.Document](GenAI.Message.Content.Document.md)
- [GenAI.Message.Content.ImageContent](GenAI.Message.Content.ImageContent.md): Represents image part of chat message.

- [GenAI.Message.Content.RedactedThinkingContent](GenAI.Message.Content.RedactedThinkingContent.md): Represents image part of chat message.

- [GenAI.Message.Content.TextContent](GenAI.Message.Content.TextContent.md): Represents image part of chat message.

- [GenAI.Message.Content.ThinkingContent](GenAI.Message.Content.ThinkingContent.md): Represents image part of chat message.

- [GenAI.Message.Content.ToolResultContent](GenAI.Message.Content.ToolResultContent.md): Represents image part of chat message.

- [GenAI.Message.Content.ToolUseContent](GenAI.Message.Content.ToolUseContent.md): Represents image part of chat message.

- [GenAI.Message.ContentProtocol](GenAI.Message.ContentProtocol.md): A protocol for handling different types of content in messages.

- [GenAI.Message.ToolCall](GenAI.Message.ToolCall.md)
- [GenAI.Message.ToolResponse](GenAI.Message.ToolResponse.md): Represents a tool response in a message thread.

- [GenAI.Message.ToolUsage](GenAI.Message.ToolUsage.md): Represents a tool call in a message thread.

- [GenAI.MessageProtocol](GenAI.MessageProtocol.md)
- [GenAI.Model](GenAI.Model.md): Represents a Provider Model plus picker details and encoder.

- [GenAI.Model.Encoder.DefaultProvider](GenAI.Model.Encoder.DefaultProvider.md)
- [GenAI.Model.EncoderBehaviour](GenAI.Model.EncoderBehaviour.md)
- [GenAI.ModelDetail.BenchMarks](GenAI.ModelDetail.BenchMarks.md): Last reported model evaluation benchmark scores.

- [GenAI.ModelDetail.Capacity](GenAI.ModelDetail.Capacity.md): Provides standardized structure for tracking capacity details.
- [GenAI.ModelDetail.Costing](GenAI.ModelDetail.Costing.md): Provides standardized structure for tracking costing details.
- cost per million input tokens
- cost per million output tokens
- cost per hour
- cost per request
- media costs

- [GenAI.ModelDetail.FineTuning](GenAI.ModelDetail.FineTuning.md): Tracks fine tuning details for the model, if any.
- Type of fine tuning
- Fine Tuning Date
- Fine Tuning Notes

- [GenAI.ModelDetail.HyperParamSupport](GenAI.ModelDetail.HyperParamSupport.md): Provides standardized structure for tracking hyper parameter support such as allowed values, ranges, mapping etc.

- [GenAI.ModelDetail.ModalitySupport](GenAI.ModelDetail.ModalitySupport.md): Provides standardized structure for tracking modality support details.
  For example if a model can mimic video support by streaming images,
  plus audio transcription. Or supports native image and audio.

- [GenAI.ModelDetail.ToolUsage](GenAI.ModelDetail.ToolUsage.md): Provides details on tool usage support: native (api level), prompt injection, no support, etc.

- [GenAI.ModelDetail.TrainingDetails](GenAI.ModelDetail.TrainingDetails.md): Provides standardized structure for tracking training details such as training cut off, supplemental_training per subject cut offs, etc. censorship. instruct training, dolphin, etc.

- [GenAI.ModelDetail.UseCaseSupport](GenAI.ModelDetail.UseCaseSupport.md): Provides standardized structure for tracking use case support details.
Where use case is the ability of the model to perform a task like feature extraction, generating synthetic memories, etc.
Tracks both per model fixed scores plus dynamic adjustments based on system/user feedback.

- [GenAI.ModelDetails](GenAI.ModelDetails.md): Provides standardized structure for tracking extended module details.

- [GenAI.ModelMetadata.DefaultProvider](GenAI.ModelMetadata.DefaultProvider.md)
- [GenAI.ModelMetadata.ProviderBehaviour](GenAI.ModelMetadata.ProviderBehaviour.md)
- [GenAI.ModelProtocol](GenAI.ModelProtocol.md)
- [GenAI.Provider.ModelsBehaviour](GenAI.Provider.ModelsBehaviour.md)
- [GenAI.Records.Directive](GenAI.Records.Directive.md): Records used by for directive processing.

- [GenAI.Records.Link](GenAI.Records.Link.md): Records related to graph links.

- [GenAI.Records.Node](GenAI.Records.Node.md): Records used by for preparing/processing nodes.

- [GenAI.Session.Runtime](GenAI.Session.Runtime.md): Tracks runtime/operating time state of session/thread.

- [GenAI.Session.State](GenAI.Session.State.md): Represent status/state such as node state, sessions, message thread, etc.

- [GenAI.Session.State.Directive](GenAI.Session.State.Directive.md): Directive that is applied to build effective state.

- [GenAI.Session.StateEntry](GenAI.Session.StateEntry.md): A entry (built by directives) in a session state struct.

- [GenAI.Setting](GenAI.Setting.md): A module representing a setting node in a graph structure.
This module defines the structure and behavior of a setting node,
including its identifier, setting, and value.

- [GenAI.Setting.ModelSetting](GenAI.Setting.ModelSetting.md): Represents a Provider Setting (used by Gemini)

- [GenAI.Setting.ProviderSetting](GenAI.Setting.ProviderSetting.md): Represents a Provider Setting (used by Gemini)

- [GenAI.Setting.SafetySetting](GenAI.Setting.SafetySetting.md): Represents a Model Safety Setting (used by Gemini)

- [GenAI.State.Directive](GenAI.State.Directive.md): A state directive applies selection values for specified state entries

- [GenAI.State.Entry](GenAI.State.Entry.md): A setting entry like model, provider, temperature set via directive.

- [GenAI.StreamHandler](GenAI.StreamHandler.md)
- [GenAI.StreamHandler.Behaviour](GenAI.StreamHandler.Behaviour.md)
- [GenAI.StreamHandler.Default](GenAI.StreamHandler.Default.md)
- [GenAI.StreamHandler.Default.Accumulator](GenAI.StreamHandler.Default.Accumulator.md)
- [GenAI.Thread.LegacyStateProtocol](GenAI.Thread.LegacyStateProtocol.md)
- [GenAI.Thread.Session](GenAI.Thread.Session.md): More advanced VNext Thread Implementation

- [GenAI.Thread.Standard](GenAI.Thread.Standard.md): This module defines the chat struct used to manage conversations with generative AI models.

- [GenAI.Thread.State](GenAI.Thread.State.md)
- [GenAI.ThreadProtocol](GenAI.ThreadProtocol.md)
- [GenAI.Tool](GenAI.Tool.md): Represents a function that can be called by the model.

- [GenAI.Tool.Schema.Bool](GenAI.Tool.Schema.Bool.md): Represents a schema for boolean types, converting JSON schema attributes to Elixir struct fields.

- [GenAI.Tool.Schema.Enum](GenAI.Tool.Schema.Enum.md): Represents a schema for enum types, converting JSON schema attributes to Elixir struct fields.

- [GenAI.Tool.Schema.Integer](GenAI.Tool.Schema.Integer.md): Represents a schema for integer types, converting JSON schema attributes to Elixir struct fields.

- [GenAI.Tool.Schema.Null](GenAI.Tool.Schema.Null.md): Represents a schema for null types.

- [GenAI.Tool.Schema.Number](GenAI.Tool.Schema.Number.md): Represents a schema for number types, including integers and floating-point numbers.

- [GenAI.Tool.Schema.Object](GenAI.Tool.Schema.Object.md): Represents a schema for object types, converting JSON schema attributes to Elixir struct fields.

- [GenAI.Tool.Schema.String](GenAI.Tool.Schema.String.md): Represents a schema for string types, converting JSON schema attributes to Elixir struct fields.

- [GenAI.Tool.Schema.Type](GenAI.Tool.Schema.Type.md): Extract known schema types from JSON.
- [GenAI.Tool.Schema.TypeBehaviour](GenAI.Tool.Schema.TypeBehaviour.md): Tool Schema Type Behaviour

- [GenAI.ToolProtocol](GenAI.ToolProtocol.md)
- [GenAI.Types](GenAI.Types.md): VNextGenAI Types

- [GenAI.Types.Graph](GenAI.Types.Graph.md): GenAI.VNext.Graph Type Declarations.

- [GenAI.VNext.Graph](GenAI.VNext.Graph.md): A graph data structure for representing AI graphs, threads, conversations, uml, etc. Utility Class

- Exceptions
  - [GenAI.Graph.Exception](GenAI.Graph.Exception.md): Generic Graph Exception

  - [GenAI.RequestError](GenAI.RequestError.md): Custom error for handling request errors in the GenAI module.

