Add CheckModel
Class for Model and Provider Response Testing
#2110
+765
−0
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.
Description:
This pull request introduces a new class,
CheckModel
, to theg4f
library, enabling users to test responses from different providers for a given model. TheCheckModel
class includes methods for asynchronously fetching and logging responses from available working providers.Changes Made:
check_model.py
with theCheckModel
class.__init__(self, model)
: Initializes with the specified model and prepares a list of working providers.get_response(self, provider)
: Asynchronously gets responses from a provider and logs results.check_model(self)
: Aggregates results from all working providers asynchronously.__init__.py
:from .client.check_model import CheckModel
to make theCheckModel
class available for import.Usage:
Users can now easily check model responses by importing and running the
CheckModel
class: