From a485cfb180094f14b3fe27ea218d2890033768a3 Mon Sep 17 00:00:00 2001 From: "t.me/xtekky" <98614666+xtekky@users.noreply.github.com> Date: Thu, 20 Apr 2023 15:34:19 +0100 Subject: unfinished api's (help is welcome) --- unfinished/sqlchat/README.md | 3 +++ unfinished/sqlchat/__init__.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 unfinished/sqlchat/README.md create mode 100644 unfinished/sqlchat/__init__.py (limited to 'unfinished/sqlchat') diff --git a/unfinished/sqlchat/README.md b/unfinished/sqlchat/README.md new file mode 100644 index 00000000..ddd5c8f9 --- /dev/null +++ b/unfinished/sqlchat/README.md @@ -0,0 +1,3 @@ +https://www.sqlchat.ai/ +to do: +- code refractoring \ No newline at end of file diff --git a/unfinished/sqlchat/__init__.py b/unfinished/sqlchat/__init__.py new file mode 100644 index 00000000..a7c2c54b --- /dev/null +++ b/unfinished/sqlchat/__init__.py @@ -0,0 +1,29 @@ +import requests + +headers = { + 'authority': 'www.sqlchat.ai', + 'accept': '*/*', + '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': 'text/plain;charset=UTF-8', + 'origin': 'https://www.sqlchat.ai', + 'referer': 'https://www.sqlchat.ai/', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'same-origin', + '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', +} + +data = { + 'messages':[ + {'role':'system','content':''}, + {'role':'user','content':'hello world'}, + ], + 'openAIApiConfig':{ + 'key':'', + 'endpoint':'' + } +} + +response = requests.post('https://www.sqlchat.ai/api/chat', headers=headers, json=data, stream=True) +for message in response.iter_content(chunk_size=1024): + print(message) \ No newline at end of file -- cgit v1.2.3