Outputs
TL;DR
Define Outputs
class AI::Chat < ApplicationService
output :messages
output :cost
endWrite Outputs
class AI::Chat < ApplicationService
# Steps
step :chat
# Outputs
output :messages
output :cost
private
def chat
self.messages = ["Hello!", "Hi, how are you?"]
self.cost = 0.0013
end
endType Validation
Type Enforcement (Enabled by Default)
Sorbet Runtime Types
Default Values
Removing Inherited Outputs
What's Next?
Last updated