Class: Braintrust::Resources::TopLevel

Inherits:
Object
  • Object
show all
Defined in:
lib/braintrust/resources/top_level.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ TopLevel

Returns a new instance of TopLevel.



6
7
8
# File 'lib/braintrust/resources/top_level.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#hello_world(opts = {}) ⇒ String

Default endpoint. Simply replies with 'Hello, World!'. Authorization is not required

Parameters:

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (String)


16
17
18
19
20
21
22
23
# File 'lib/braintrust/resources/top_level.rb', line 16

def hello_world(opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/v1"
  req[:headers] = {"Accept" => "text/plain"}
  req[:model] = String
  @client.request(req, opts)
end