Sha256: 03d0cd8ffe41824ff3db0325d9073fcf33d628ddedc86e91ff59869143d868e0

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

module OpenaiAssistant
  # Base class of openai
  class Base
    def initialize(api_key = "")
      @openai_api_key = api_key
      # hard the host because if the official docs change the host, maybe it will change another
      # we need to update this gem for any change
      @openai_url = "https://api.openai.com/v1/assistants"
      @http_client = OpenaiAssistant::HTTPClient.new
    end

    def default_headers
      {
        "Authorization": "Bearer #{@openai_api_key}",
        "OpenAI-Beta": "assistants=v1",
        "Content-Type": "application/json"
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openai-assistant-1.1.0 lib/openai_assistant/base.rb