Class: OpenaiAssistant::Assistant::Retrieve
- Defined in:
- lib/openai_assistant/clients/assistant/retrieve.rb
Overview
An openai assistant
Instance Method Summary collapse
-
#retrieve_assistant(assistant_id) ⇒ OpenaiAssistant::Mapper::OpenaiAssistant
A new response object of assistant.
Methods inherited from Base
Constructor Details
This class inherits a constructor from OpenaiAssistant::Base
Instance Method Details
#retrieve_assistant(assistant_id) ⇒ OpenaiAssistant::Mapper::OpenaiAssistant
Returns A new response object of assistant.
9 10 11 12 13 14 15 16 |
# File 'lib/openai_assistant/clients/assistant/retrieve.rb', line 9 def retrieve_assistant(assistant_id) url = "#{@openai_url}/#{assistant_id}" uri = URI(url) response = @http_client.call_get(uri, default_headers) return OpenaiAssistant::ErrorResponse.from_json(response.body) unless response.code == "200" OpenaiAssistant::Mapper::Assistant.from_json(JSON.parse(response.body)) end |