Class: OpenaiChatgpt::Choice
- Inherits:
-
Object
- Object
- OpenaiChatgpt::Choice
- Defined in:
- lib/openai_chatgpt/choice.rb
Overview
@note: This class is the choice response object.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(obj) ⇒ Choice
constructor
A new instance of Choice.
Constructor Details
#initialize(obj) ⇒ Choice
Returns a new instance of Choice.
8 9 10 11 12 |
# File 'lib/openai_chatgpt/choice.rb', line 8 def initialize(obj) @content = obj..content @index = obj.index @role = obj..role end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/openai_chatgpt/choice.rb', line 6 def content @content end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
6 7 8 |
# File 'lib/openai_chatgpt/choice.rb', line 6 def index @index end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
6 7 8 |
# File 'lib/openai_chatgpt/choice.rb', line 6 def role @role end |