Class: OpenaiAssistant::Base
- Inherits:
-
Object
- Object
- OpenaiAssistant::Base
- Defined in:
- lib/openai_assistant/base.rb
Overview
Base class of openai
Direct Known Subclasses
Assistant::Create, Assistant::Delete, Assistant::List, Assistant::Retrieve
Instance Method Summary collapse
- #default_headers ⇒ Object
-
#initialize(api_key = "") ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(api_key = "") ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 |
# File 'lib/openai_assistant/base.rb', line 6 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 |
Instance Method Details
#default_headers ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/openai_assistant/base.rb', line 14 def default_headers { "Authorization": "Bearer #{@openai_api_key}", "OpenAI-Beta": "assistants=v1", "Content-Type": "application/json" } end |