Class: SolidAgent::AgentManifest::Exporters::CrewAIExporter

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

Overview

CrewAIExporter converts Manifests to CrewAI's agents.yaml format.

Examples:

Export a single manifest

content = CrewAIExporter.export(manifest)

Export multiple manifests

content = CrewAIExporter.export_multiple([manifest1, manifest2])

See Also:

Class Method Summary collapse

Class Method Details

.export(manifest) ⇒ String

Export manifest to CrewAI agents.yaml format

Parameters:

  • manifest (Manifest)

    The manifest to export

Returns:

  • (String)

    Exported YAML content



26
27
28
# File 'lib/solid_agent/agent_manifest/exporters/crewai_exporter.rb', line 26

def export(manifest, **)
  export_multiple([manifest])
end

.export_multiple(manifests) ⇒ String

Export multiple manifests to a single agents.yaml

Parameters:

  • manifests (Array<Manifest>)

    Manifests to export

Returns:

  • (String)

    Exported YAML content



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/solid_agent/agent_manifest/exporters/crewai_exporter.rb', line 34

def export_multiple(manifests)
  agents = {}

  manifests.each do |manifest|
    agent_key = manifest.name.to_s.tr("-", "_")
    agents[agent_key] = build_crewai_agent(manifest)
  end

  # Use YAML dump with custom options for better formatting
  yaml = agents.to_yaml
  # Remove leading ---
  yaml.sub(/\A---\n/, "")
end

.format_nameObject



18
19
20
# File 'lib/solid_agent/agent_manifest/exporters/crewai_exporter.rb', line 18

def format_name
  :crewai
end