Class: SolidAgent::AgentManifest::Exporters::DotpromptExporter

Inherits:
BaseExporter
  • Object
show all
Defined in:
lib/solid_agent/agent_manifest/exporters/dotprompt_exporter.rb

Overview

DotpromptExporter converts Manifests to Google Genkit's .prompt format.

Examples:

Export a manifest

content = DotpromptExporter.export(manifest)

See Also:

Class Method Summary collapse

Class Method Details

.export(manifest, use_picoschema: true) ⇒ String

Export manifest to .prompt format

Parameters:

  • manifest (Manifest)

    The manifest to export

  • use_picoschema (Boolean) (defaults to: true)

    Export input schema as Picoschema

Returns:

  • (String)

    Exported content



24
25
26
27
28
29
# File 'lib/solid_agent/agent_manifest/exporters/dotprompt_exporter.rb', line 24

def export(manifest, use_picoschema: true, **)
  frontmatter = build_dotprompt_frontmatter(manifest, use_picoschema)
  body = manifest.template || manifest.instructions || ""

  "#{frontmatter}\n#{body.strip}\n"
end

.format_nameObject



15
16
17
# File 'lib/solid_agent/agent_manifest/exporters/dotprompt_exporter.rb', line 15

def format_name
  :dotprompt
end