Class: OpenaiAssistant::Assistant::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/openai_assistant/clients/assistant/delete.rb

Overview

An openai assistant

Instance Method Summary collapse

Methods inherited from Base

#default_headers, #initialize

Constructor Details

This class inherits a constructor from OpenaiAssistant::Base

Instance Method Details

#delete_assistant(assistant_id) ⇒ String

Returns Message delete the assistant ok or not.

Parameters:

  • assistant_id (String)

    The id of assistant after create

Returns:

  • (String)

    Message delete the assistant ok or not



9
10
11
12
13
14
15
16
# File 'lib/openai_assistant/clients/assistant/delete.rb', line 9

def delete_assistant(assistant_id)
  url = "#{@openai_url}/#{assistant_id}"
  uri = URI(url)
  response = @http_client.call_delete(uri, default_headers)
  return OpenaiAssistant::ErrorResponse.from_json(response.body) unless response.code == "200"

  true
end