Misc
Contribute
How to contribute to G4F
Create Provider with AI Tool
To create a Provider with AI tool you need cloned gpt4free repository, not PyPi version
Call in your terminal the “create_provider” script:
- Enter your name for the new provider.
- Copy and paste the URL command from your browser developer tools.
- Let the AI create the provider for you.
- Customize the provider according to your needs.
List of list of potential providers available here
- Find provider.
- Create a new file in g4f/Provider with the name of the Provider.
- Implement a class that extends BaseProvider:
- Here, you can adjust the settings, for example, if the website does support streaming, set supports_stream to True…
Name | Function |
---|---|
working | If this parameter set to True, this provider is active. Otherwise, provider will be thrown RuntimeError |
supports_message_history | If this parameter set to True, this provider support message history |
supports_gpt_35_turbo | If this parameter set to True, this provider support gpt-3.5-turbo |
supports_gpt_4 | If this parameter set to True, this provider support gpt-4 |
jailbreak | If this parameter set to True, this provider support emulation other models with special prompt |
- Write code to request the provider in create_async_generator and yield the response, even if it’s a one-time response, do not hesitate to look at other providers for inspiration
- Add the Provider Name in g4f/Provider/init.py:
- You are done! Test your provider by calling it: