Class: OpenAI::Resources::Safety::Alerts

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/safety/alerts.rb,
sig/openai/resources/safety/alerts.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Alerts

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Alerts.

Parameters:



32
33
34
# File 'lib/openai/resources/safety/alerts.rb', line 32

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(id, request_options: {}) ⇒ OpenAI::Models::Safety::SafetyAlert

Get a safety alert belonging to the authenticated API project.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
# File 'lib/openai/resources/safety/alerts.rb', line 19

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["safety/alerts/%1$s", id],
    model: OpenAI::Safety::SafetyAlert,
    security: {bearer_auth: true},
    options: params[:request_options]
  )
end