Class: LLM::Response::ModerationList
- Inherits:
-
LLM::Response
- Object
- LLM::Response
- LLM::Response::ModerationList
- Includes:
- Enumerable
- Defined in:
- lib/llm/response/moderationlist.rb,
lib/llm/response/moderationlist/moderation.rb
Overview
The LLM::Response::ModerationList class represents a response from the moderations API. It is an Enumerable that yields an instance of LLM::Response::ModerationList::Moderation, and each moderation object contains the categories and scores for a given input.
Defined Under Namespace
Classes: Moderation
Instance Method Summary collapse
-
#id ⇒ String
Returns the moderation ID.
-
#model ⇒ String
Returns the moderation model.
-
#each {|moderation| ... } ⇒ void
Yields each moderation object.
Methods inherited from LLM::Response
Constructor Details
This class inherits a constructor from LLM::Response
Instance Method Details
#id ⇒ String
Returns the moderation ID
18 19 20 |
# File 'lib/llm/response/moderationlist.rb', line 18 def id parsed[:id] end |
#model ⇒ String
Returns the moderation model
25 26 27 |
# File 'lib/llm/response/moderationlist.rb', line 25 def model parsed[:model] end |
#each {|moderation| ... } ⇒ void
This method returns an undefined value.
Yields each moderation object
34 35 36 |
# File 'lib/llm/response/moderationlist.rb', line 34 def each(&) moderations.each(&) end |