A model-agnostic AI Agent framework for Ruby

Combine Generators, Actions, Tasks, and Agents to build AI-powered applications!

code_from_description_generator.rb
phlex_component_generator.rb
class CodeFromDescriptionGenerator < Sublayer::Generators::Base
llm_output_adapter type: :single_string,
name: "generated_code",
description: "The generated code in the requested language"
def initialize(description:, technologies:)
@description = description
@technologies = technologies
end
def generate
super
end
def prompt
<<-PROMPT
You are an expert programmer in #{@technologies.join(", ")}.
You are tasked with writing code using the following technologies: #{@technologies.join(", ")}.
The description of the task is #{@description}
Take a deep breath and think step by step before you start coding.
PROMPT
end
end

Introduction

Quick Links

Sublayer is a model-agnostic AI Agent framework in Ruby that allows you to effortlessly integrate generative AI into your applications.

Quick Start

Get started with Sublayer right away.

Examples

Browse example code showing how you can use the Sublayer gem

Framework Guide

Learn about Sublayer concepts and conventions.

Advanced Config

Step-by-step guides to setting up your system and installing the library.