diff options
Diffstat (limited to '')
-rw-r--r-- | README.md | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -1,3 +1,7 @@ +<a href="./README-DE.md"> + <img src="https://img.shields.io/badge/öffnen in-🇩🇪 deutsch-bleu.svg" alt="Öffnen en DE"> +</a> + ![248433934-7886223b-c1d1-4260-82aa-da5741f303bb](https://github.com/xtekky/gpt4free/assets/98614666/ea012c87-76e0-496a-8ac4-e2de090cc6c9) <a href='https://ko-fi.com/xtekky' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /> @@ -245,12 +249,7 @@ for message in response: ##### Using Browser -Some providers using a browser to bypass the bot protection. -They using the selenium webdriver to control the browser. -The browser settings and the login data are saved in a custom directory. -If the headless mode is enabled, the browser windows are loaded invisibly. -For performance reasons, it is recommended to reuse the browser instances -and close them yourself at the end: +Some providers using a a browser to bypass the bot protection. They using the selenium webdriver to control the browser. The browser settings and the login data are saved in a custom directory. If the headless mode is enabled, the browser windows are loaded invisibly. For performance reasons, it is recommended to reuse the browser instances and close them yourself at the end: ```python import g4f @@ -266,16 +265,16 @@ from g4f.Provider import ( options = ChromeOptions() options.add_argument("--incognito"); -browser = Chrome(options=options, headless=True) +webdriver = Chrome(options=options, headless=True) for idx in range(10): response = g4f.ChatCompletion.create( model=g4f.models.default, provider=g4f.Provider.Phind, messages=[{"role": "user", "content": "Suggest me a name."}], - browser=browser + webdriver=webdriver ) print(f"{idx}:", response) -browser.quit() +webdriver.quit() ``` ##### Cookies Required @@ -605,7 +604,7 @@ if __name__ == "__main__": #### Create Provider with AI Tool -Call in your terminal the "create_provider" script: +Call in your terminal the `create_provider.py` script: ```bash python etc/tool/create_provider.py ``` @@ -628,8 +627,8 @@ from .base_provider import AsyncGeneratorProvider class HogeService(AsyncGeneratorProvider): url = "https://chat-gpt.com" - supports_gpt_35_turbo = True working = True + supports_gpt_35_turbo = True @classmethod async def create_async_generator( @@ -644,7 +643,7 @@ class HogeService(AsyncGeneratorProvider): 4. Here, you can adjust the settings, for example, if the website does support streaming, set `supports_stream` to `True`... 5. 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 -6. Add the Provider Name in [g4f/Provider/**init**.py](./g4f/Provider/__init__.py) +6. Add the Provider Name in [`g4f/Provider/__init__.py`](./g4f/Provider/__init__.py) ```py from .HogeService import HogeService @@ -708,7 +707,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. </td> <td> <img src="https://img.shields.io/badge/License-GNU_GPL_v3.0-red.svg"/> <br> -This project is licensed under <a href="./LICENSE">GNU_GPL_v3.0</a>. <img width=2300/> +This project is licensed under <a href="./LICENSE">GNU_GPL_v3.0</a>. </td> </tr> </table> |