class Rager::Chat::Options
Public Instance Methods
Source
# File lib/rager/chat/options.rb 29 def serialize_safe 30 result = serialize 31 result["api_key"] = "[REDACTED]" if result.key?("api_key") 32 result["schema"] = Rager::Chat::Schema.dry_schema_to_json_schema(result["schema"]) if result.key?("schema") 33 result 34 end
Source
# File lib/rager/chat/options.rb 37 def validate 38 if stream && schema 39 raise Rager::Errors::OptionsError.new( 40 self, 41 ["stream", "schema"], 42 details: "You cannot use streaming with structured outputs" 43 ) 44 end 45 46 if schema && schema_name.nil? 47 raise Rager::Errors::OptionsError.new( 48 self, 49 ["schema", "schema_name"], 50 details: "You must provide a schema name when using structured outputs" 51 ) 52 end 53 end