XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

minor fixes

ails, chatgptai ...

76c7be31
abc <98614666+xtekky@users.noreply.github.com>
提交于

代码差异

6 个文件 +19 -7
Modified README.md +2 -2
@@ -158,10 +158,10 @@ for token in chat_completion:
158 158 | [chat9.yqcloud.top](https://chat9.yqcloud.top/) | `g4f.Provider.Yqcloud` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
159 159 | [theb.ai](https://theb.ai) | `g4f.Provider.Theb` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
160 160 | [play.vercel.ai](https://play.vercel.ai) | `g4f.Provider.Vercel` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
161 | [forefront.com](https://forefront.com) | `g4f.Provider.Forefront` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
161 | [forefront.com](https://forefront.com) | `g4f.Provider.Forefront` | ✔️ | ❌ | ✔️ | ![Inactive](https://img.shields.io/badge/Inactive-red) | ❌ |
162 162 | [deepai.org](https://deepai.org) | `g4f.Provider.DeepAi` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
163 163 | [chat.getgpt.world](https://chat.getgpt.world/) | `g4f.Provider.GetGpt` | ✔️ | ❌ | ✔️ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
164 | [chatgptlogin.ac](https://chatgptlogin.ac) | `g4f.Provider.ChatgptLogin` | ✔️ | ❌ | ❌ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
164 | [chatgptlogin.ac](https://chatgptlogin.ac) | `g4f.Provider.ChatgptLogin` | ✔️ | ❌ | ❌ | ![Inactive](https://img.shields.io/badge/Inactive-red) | ❌ |
165 165 | [chat-gpt.org](https://chat-gpt.org/chat) | `g4f.Provider.Aichat` | ✔️ | ❌ | ❌ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
166 166 | [chat.acytoo.com](https://chat.acytoo.com) | `g4f.Provider.Acytoo` | ✔️ | ❌ | ❌ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
167 167 | [aitianhu.com](https://aitianhu.com) | `g4f.Provider.AItianhu` | ✔️ | ❌ | ❌ | ![Active](https://img.shields.io/badge/Active-brightgreen) | ❌ |
Modified g4f/Provider/Providers/Ails.py +1 -1
@@ -45,7 +45,7 @@ def _create_completion(model: str, messages: list, temperature: float = 0.6, str
45 45 'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
46 46 'authorization': 'Bearer free',
47 47 'client-id': str(uuid.uuid4()),
48 'client-v': '0.1.217',
48 'client-v': '0.1.249',
49 49 'content-type': 'application/json',
50 50 'origin': 'https://ai.ls',
51 51 'referer': 'https://ai.ls/',
Modified g4f/Provider/Providers/BingHuan.py +0 -1
@@ -19,7 +19,6 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
19 19
20 20 for line in iter(p.stdout.readline, b''):
21 21 yield line.decode('cp1252')
22
23 22
24 23
25 24 params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
Modified g4f/Provider/Providers/ChatgptAi.py +1 -2
@@ -13,8 +13,7 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
13 13 chat += '%s: %s\n' % (message['role'], message['content'])
14 14 chat += 'assistant: '
15 15
16 response = requests.get('https://chatgpt.ai/gpt-4/')
17
16 response = requests.get('https://chatgpt.ai/')
18 17 nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0]
19 18
20 19 headers = {
Modified g4f/Provider/__init__.py +2 -1
@@ -21,7 +21,8 @@ from .Providers import (
21 21 DFEHub,
22 22 AiService,
23 23 BingHuan,
24 Wewordle
24 Wewordle,
25 ChatgptAi,
25 26 )
26 27
27 28 Palm = Bard
Added testing/test.py +13 -0
@@ -0,0 +1,13 @@
1 import g4f
2
3 # Set with provider
4 stream = False
5 response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.ChatgptLogin, messages=[
6 {"role": "user", "content": "hello"}], stream=stream)
7
8 if stream:
9 for message in response:
10 print(message)
11 else:
12 print(response)
13