lib/openai_assistant/clients/assistant/create.rb in openai-assistant-1.0.0 vs lib/openai_assistant/clients/assistant/create.rb in openai-assistant-1.1.0
- old
+ new
@@ -1,25 +1,25 @@
# frozen_string_literal: true
-module OpenaiAsissistant
+module OpenaiAssistant
module Assistant
# An openai assistant
class Create < Base
# @param model [String] Select model of the assistant. refer on: https://platform.openai.com/docs/api-reference/models/list.
# @param instructions [String] The system instructions that the assistant uses.
- # @return [OpenaiAsissistant::Mapper::Assistant] A new response object of assistant.
+ # @return [OpenaiAssistant::Mapper::Assistant] A new response object of assistant.
def create_assistant(model, instructions)
url = URI.parse(@openai_url)
req_body = {
"instructions": instructions,
"name": "assistant",
"tools": [{ "type": "code_interpreter" }],
"model": model
}.to_json
response = @http_client.call_post(url, req_body, default_headers)
- return OpenaiAsissistant::ErrorResponse.from_json(response.body) unless response.code == "200"
+ return OpenaiAssistant::ErrorResponse.from_json(response.body) unless response.code == "200"
- OpenaiAsissistant::Mapper::Assistant.from_json(JSON.parse(response.body))
+ OpenaiAssistant::Mapper::Assistant.from_json(JSON.parse(response.body))
end
end
end
end