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

XFEstudio/gpt4free

.

d0e9b9de
t.me/xtekky <98614666+xtekky@users.noreply.github.com>
提交于

代码差异

1 个文件 +26 -0
Added unfinished/easyai/main.py +26 -0
@@ -0,0 +1,26 @@
1 import requests
2
3 headers = {
4 'Accept': 'text/event-stream',
5 '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',
6 'Cache-Control': 'no-cache',
7 'Connection': 'keep-alive',
8 'Pragma': 'no-cache',
9 'Referer': 'http://easy-ai.ink/chat',
10 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
11 'token': 'null',
12 }
13
14 while True:
15 params = {
16 'message': 'what is my name',
17 'sessionId': '2eacb8ad826056587598',
18 }
19
20 for chunk in requests.get('http://easy-ai.ink/easyapi/v1/chat/completions', params=params,
21 headers=headers, verify=False, stream=True).iter_lines():
22
23 if b'data:' in chunk:
24 print(chunk)
25
26 print(chunk)