summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/deprecated/Myshell.py
diff options
context:
space:
mode:
authorrazrab <razrab@PimoLin>2023-10-23 07:25:46 +0200
committerrazrab <razrab@PimoLin>2023-10-23 07:25:46 +0200
commit2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c (patch)
tree7de51129865bd786bdf7b21fa658725a474a8cd8 /g4f/Provider/deprecated/Myshell.py
parentAdded code to ignore certain providers in the API (diff)
parent~ | g4f `v-0.1.7.5` (diff)
downloadgpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar.gz
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar.bz2
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar.lz
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar.xz
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.tar.zst
gpt4free-2b3bc749b39b0c6f3e8921b9e3b2fc52263c568c.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/deprecated/Myshell.py (renamed from g4f/Provider/Myshell.py)48
1 files changed, 3 insertions, 45 deletions
diff --git a/g4f/Provider/Myshell.py b/g4f/Provider/deprecated/Myshell.py
index 096545f9..85731325 100644
--- a/g4f/Provider/Myshell.py
+++ b/g4f/Provider/deprecated/Myshell.py
@@ -8,8 +8,8 @@ from aiohttp import ClientSession
from aiohttp.http import WSMsgType
import asyncio
-from ..typing import AsyncResult, Messages
-from .base_provider import AsyncGeneratorProvider, format_prompt
+from ...typing import AsyncResult, Messages
+from ..base_provider import AsyncGeneratorProvider, format_prompt
models = {
@@ -174,46 +174,4 @@ def generate_visitor_id(user_agent: str) -> str:
r = hex(int(random.random() * (16**16)))[2:-2]
d = xor_hash(user_agent)
e = hex(1080 * 1920)[2:]
- return f"{f}-{r}-{d}-{e}-{f}"
-
-
-
-# update
-# from g4f.requests import StreamSession
-
-# async def main():
-# headers = {
-# 'authority': 'api.myshell.ai',
-# 'accept': 'application/json',
-# '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',
-# 'content-type': 'application/json',
-# 'myshell-service-name': 'organics-api',
-# 'origin': 'https://app.myshell.ai',
-# 'referer': 'https://app.myshell.ai/',
-# 'sec-ch-ua': '"Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"',
-# 'sec-ch-ua-mobile': '?0',
-# 'sec-ch-ua-platform': '"macOS"',
-# 'sec-fetch-dest': 'empty',
-# 'sec-fetch-mode': 'cors',
-# 'sec-fetch-site': 'same-site',
-# 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
-# 'visitor-id': '18ae8fe5d916d3-0213f29594b17f-18525634-157188-18ae8fe5d916d3',
-# }
-
-# json_data = {
-# 'conversation_scenario': 3,
-# 'botId': '4738',
-# 'message': 'hi',
-# 'messageType': 1,
-# }
-
-# async with StreamSession(headers=headers, impersonate="chrome110") as session:
-# async with session.post(f'https://api.myshell.ai/v1/bot/chat/send_message',
-# json=json_data) as response:
-
-# response.raise_for_status()
-# async for chunk in response.iter_content():
-# print(chunk.decode("utf-8"))
-
-# import asyncio
-# asyncio.run(main()) \ No newline at end of file
+ return f"{f}-{r}-{d}-{e}-{f}" \ No newline at end of file