Class: ReveAI::Resources::V2

Inherits:
Object
  • Object
show all
Defined in:
lib/reve_ai/resources/v2.rb,
lib/reve_ai/resources/v2/images.rb,
lib/reve_ai/resources/v2/layouts.rb

Overview

Namespace for Reve API v2 resources.

Accessed via client.v2. Groups the v2 image create endpoint and the experimental layout pipeline endpoints.

Examples:

Generate an image with the v2 API

result = client.v2.images.create(prompt: "A sunset over mountains")
result.layout # => { prompt: "...", regions: [...] }

See Also:

Defined Under Namespace

Classes: Images, Layouts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ V2

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.

Creates a new v2 namespace.

Parameters:

  • client (Client)

    The API client



23
24
25
# File 'lib/reve_ai/resources/v2.rb', line 23

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientClient (readonly)

Returns The client instance for this namespace.

Returns:

  • (Client)

    The client instance for this namespace



17
18
19
# File 'lib/reve_ai/resources/v2.rb', line 17

def client
  @client
end

Instance Method Details

#imagesV2::Images

Returns the v2 images resource.

Returns:



30
31
32
# File 'lib/reve_ai/resources/v2.rb', line 30

def images
  @images ||= Images.new(client)
end

#layoutsV2::Layouts

Returns the v2 layouts resource (experimental endpoints).

Returns:



37
38
39
# File 'lib/reve_ai/resources/v2.rb', line 37

def layouts
  @layouts ||= Layouts.new(client)
end