Currently, we want the ability to pass dynamic enum values to RubyLLM schemas. For example, we want to be able to define a schema like this:
module Schemas
class SummarySchema < RubyLLM::Schema
def initialize(user_params: {})
@user_params = user_params
end
array :users, description: "List of users to be created", required: false do
object do
string :name,
enum: -> @user_params[:user_names],
required: false
array :tool_names,
of: :string,
enum: -> @user_params[:tool_names],
required: true
end
end
end
end
Goal:
- Enable passing custom enum values to schema fields dynamically.
- Support using lambda or proc to provide enum values at initialization.
Benefit:
This will make the schemas more flexible and reusable with dynamic input parameters.
Currently, we want the ability to pass dynamic enum values to RubyLLM schemas. For example, we want to be able to define a schema like this:
Goal:
Benefit:
This will make the schemas more flexible and reusable with dynamic input parameters.