Implement multi-provider support for chat functionality and enhance configuration management#26
Open
Reion19 wants to merge 4 commits intoalexshapalov:mainfrom
Open
Conversation
a1xsh
suggested changes
Jul 2, 2025
|
|
||
| def connection | ||
| @connection ||= Faraday.new do |faraday| | ||
| faraday.adapter Faraday.default_adapter |
Author
There was a problem hiding this comment.
its just an copy+paste from client, so i couldn't know that it should come last
| response = connection.post do |req| | ||
| req.url Configuration::PROVIDERS[@provider] || Configuration::BASE_URL | ||
| req.headers.merge!(headers) | ||
| req.body = body.to_json |
Author
There was a problem hiding this comment.
the same thing as in the previous message
a1xsh
reviewed
Jul 2, 2025
| when 'anthropic' | ||
| { | ||
| 'model' => Configuration::MODELS[provider][model], | ||
| 'max_tokens' => 1024, # Required parameter for Anthropic API |
There was a problem hiding this comment.
Why you stay with 1024 tokens? Can't we increase this?
Author
There was a problem hiding this comment.
my bad, will be fixed in future commits, because in one of the next PR i've changed configuration of providers
I simply forgot about this thing.
a1xsh
reviewed
Jul 2, 2025
| case provider | ||
| when 'openai' | ||
| { | ||
| 'Content-Type': 'application/json', |
There was a problem hiding this comment.
Faraday will add this header automatically
Author
There was a problem hiding this comment.
this line will be removed in future commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Summary of Changes
This pull request includes three main commits:
What’s New?
Let me know if you’d like tests for the Anthropic integration once I get access.