Class: Ace::Support::Items::Molecules::LlmSlugGenerator
- Inherits:
-
Object
- Object
- Ace::Support::Items::Molecules::LlmSlugGenerator
- Defined in:
- lib/ace/support/items/molecules/llm_slug_generator.rb
Overview
Generates hierarchical slugs using LLM with fallback to deterministic generation. Soft dependency on ace-llm — gracefully falls back if not available.
Constant Summary collapse
- GOAL_TYPES =
Goal type keywords for consistent naming
%w[add enhance fix refactor].freeze
Instance Method Summary collapse
-
#generate_idea_slugs(description, context = {}) ⇒ Hash
Generate hierarchical slugs for an idea.
-
#generate_task_slugs(title, context = {}) ⇒ Hash
Generate hierarchical slugs for a task.
-
#initialize(debug: false) ⇒ LlmSlugGenerator
constructor
A new instance of LlmSlugGenerator.
Constructor Details
#initialize(debug: false) ⇒ LlmSlugGenerator
Returns a new instance of LlmSlugGenerator.
15 16 17 |
# File 'lib/ace/support/items/molecules/llm_slug_generator.rb', line 15 def initialize(debug: false) @debug = debug end |
Instance Method Details
#generate_idea_slugs(description, context = {}) ⇒ Hash
Generate hierarchical slugs for an idea
35 36 37 38 39 40 41 |
# File 'lib/ace/support/items/molecules/llm_slug_generator.rb', line 35 def generate_idea_slugs(description, context = {}) llm_result = try_llm_idea_generation(description, context) return llm_result if llm_result[:success] debug_log("LLM generation failed, using fallback") fallback_idea_generation(description, context) end |
#generate_task_slugs(title, context = {}) ⇒ Hash
Generate hierarchical slugs for a task
23 24 25 26 27 28 29 |
# File 'lib/ace/support/items/molecules/llm_slug_generator.rb', line 23 def generate_task_slugs(title, context = {}) llm_result = try_llm_task_generation(title, context) return llm_result if llm_result[:success] debug_log("LLM generation failed, using fallback") fallback_task_generation(title, context) end |