Skip to content
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

Add CheckModel Class for Model and Provider Response Testing #2110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codewithdark-git
Copy link

Description:

This pull request introduces a new class, CheckModel, to the g4f library, enabling users to test responses from different providers for a given model. The CheckModel class includes methods for asynchronously fetching and logging responses from available working providers.

Changes Made:

  1. New File: Created check_model.py with the CheckModel 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.
  2. Modified __init__.py:
    • Added from .client.check_model import CheckModel to make the CheckModel class available for import.

Usage:

Users can now easily check model responses by importing and running the CheckModel class:

from g4f.client.check_model import CheckModel
import asyncio

checker = CheckModel('gpt_4_turbo')
asyncio.run(checker.check_model())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant