Module: Zuno
- Defined in:
- lib/zuno.rb,
lib/zuno/chat.rb,
lib/zuno/version.rb,
lib/zuno/configuration.rb
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- OPENAI_MODELS =
%w[gpt-3.5-turbo gpt-4-turbo gpt-4-turbo-preview gpt-4o gpt-4o-mini].freeze
- VERSION =
"0.1.4"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
12 13 14 |
# File 'lib/zuno.rb', line 12 def configuration @configuration end |
Class Method Details
.chat(messages:, model: nil, **options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/zuno/chat.rb', line 9 def chat(messages:, model: nil, **) model ||= Zuno.configuration.chat_completion_model provider = provider_for_model(model) raw_response = .delete(:raw_response) || false if [:stream] provider.chat_completion(, model, , raw_response) do |chunk| yield chunk if block_given? end else provider.chat_completion(, model, , raw_response) end end |
.configure {|configuration| ... } ⇒ Object
15 16 17 18 |
# File 'lib/zuno.rb', line 15 def self.configure self.configuration ||= Configuration.new yield(configuration) end |