Class: Anthropic::Api::Completions

Inherits:
Base
  • Object
show all
Defined in:
lib/anthropic/api/completions.rb

Overview

Provides bindings for the Anthropic completions API

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Anthropic::Api::Concerns::Validatable

#schema, #validate!

Methods included from Anthropic::Api::Concerns::Requestable

#additional_headers, #beta_headers, #post, #post_as_stream, #uri

Constructor Details

This class inherits a constructor from Anthropic::Api::Base

Instance Method Details

#create(**params) ⇒ Object



8
9
10
11
12
13
# File 'lib/anthropic/api/completions.rb', line 8

def create(**params, &)
  validate!(params)
  return post(params) unless params[:stream]

  post_as_stream(params, &)
end