first commit

This commit is contained in:
George Kasparyants
2024-06-14 00:47:32 +03:00
commit 7591784e34
31 changed files with 3029 additions and 0 deletions

36
miapia_own/aihandler.py Normal file
View File

@@ -0,0 +1,36 @@
import requests
class AIHandler(object):
def __init__(self):
pass
def __call__(self, text):
resp = requests.post("https://fast-pia.avemio.technology/chat-completion",
json={
"session-id": "chatcmpl",
"user-location": "Zweibrücken",
"wheel-of-life": [
{
"personal_growth": 10,
"health_exercise": 5,
"familiy_friends": 5,
"romance_relationship": 5,
"career_work": 5,
"finances": 5,
"recreation_fun": 5,
"living_situation": 5}
],
"messages": [
{
"role": "user",
"content": text
}
]
})
resp = resp.json()
return {
"text": resp[0]['text'],
"emotion": resp[0]['emotion']
}