返回提交历史
Modified
README.md
+6
-6
XFEstudio/gpt4free
Update README.md
37dba12e
代码差异
1 个文件
+6
-6
@@ -300,16 +300,16 @@ response = g4f.ChatCompletion.create(
300
300
print(f"Result:", response)
301
301
```
302
302
303
### interference openai-proxy api (use with openai python package)
303
### interference openai-proxy API (use with openai python package)
304
304
305
#### run interference api from pypi package:
305
#### run interference API from pypi package:
306
306
```py
307
307
from g4f.api import run_api
308
308
309
309
run_api()
310
310
```
311
311
312
#### run interference api from repo:
312
#### run interference API from repo:
313
313
If you want to use the embedding function, you need to get a Hugging Face token. You can get one at https://huggingface.co/settings/tokens make sure your role is set to write. If you have your token, just use it instead of the OpenAI api-key.
314
314
315
315
run server:
@@ -539,7 +539,7 @@ Call in your terminal the "create_provider" script:
539
539
python etc/tool/create_provider.py
540
540
```
541
541
1. Enter your name for the new provider.
542
2. Copy & Paste a cURL command from your browser developer tools.
542
2. Copy and paste a cURL command from your browser developer tools.
543
543
3. Let the AI create the provider for you.
544
544
4. Customize the provider according to your needs.
545
545
@@ -571,8 +571,8 @@ class HogeService(AsyncGeneratorProvider):
571
571
yield ""
572
572
```
573
573
574
4. Here, you can adjust the settings, for example if the website does support streaming, set `supports_stream` to `True`...
575
5. Write code to request the provider in `create_async_generator` and `yield` the response, _even if_ its a one-time response, do not hesitate to look at other providers for inspiration
574
4. Here, you can adjust the settings, for example, if the website does support streaming, set `supports_stream` to `True`...
575
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
576
576
6. Add the Provider Name in [g4f/provider/**init**.py](./g4f/provider/__init__.py)
577
577
578
578
```py