fixed critical bug in configuration and add specs #30
fixed critical bug in configuration and add specs #30Reion19 wants to merge 21 commits intoalexshapalov:mainfrom
Conversation
… and functionality
… model attribute for enhanced flexibility
| attr_accessor :openai, | ||
| :anthropic, | ||
| :gemini, | ||
| # default api config accessors |
There was a problem hiding this comment.
Ok, roger that, that comment will be removed
| :temperature, | ||
| :provider | ||
|
|
||
| PROVIDERS = { |
There was a problem hiding this comment.
I'll move the providers to the top of the file for better organization.
| module Provider | ||
| PROVIDERS = { | ||
| "openai" => RubyAI::Providers::OpenAI, | ||
| # doesn't tested yet because i don't have an anthropic api key |
There was a problem hiding this comment.
Do not add comments like this inside code.
There was a problem hiding this comment.
Understood, I'll remove all comments like this. Thanks!
| @@ -0,0 +1,55 @@ | |||
| module RubyAI | |||
| module Providers | |||
| # doesn't tested yet because i don't have an anthropic api key | |||
There was a problem hiding this comment.
Do not add comments like this inside code.
There was a problem hiding this comment.
Got it, I’ll remove the comment from the code. Thanks!
|
|
||
| attr_accessor :api, :messages, :temperature, :max_tokens, :model | ||
|
|
||
| # TODO: make an initialization for separate instances for using multiple of them |
There was a problem hiding this comment.
Understood! I’ll remove the TODO comment and create an issue/ticket. Thanks!
| require_relative "rubyai/providers/openai" | ||
| require_relative "rubyai/providers/anthropic" | ||
| require_relative "rubyai/providers/gemini" | ||
| require_relative "rubyai/provider" |
There was a problem hiding this comment.
Sorry, could you please specify what part you mean? I’m not sure what you're referring to.
There was a problem hiding this comment.
do we need require require_relative "rubyai/provider"
if we have required all of them directly?
| :temperature, | ||
| :provider | ||
|
|
||
| PROVIDERS = { |
There was a problem hiding this comment.
Thanks!
I agree.
i will update it
| def self.configuration | ||
| @configuration ||= Configuration.new | ||
| end | ||
| def initialize(config = nil) |
There was a problem hiding this comment.
Too many variables inside the initialize. Should be <5
There was a problem hiding this comment.
Thanks I’ll refactor the initialize method.
|
I have a few questions:
|

[ ✅ ] Have you followed the guidelines in our Contributing document?
[ ✅ ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
[ ✅ ] Have you added an explanation of what your changes do and why you'd like us to include them?
Summary:
Notes: