Module: Asimov

Defined in:
lib/asimov.rb,
lib/asimov/error.rb,
lib/asimov/client.rb,
lib/asimov/version.rb,
lib/asimov/api_v1/base.rb,
lib/asimov/api_v1/chat.rb,
lib/asimov/api_v1/audio.rb,
lib/asimov/api_v1/edits.rb,
lib/asimov/api_v1/files.rb,
lib/asimov/api_v1/images.rb,
lib/asimov/api_v1/models.rb,
lib/asimov/configuration.rb,
lib/asimov/headers_factory.rb,
lib/asimov/api_v1/finetunes.rb,
lib/asimov/api_v1/embeddings.rb,
lib/asimov/api_v1/completions.rb,
lib/asimov/api_v1/moderations.rb,
lib/asimov/utils/file_manager.rb,
lib/asimov/utils/jsonl_validator.rb,
lib/asimov/api_v1/api_error_translator.rb,
lib/asimov/utils/chat_messages_validator.rb,
lib/asimov/utils/training_file_validator.rb,
lib/asimov/api_v1/network_error_translator.rb,
lib/asimov/utils/request_options_validator.rb,
lib/asimov/utils/text_entry_file_validator.rb,
lib/asimov/utils/classifications_file_validator.rb

Overview

Top level module for the Asimov client library for using the OpenAI API.

Defined Under Namespace

Modules: ApiV1, Utils Classes: ApiOverloadedError, AuthorizationError, Client, Configuration, ConfigurationError, Error, FileCannotBeOpenedError, FileDataError, HeadersFactory, InvalidApiKeyError, InvalidChatMessagesError, InvalidClassificationError, InvalidOrganizationError, InvalidParameterValueError, InvalidTextEntryError, InvalidTrainingExampleError, JsonlFileCannotBeParsedError, MissingApiKeyError, MissingBaseUriError, MissingRequiredParameterError, NetworkError, NotFoundError, OpenTimeout, ParameterError, QuotaExceededError, RateLimitError, ReadTimeout, RequestError, StreamingResponseNotSupportedError, TimeoutError, TooManyRequestsError, UnsupportedParameterError, WriteTimeout

Constant Summary collapse

VERSION =

Current gem version

"1.1.0".freeze

Class Method Summary collapse

Class Method Details

.configurationObject

Getter for the application-wide Asimove::Configuration singleton.



32
33
34
# File 'lib/asimov.rb', line 32

def self.configuration
  @configuration ||= Asimov::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Method uses to initialize the application-wide configuration. Should be called with a block like so:

Asimov.configure do |config|

config.api_key = 'abcd'
config.organization = 'def'

end

Attributes that can be set on the configuration include:

api_key - The OpenAI API key that Asimov::Client instances should use by default. organization_id - The OpenAI organization identifier that Asimov::Client instances should

use by default.

Yields:



25
26
27
# File 'lib/asimov.rb', line 25

def self.configure
  yield(configuration)
end