Module: Inquirex::LLM::DSL::FlowBuilderExtension

Defined in:
lib/inquirex/llm/dsl/flow_builder.rb

Overview

Mixin that adds LLM verb methods to Inquirex::DSL::FlowBuilder. Included automatically when ‘require “inquirex-llm”` is called, so that `Inquirex.define` gains clarify/describe/summarize/detour without needing a separate entry point.

All core verbs (ask, say, header, btw, warning, confirm) remain unchanged — LLM verbs are purely additive.

Instance Method Summary collapse

Instance Method Details

#clarify(id) ⇒ Object

Defines an LLM extraction step: takes free-text input and produces structured data matching the declared schema.

Parameters:

  • id (Symbol)

    step id



18
19
20
# File 'lib/inquirex/llm/dsl/flow_builder.rb', line 18

def clarify(id, &)
  add_llm_step(id, :clarify, &)
end

#describe(id) ⇒ Object

Defines an LLM description step: takes structured data and produces natural-language text.

Parameters:

  • id (Symbol)

    step id



26
27
28
# File 'lib/inquirex/llm/dsl/flow_builder.rb', line 26

def describe(id, &)
  add_llm_step(id, :describe, &)
end

#detour(id) ⇒ Object

Defines an LLM detour step: based on an answer, dynamically generates follow-up questions. The server adapter handles presenting the generated questions and collecting responses.

Parameters:

  • id (Symbol)

    step id



43
44
45
# File 'lib/inquirex/llm/dsl/flow_builder.rb', line 43

def detour(id, &)
  add_llm_step(id, :detour, &)
end

#summarize(id) ⇒ Object

Defines an LLM summarization step: takes all or selected answers and produces a textual summary.

Parameters:

  • id (Symbol)

    step id



34
35
36
# File 'lib/inquirex/llm/dsl/flow_builder.rb', line 34

def summarize(id, &)
  add_llm_step(id, :summarize, &)
end