-
Notifications
You must be signed in to change notification settings - Fork 44.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(forge/llm): Create BaseOpenAIProvider
-> deduplicate GroqProvider
& OpenAIProvider
#7178
Merged
Pwuts
merged 3 commits into
master
from
reinier/open-1100-abstract-openaiprovider-groqprovider-to-a-common
Jun 2, 2024
Merged
refactor(forge/llm): Create BaseOpenAIProvider
-> deduplicate GroqProvider
& OpenAIProvider
#7178
Pwuts
merged 3 commits into
master
from
reinier/open-1100-abstract-openaiprovider-groqprovider-to-a-common
Jun 2, 2024
Conversation
This file contains 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
…deduplicate `GroqProvider` & `OpenAIProvider` - Add `_BaseOpenAIProvider`, `BaseOpenAIChatProvider`, and `BaseOpenAIEmbeddingProvider` - (Re)move as much code as possible from `GroqProvider` and `OpenAIProvider` Also: - Rename `get_available_models()` to `get_available_chat_models()` on `BaseChatModelProvider` - Add `get_available_models()` to `BaseModelProvider` - Add `get_available_embedding_models()` to `BaseEmbeddingModelProvider` - Move common `fix_failed_parse_tries` config attribute into base `ModelProviderConfiguration`
Pwuts
requested review from
Torantulino and
Bentlybro
and removed request for
a team
May 31, 2024 03:09
✅ Deploy Preview for auto-gpt-docs canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7178 +/- ##
==========================================
+ Coverage 33.75% 42.70% +8.95%
==========================================
Files 22 83 +61
Lines 1893 4826 +2933
Branches 330 657 +327
==========================================
+ Hits 639 2061 +1422
- Misses 1240 2673 +1433
- Partials 14 92 +78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pwuts
changed the title
refactor(forge/llm): Create
refactor(forge/llm): Create May 31, 2024
BaseOpenAI(Chat|Embedding)Provider
and deduplicate GroqProvider
& OpenAIProvider
BaseOpenAIProvider
and deduplicate GroqProvider
& OpenAIProvider
Pwuts
changed the title
refactor(forge/llm): Create
refactor(forge/llm): Create May 31, 2024
BaseOpenAIProvider
and deduplicate GroqProvider
& OpenAIProvider
BaseOpenAIProvider
-> deduplicate GroqProvider
& OpenAIProvider
ntindle
reviewed
May 31, 2024
ntindle
approved these changes
May 31, 2024
Pwuts
deleted the
reinier/open-1100-abstract-openaiprovider-groqprovider-to-a-common
branch
June 2, 2024 23:29
9 tasks
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.
It seems to be a trend for new LLM providers to mimic the OpenAI API. The same goes for Llamafile. We can leverage this and create a common base class that implements most of the functionality for providers with OpenAI-like interfaces. This has the additional benefit of increasing maintainability and making it easier to add support for more such providers in the future.
This PR also paves the way for a clean integration of #7091.
Changes
_BaseOpenAIProvider
,BaseOpenAIChatProvider
, andBaseOpenAIEmbeddingProvider
GroqProvider
andOpenAIProvider
Also:
get_available_models()
toget_available_chat_models()
onBaseChatModelProvider
get_available_models()
toBaseModelProvider
get_available_embedding_models()
toBaseEmbeddingModelProvider
fix_failed_parse_tries
config attribute into baseModelProviderConfiguration