View Source ExOpenAI.Codegen.ComponentModuleGenerator (ex_openai.ex v2.0.0-beta2)
Generates Elixir modules from parsed OpenAPI Schema structs.
Summary
Functions
Generates comprehensive module documentation including field descriptions.
Generates documentation for all fields in an object schema.
Generates an Elixir module from a Schema struct.
Functions
Generates comprehensive module documentation including field descriptions.
For object schemas, this includes a fields section with details about each property. For non-object schemas, this provides type information.
@spec generate_comprehensive_moduledoc(ExOpenAI.Codegen.DocsParser.Schema.t(), %{ optional(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t() }) :: String.t()
@spec generate_fields_documentation(ExOpenAI.Codegen.DocsParser.Schema.t(), %{ optional(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t() }) :: String.t()
Generates documentation for all fields in an object schema.
Returns a formatted string with field names, types, requirements, and descriptions.
@spec generate_module(ExOpenAI.Codegen.DocsParser.Schema.t(), %{ required(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t() }) :: Macro.t()
Generates an Elixir module from a Schema struct.
Takes a parsed Schema and returns the AST for a module definition. For allOf schemas, it first resolves/merges them before checking if they're objects.