Class: OpenAI::Assistants
- Inherits:
-
Object
- Object
- OpenAI::Assistants
- Defined in:
- lib/openai/assistants.rb
Constant Summary collapse
- BETA_VERSION =
"v2".freeze
Instance Method Summary collapse
- #create(parameters: {}) ⇒ Object
- #delete(id:) ⇒ Object
-
#initialize(client:) ⇒ Assistants
constructor
A new instance of Assistants.
- #list ⇒ Object
- #modify(id:, parameters: {}) ⇒ Object
- #retrieve(id:) ⇒ Object
Constructor Details
#initialize(client:) ⇒ Assistants
Returns a new instance of Assistants.
5 6 7 |
# File 'lib/openai/assistants.rb', line 5 def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end |
Instance Method Details
#create(parameters: {}) ⇒ Object
17 18 19 |
# File 'lib/openai/assistants.rb', line 17 def create(parameters: {}) @client.json_post(path: "/assistants", parameters: parameters) end |
#delete(id:) ⇒ Object
25 26 27 |
# File 'lib/openai/assistants.rb', line 25 def delete(id:) @client.delete(path: "/assistants/#{id}") end |
#list ⇒ Object
9 10 11 |
# File 'lib/openai/assistants.rb', line 9 def list @client.get(path: "/assistants") end |
#modify(id:, parameters: {}) ⇒ Object
21 22 23 |
# File 'lib/openai/assistants.rb', line 21 def modify(id:, parameters: {}) @client.json_post(path: "/assistants/#{id}", parameters: parameters) end |
#retrieve(id:) ⇒ Object
13 14 15 |
# File 'lib/openai/assistants.rb', line 13 def retrieve(id:) @client.get(path: "/assistants/#{id}") end |