Class: OpenaiAssistant::Assistant::Client
- Inherits:
-
Object
- Object
- OpenaiAssistant::Assistant::Client
- Defined in:
- lib/openai_assistant/client.rb
Overview
An openai assistant client
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #create_assistant(model, instructions) ⇒ Object
- #delete_assistant(assistant_id) ⇒ Object
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #list_assistant ⇒ Object
- #retrieve_assistant(assistant_id) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/openai_assistant/client.rb', line 9 def initialize(api_key) @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/openai_assistant/client.rb', line 7 def api_key @api_key end |
Instance Method Details
#create_assistant(model, instructions) ⇒ Object
13 14 15 |
# File 'lib/openai_assistant/client.rb', line 13 def create_assistant(model, instructions) OpenaiAssistant::Assistant::Create.new(@api_key).create_assistant(model, instructions) end |
#delete_assistant(assistant_id) ⇒ Object
25 26 27 |
# File 'lib/openai_assistant/client.rb', line 25 def delete_assistant(assistant_id) OpenaiAssistant::Assistant::Delete.new(@api_key).delete_assistant(assistant_id) end |
#list_assistant ⇒ Object
21 22 23 |
# File 'lib/openai_assistant/client.rb', line 21 def list_assistant OpenaiAssistant::Assistant::List.new(@api_key).list_assistant end |
#retrieve_assistant(assistant_id) ⇒ Object
17 18 19 |
# File 'lib/openai_assistant/client.rb', line 17 def retrieve_assistant(assistant_id) OpenaiAssistant::Assistant::Retrieve.new(@api_key).retrieve_assistant(assistant_id) end |