Class: RailsAi::PromptComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- RailsAi::PromptComponent
- Defined in:
- app/components/ai/prompt_component.rb
Instance Method Summary collapse
-
#initialize(prompt:, model: nil, stream_id: nil, placeholder: "Ask me anything...", **options) ⇒ PromptComponent
constructor
A new instance of PromptComponent.
Constructor Details
#initialize(prompt:, model: nil, stream_id: nil, placeholder: "Ask me anything...", **options) ⇒ PromptComponent
Returns a new instance of PromptComponent.
5 6 7 8 9 10 11 |
# File 'app/components/ai/prompt_component.rb', line 5 def initialize(prompt:, model: nil, stream_id: nil, placeholder: "Ask me anything...", **) @prompt = prompt @model = model || RailsAi.config.default_model @stream_id = stream_id || SecureRandom.uuid @placeholder = placeholder = end |