Ryzenth 1.9.3__py3-none-any.whl → 1.9.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Ryzenth/__init__.py +2 -4
- Ryzenth/__version__.py +1 -1
- Ryzenth/_asynchisded.py +5 -3
- Ryzenth/_client.py +23 -5
- Ryzenth/_synchisded.py +12 -3
- Ryzenth/helper/__init__.py +6 -1
- Ryzenth/helper/_decorators.py +48 -0
- Ryzenth/helper/_federation.py +1 -1
- Ryzenth/helper/_fonts.py +1 -3
- Ryzenth/helper/_images.py +2 -2
- Ryzenth/helper/_moderator.py +1 -3
- Ryzenth/helper/_openai.py +2 -2
- Ryzenth/helper/_ryzenth.py +73 -0
- Ryzenth/helper/_thinking.py +2 -2
- Ryzenth/types/__init__.py +6 -0
- {ryzenth-1.9.3.dist-info → ryzenth-1.9.6.dist-info}/METADATA +1 -1
- ryzenth-1.9.6.dist-info/RECORD +21 -0
- {ryzenth-1.9.3.dist-info → ryzenth-1.9.6.dist-info}/WHEEL +1 -1
- ryzenth-1.9.3.dist-info/RECORD +0 -19
- {ryzenth-1.9.3.dist-info → ryzenth-1.9.6.dist-info}/licenses/LICENSE +0 -0
- {ryzenth-1.9.3.dist-info → ryzenth-1.9.6.dist-info}/top_level.txt +0 -0
Ryzenth/__init__.py
CHANGED
@@ -19,8 +19,6 @@
|
|
19
19
|
|
20
20
|
from . import *
|
21
21
|
from .__version__ import __version__
|
22
|
-
from ._client import ApiKeyFrom
|
22
|
+
from ._client import ApiKeyFrom, SmallConvertDot, UrHellFrom
|
23
23
|
|
24
|
-
__all__ = [
|
25
|
-
"ApiKeyFrom"
|
26
|
-
]
|
24
|
+
__all__ = [ "ApiKeyFrom", "UrHellFrom", "SmallConvertDot"]
|
Ryzenth/__version__.py
CHANGED
Ryzenth/_asynchisded.py
CHANGED
@@ -22,16 +22,17 @@ import logging
|
|
22
22
|
import httpx
|
23
23
|
from box import Box
|
24
24
|
|
25
|
-
from
|
26
|
-
from
|
25
|
+
from ._errors import WhatFuckError
|
26
|
+
from .helper import (
|
27
27
|
FbanAsync,
|
28
28
|
FontsAsync,
|
29
|
+
HumanizeAsync,
|
29
30
|
ImagesAsync,
|
30
31
|
ModeratorAsync,
|
31
32
|
WhatAsync,
|
32
33
|
WhisperAsync,
|
33
34
|
)
|
34
|
-
from
|
35
|
+
from .types import DownloaderBy, QueryParameter
|
35
36
|
|
36
37
|
LOGS = logging.getLogger("[Ryzenth] async")
|
37
38
|
|
@@ -48,6 +49,7 @@ class RyzenthXAsync:
|
|
48
49
|
self.federation = FbanAsync(self)
|
49
50
|
self.moderator = ModeratorAsync(self)
|
50
51
|
self.fonts = FontsAsync(self)
|
52
|
+
self.humanizer = HumanizeAsync(self)
|
51
53
|
self.obj = Box
|
52
54
|
|
53
55
|
async def send_downloader(
|
Ryzenth/_client.py
CHANGED
@@ -19,21 +19,24 @@
|
|
19
19
|
|
20
20
|
import os
|
21
21
|
|
22
|
-
from
|
23
|
-
|
22
|
+
from box import Box
|
23
|
+
|
24
|
+
from ._asynchisded import RyzenthXAsync
|
25
|
+
from ._synchisded import RyzenthXSync
|
26
|
+
from .helper import Decorators
|
24
27
|
|
25
28
|
|
26
29
|
class ApiKeyFrom:
|
27
|
-
def __init__(self, api_key: str = None,
|
30
|
+
def __init__(self, api_key: str = None, is_ok=False):
|
28
31
|
if api_key is Ellipsis:
|
29
|
-
|
32
|
+
is_ok = True
|
30
33
|
api_key = None
|
31
34
|
|
32
35
|
if not api_key:
|
33
36
|
api_key = os.environ.get("RYZENTH_API_KEY")
|
34
37
|
|
35
38
|
if not api_key:
|
36
|
-
api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if
|
39
|
+
api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if is_ok else None
|
37
40
|
|
38
41
|
self.api_key = api_key
|
39
42
|
self.aio = RyzenthXAsync(api_key)
|
@@ -41,3 +44,18 @@ class ApiKeyFrom:
|
|
41
44
|
|
42
45
|
def something(self):
|
43
46
|
pass
|
47
|
+
|
48
|
+
class UrHellFrom:
|
49
|
+
def __init__(self, name: str, only_author=False):
|
50
|
+
self.decorators = Decorators(ApiKeyFrom)
|
51
|
+
self.ai = self.decorators.send_ai(name=name, only_author=only_author)
|
52
|
+
|
53
|
+
def something(self):
|
54
|
+
pass
|
55
|
+
|
56
|
+
class SmallConvertDot:
|
57
|
+
def __init__(self, obj):
|
58
|
+
self.obj = obj
|
59
|
+
|
60
|
+
def to_dot(self):
|
61
|
+
return Box(self.obj if self.obj is not None else {})
|
Ryzenth/_synchisded.py
CHANGED
@@ -22,9 +22,17 @@ import logging
|
|
22
22
|
import httpx
|
23
23
|
from box import Box
|
24
24
|
|
25
|
-
from
|
26
|
-
from
|
27
|
-
|
25
|
+
from ._errors import WhatFuckError
|
26
|
+
from .helper import (
|
27
|
+
FbanSync,
|
28
|
+
FontsSync,
|
29
|
+
HumanizeSync,
|
30
|
+
ImagesSync,
|
31
|
+
ModeratorSync,
|
32
|
+
WhatSync,
|
33
|
+
WhisperSync,
|
34
|
+
)
|
35
|
+
from .types import DownloaderBy, QueryParameter
|
28
36
|
|
29
37
|
LOGS = logging.getLogger("[Ryzenth] sync")
|
30
38
|
|
@@ -41,6 +49,7 @@ class RyzenthXSync:
|
|
41
49
|
self.federation = FbanSync(self)
|
42
50
|
self.moderator = ModeratorSync(self)
|
43
51
|
self.fonts = FontsSync(self)
|
52
|
+
self.humanizer = HumanizeSync(self)
|
44
53
|
self.obj = Box
|
45
54
|
|
46
55
|
def send_downloader(
|
Ryzenth/helper/__init__.py
CHANGED
@@ -17,11 +17,13 @@
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
18
18
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
+
from ._decorators import Decorators
|
20
21
|
from ._federation import FbanAsync, FbanSync
|
21
22
|
from ._fonts import FontsAsync, FontsSync
|
22
23
|
from ._images import ImagesAsync, ImagesSync
|
23
24
|
from ._moderator import ModeratorAsync, ModeratorSync
|
24
25
|
from ._openai import WhisperAsync, WhisperSync
|
26
|
+
from ._ryzenth import HumanizeAsync, HumanizeSync
|
25
27
|
from ._thinking import WhatAsync, WhatSync
|
26
28
|
|
27
29
|
__all__ = [
|
@@ -36,5 +38,8 @@ __all__ = [
|
|
36
38
|
"ModeratorAsync",
|
37
39
|
"ModeratorSync",
|
38
40
|
"FontsAsync",
|
39
|
-
"FontsSync"
|
41
|
+
"FontsSync",
|
42
|
+
"HumanizeAsync",
|
43
|
+
"HumanizeSync",
|
44
|
+
"Decorators"
|
40
45
|
]
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
|
4
|
+
#
|
5
|
+
# from : https://github.com/TeamKillerX
|
6
|
+
# Channel : @RendyProjects
|
7
|
+
# This program is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Affero General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Affero General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Affero General Public License
|
18
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
from functools import wraps
|
21
|
+
|
22
|
+
from ..types import QueryParameter
|
23
|
+
|
24
|
+
|
25
|
+
class Decorators:
|
26
|
+
def __init__(self, class_func):
|
27
|
+
self._clients_ai = class_func(..., is_ok=True)
|
28
|
+
|
29
|
+
def send_ai(self, name: str, only_author=False):
|
30
|
+
def decorator(func):
|
31
|
+
@wraps(func)
|
32
|
+
async def wrapper(client, message, *args, **kwargs):
|
33
|
+
if only_author and message.from_user.id != client.me.id:
|
34
|
+
return await message.reply_text(
|
35
|
+
"Only Developer can use this command.", **kwargs
|
36
|
+
)
|
37
|
+
query = message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else ""
|
38
|
+
if not query:
|
39
|
+
return await message.reply_text(
|
40
|
+
"Please provide a query after the command.", **kwargs
|
41
|
+
)
|
42
|
+
result = await self._clients_ai.aio.send_message(
|
43
|
+
name, QueryParameter(query=query), dot_access=True
|
44
|
+
)
|
45
|
+
await message.reply_text(result.results, **kwargs)
|
46
|
+
return await func(client, message, query, *args, **kwargs)
|
47
|
+
return wrapper
|
48
|
+
return decorator
|
Ryzenth/helper/_federation.py
CHANGED
Ryzenth/helper/_fonts.py
CHANGED
@@ -17,13 +17,11 @@
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
18
18
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
import json
|
21
20
|
import logging
|
22
|
-
from datetime import datetime as dt
|
23
21
|
|
24
22
|
import httpx
|
25
23
|
|
26
|
-
from
|
24
|
+
from .._errors import ParamsRequiredError, WhatFuckError
|
27
25
|
|
28
26
|
LOGS = logging.getLogger("[Ryzenth]")
|
29
27
|
|
Ryzenth/helper/_images.py
CHANGED
Ryzenth/helper/_moderator.py
CHANGED
@@ -17,13 +17,11 @@
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
18
18
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
import json
|
21
20
|
import logging
|
22
|
-
from datetime import datetime as dt
|
23
21
|
|
24
22
|
import httpx
|
25
23
|
|
26
|
-
from
|
24
|
+
from .._errors import InvalidVersionError, WhatFuckError
|
27
25
|
|
28
26
|
LOGS = logging.getLogger("[Ryzenth]")
|
29
27
|
|
Ryzenth/helper/_openai.py
CHANGED
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
|
4
|
+
#
|
5
|
+
# from : https://github.com/TeamKillerX
|
6
|
+
# Channel : @RendyProjects
|
7
|
+
# This program is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Affero General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Affero General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Affero General Public License
|
18
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
import json
|
21
|
+
import logging
|
22
|
+
|
23
|
+
import httpx
|
24
|
+
|
25
|
+
from .._errors import WhatFuckError
|
26
|
+
from ..types import RequestHumanizer
|
27
|
+
|
28
|
+
LOGS = logging.getLogger("[Ryzenth]")
|
29
|
+
|
30
|
+
class HumanizeAsync:
|
31
|
+
def __init__(self, parent):
|
32
|
+
self.parent = parent
|
33
|
+
|
34
|
+
async def rewrite(self, params: RequestHumanizer, pickle_json=False, dot_access=False):
|
35
|
+
url = f"{self.parent.base_url}/v1/ai/r/Ryzenth-Humanize-05-06-2025"
|
36
|
+
async with httpx.AsyncClient() as client:
|
37
|
+
try:
|
38
|
+
response = await client.get(
|
39
|
+
url,
|
40
|
+
params=params.dict(),
|
41
|
+
headers=self.parent.headers,
|
42
|
+
timeout=self.parent.timeout
|
43
|
+
)
|
44
|
+
response.raise_for_status()
|
45
|
+
if pickle_json:
|
46
|
+
result = response.json()["results"]
|
47
|
+
return json.loads(result)
|
48
|
+
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
49
|
+
except httpx.HTTPError as e:
|
50
|
+
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
51
|
+
raise WhatFuckError("[ASYNC] Error fetching") from e
|
52
|
+
|
53
|
+
class HumanizeSync:
|
54
|
+
def __init__(self, parent):
|
55
|
+
self.parent = parent
|
56
|
+
|
57
|
+
def rewrite(self, params: RequestHumanizer, pickle_json=False, dot_access=False):
|
58
|
+
url = f"{self.parent.base_url}/v1/ai/r/Ryzenth-Humanize-05-06-2025"
|
59
|
+
try:
|
60
|
+
response = httpx.get(
|
61
|
+
url,
|
62
|
+
params=params.dict(),
|
63
|
+
headers=self.parent.headers,
|
64
|
+
timeout=self.parent.timeout
|
65
|
+
)
|
66
|
+
response.raise_for_status()
|
67
|
+
if pickle_json:
|
68
|
+
result = response.json()["results"]
|
69
|
+
return json.loads(result)
|
70
|
+
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
71
|
+
except httpx.HTTPError as e:
|
72
|
+
LOGS.error(f"[SYNC] Error fetching from humanize {e}")
|
73
|
+
raise WhatFuckError("[SYNC] Error fetching from humanize") from e
|
Ryzenth/helper/_thinking.py
CHANGED
Ryzenth/types/__init__.py
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
Ryzenth/__init__.py,sha256=vM1IVkgRFQT5o15KYKx8kY59114Jw5taP8ytm9YJy94,996
|
2
|
+
Ryzenth/__version__.py,sha256=h5y4YdrdepFU2B-hlvSyE5t2jfsYpCCn6n_4JHGhiHA,118
|
3
|
+
Ryzenth/_asynchisded.py,sha256=aO04ouIsM_0WTgg3Ntihin5ed7QbdpJc_dqZZAdwv0A,4952
|
4
|
+
Ryzenth/_client.py,sha256=1DhB0Ey-XM8kSpP3ztNkGkrevyLssdFAwLf4mjI6DWU,1867
|
5
|
+
Ryzenth/_errors.py,sha256=PYHmA3xZPZnH8T1Yo0Al6ln2FP8KC9Jk3eN631ve2S4,1236
|
6
|
+
Ryzenth/_synchisded.py,sha256=77DLzv2PmEWKZNVvMPG_0yQ9Lr4rQXuu6yls_eV_Hyg,4772
|
7
|
+
Ryzenth/helper/__init__.py,sha256=BkP6fQ3IJnOqyXn07jD7anumVPlm8lVPNkFnK9b6XpE,1447
|
8
|
+
Ryzenth/helper/_decorators.py,sha256=jmBqzc3wyM8U28z-gf97M-kuBvMLE8laiV7hIqtaVgE,2026
|
9
|
+
Ryzenth/helper/_federation.py,sha256=hQ4XIha9j-ohUGmIJyD8HKWMFudBFU0iRLA-12qt_G0,13940
|
10
|
+
Ryzenth/helper/_fonts.py,sha256=i-1OlJwv_bTZL7Wewodajgotij5awSE04CNJyY_SXEs,3027
|
11
|
+
Ryzenth/helper/_images.py,sha256=bsCLycdlheqEc7I5jm_MVzscrNMX1Q_zmFWm3rhchA8,2297
|
12
|
+
Ryzenth/helper/_moderator.py,sha256=p7e1pRUTP8ROmFnRyNWSD5q65CQUKiavgp7yXCstLhk,5197
|
13
|
+
Ryzenth/helper/_openai.py,sha256=-VMH15PJXuYEu0UbwvlIus6NOsB-KNWBTMQvBU16EDU,2562
|
14
|
+
Ryzenth/helper/_ryzenth.py,sha256=923beacpCH37cUVwtrzgN81Br7ZeoIttN6yKThtRcsQ,2853
|
15
|
+
Ryzenth/helper/_thinking.py,sha256=4V2hH0FwegAGhmlO0YlAeXDH3DS4Omihf6m03YJc-SE,2545
|
16
|
+
Ryzenth/types/__init__.py,sha256=5K66BoRKd0yKdIFxph8FwM6Tr8Ha4sbgFctYlAUUQfw,1206
|
17
|
+
ryzenth-1.9.6.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
18
|
+
ryzenth-1.9.6.dist-info/METADATA,sha256=RSqob24B21U2cNvX5Q0g1mhq1Y1cNP2mWln59AimOqw,4120
|
19
|
+
ryzenth-1.9.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
20
|
+
ryzenth-1.9.6.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
21
|
+
ryzenth-1.9.6.dist-info/RECORD,,
|
ryzenth-1.9.3.dist-info/RECORD
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Ryzenth/__init__.py,sha256=CKayGQJ_ZUZF6OHyL9kCdTah05BUikXKWKXL_raAgo8,937
|
2
|
-
Ryzenth/__version__.py,sha256=WmPiDTS5JLqfcJY6NvMrcsmPyhA36b-NHzmjbFumbdg,118
|
3
|
-
Ryzenth/_asynchisded.py,sha256=ZNLp1rOJ_4SYcyMeB02ybsSmU38GO0TpHsQHRiR2w6c,4909
|
4
|
-
Ryzenth/_client.py,sha256=Y-I1ug8Hf2eF74oDY4eICOTP_nuLXdsDSkyZhpdqZy4,1475
|
5
|
-
Ryzenth/_errors.py,sha256=PYHmA3xZPZnH8T1Yo0Al6ln2FP8KC9Jk3eN631ve2S4,1236
|
6
|
-
Ryzenth/_synchisded.py,sha256=KFO3Smy3qKhOPW9cVQ6uutspDZjiZz79hiLaXFgGRfA,4702
|
7
|
-
Ryzenth/helper/__init__.py,sha256=ANx8vCXJ9ReLXIDWUwyhrIbw7jIyUXMdP11qotrWWIE,1308
|
8
|
-
Ryzenth/helper/_federation.py,sha256=VM1mkuPj4SvlO-VcazIV0T5Ga56RdcpDo7qybXwFCow,13946
|
9
|
-
Ryzenth/helper/_fonts.py,sha256=vQik0pGeKQGvUYhOfMO0W7MFM6Ig1oi-e_nBW_b6TuA,3081
|
10
|
-
Ryzenth/helper/_images.py,sha256=AfNQoxae-yI76PDUa-jx7tWBlJa4tRZQFDjeqBLKwVM,2309
|
11
|
-
Ryzenth/helper/_moderator.py,sha256=GTHTM8klfNrclhQM_gC0FHPLVmLj3n7NviOIX9Tr9bs,5270
|
12
|
-
Ryzenth/helper/_openai.py,sha256=hUhmwxuKV-AAeEbDFm4RnkasHNJjFROLdw1q2j2t_Mc,2574
|
13
|
-
Ryzenth/helper/_thinking.py,sha256=BKHvQe16KPOGh7_vev-_Ed8jl6_77_8Ys-g0SDtvlSU,2557
|
14
|
-
Ryzenth/types/__init__.py,sha256=3eEOjoRcEPoE5J5oIhXEPH6vbYG7TLasTHFcbWGS-mU,1095
|
15
|
-
ryzenth-1.9.3.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
16
|
-
ryzenth-1.9.3.dist-info/METADATA,sha256=CJKj1beAw8NlQ_3r0D_J8Ksqqy61Nn2h4f2T_9L9TpE,4120
|
17
|
-
ryzenth-1.9.3.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
18
|
-
ryzenth-1.9.3.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
19
|
-
ryzenth-1.9.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|