No Name

InfoGenerateCreated ByPackages

This code defines a Ruby class `SemioticFeatureTextGenerator` that inherits from `Sublayer::Generators::Base`. The class uses the `llm_output_adapter` macro to specify that it produces a single string output, named 'generated_text', based on semiotic feature analysis. The class is initialized with a description and a set of features. It includes a `generate` method which calls a `super` method (likely from its parent class) and a `prompt` method that generates a textual prompt for semiotic analysis based on the given description and features.

class SemioticFeatureTextGenerator < Sublayer::Generators::Base
  llm_output_adapter type: :single_string,
    name: "generated_text",
    description: "The generated text based on semiotic feature analysis"

  def initialize(description:, features:)
    @description = description
    @features = features
  end

  def generate
    super
  end

  def prompt
    <<-PROMPT
        You are an expert in semiotic analysis.

        You are tasked with writing text using the following semiotic features: #{@features.join(", ")}.

        The description of the task is #{@description}

        Take a deep breath and think step by step before you start writing.
    PROMPT
  end
end