lib/omniai/client.rb in omniai-1.0.0 vs lib/omniai/client.rb in omniai-1.0.1

- old
+ new

@@ -7,15 +7,10 @@ # # class OmniAI::OpenAI::Client < OmniAI::Client # def initialize(api_key: ENV.fetch('OPENAI_API_KEY'), logger: nil) # super # end - # - # @return [OmniAI::OpenAI::Chat] - # def chat - # # TODO: implement - # end # end class Client class Error < StandardError; end attr_accessor :api_key @@ -36,11 +31,19 @@ # @return [HTTP::Client] def connection raise NotImplementedError, "#{self.class.name}#connection undefined" end - # @return [OmniAI::Chat] an instance of OmniAI::Chat - def chat + # @raise [OmniAI::Error] + # + # @param messages [String, Array, Hash] + # @param model [String] optional + # @param format [Symbol] optional :text or :json + # @param temperature [Float, nil] optional + # @param stream [Proc, nil] optional + # + # @return [OmniAI::Chat::Completion] + def chat(messages, model:, temperature: nil, format: nil, stream: nil) raise NotImplementedError, "#{self.class.name}#chat undefined" end end end