Ryzenth 1.8.1__py3-none-any.whl → 1.8.2__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 +1 -1
- Ryzenth/__version__.py +1 -1
- Ryzenth/_asynchisded.py +27 -7
- Ryzenth/_synchisded.py +27 -7
- Ryzenth/ryzenth_client.py +2 -1
- Ryzenth/types/__init__.py +4 -3
- {ryzenth-1.8.1.dist-info → ryzenth-1.8.2.dist-info}/METADATA +20 -6
- ryzenth-1.8.2.dist-info/RECORD +11 -0
- ryzenth-1.8.1.dist-info/RECORD +0 -11
- {ryzenth-1.8.1.dist-info → ryzenth-1.8.2.dist-info}/WHEEL +0 -0
- {ryzenth-1.8.1.dist-info → ryzenth-1.8.2.dist-info}/licenses/LICENSE +0 -0
- {ryzenth-1.8.1.dist-info → ryzenth-1.8.2.dist-info}/top_level.txt +0 -0
Ryzenth/__init__.py
CHANGED
Ryzenth/__version__.py
CHANGED
Ryzenth/_asynchisded.py
CHANGED
@@ -17,20 +17,40 @@
|
|
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
|
-
|
20
|
+
import logging
|
21
|
+
|
21
22
|
import httpx
|
22
23
|
|
24
|
+
from Ryzenth.types import QueryParameter
|
25
|
+
|
26
|
+
LOGS = logging.getLogger("[Ryzenth] async")
|
27
|
+
|
23
28
|
class RyzenthXAsync:
|
24
|
-
def __init__(self, api_key, base_url="https://randydev-ryu-js.hf.space/api"):
|
29
|
+
def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
|
25
30
|
self.api_key = api_key
|
26
|
-
self.base_url = base_url
|
27
|
-
self.headers = {"x-api-key":
|
31
|
+
self.base_url = base_url.rstrip("/")
|
32
|
+
self.headers = {"x-api-key": self.api_key}
|
33
|
+
|
34
|
+
async def send_message(self, model: str, params: QueryParameter):
|
35
|
+
model_dict = {
|
36
|
+
"hybrid": "AkenoX-1.9-Hybrid",
|
37
|
+
"melayu": "lu-melayu",
|
38
|
+
"nocodefou": "nocodefou",
|
39
|
+
"mia": "mia-khalifah",
|
40
|
+
"curlmcode": "curl-command-code",
|
41
|
+
"quotessad": "quotes-sad",
|
42
|
+
"quoteslucu": "quotes-lucu",
|
43
|
+
"lirikend": "lirik-end",
|
44
|
+
"alsholawat": "al-sholawat"
|
45
|
+
}
|
46
|
+
model_param = model_dict.get(model)
|
47
|
+
if not model_param:
|
48
|
+
raise ValueError(f"Invalid model name: {model}")
|
28
49
|
|
29
|
-
async def send_message_hybrid(self, text: str):
|
30
50
|
async with httpx.AsyncClient() as client:
|
31
51
|
try:
|
32
52
|
response = await client.get(
|
33
|
-
f"{self.base_url}/v1/ai/akenox/
|
53
|
+
f"{self.base_url}/v1/ai/akenox/{model_param}",
|
34
54
|
params=params.dict(),
|
35
55
|
headers=self.headers,
|
36
56
|
timeout=10
|
@@ -38,5 +58,5 @@ class RyzenthXAsync:
|
|
38
58
|
response.raise_for_status()
|
39
59
|
return response.json()
|
40
60
|
except httpx.HTTPError as e:
|
41
|
-
|
61
|
+
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
42
62
|
return None
|
Ryzenth/_synchisded.py
CHANGED
@@ -17,19 +17,39 @@
|
|
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
|
-
|
20
|
+
import logging
|
21
|
+
|
21
22
|
import httpx
|
22
23
|
|
24
|
+
from Ryzenth.types import QueryParameter
|
25
|
+
|
26
|
+
LOGS = logging.getLogger("[Ryzenth] sync")
|
27
|
+
|
23
28
|
class RyzenthXSync:
|
24
|
-
def __init__(self, api_key, base_url="https://randydev-ryu-js.hf.space/api"):
|
29
|
+
def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
|
25
30
|
self.api_key = api_key
|
26
|
-
self.base_url = base_url
|
27
|
-
self.headers = {"x-api-key":
|
31
|
+
self.base_url = base_url.rstrip("/")
|
32
|
+
self.headers = {"x-api-key": self.api_key}
|
33
|
+
|
34
|
+
def send_message(self, model: str, params: QueryParameter):
|
35
|
+
model_dict = {
|
36
|
+
"hybrid": "AkenoX-1.9-Hybrid",
|
37
|
+
"melayu": "lu-melayu",
|
38
|
+
"nocodefou": "nocodefou",
|
39
|
+
"mia": "mia-khalifah",
|
40
|
+
"curlmcode": "curl-command-code",
|
41
|
+
"quotessad": "quotes-sad",
|
42
|
+
"quoteslucu": "quotes-lucu",
|
43
|
+
"lirikend": "lirik-end",
|
44
|
+
"alsholawat": "al-sholawat"
|
45
|
+
}
|
46
|
+
model_param = model_dict.get(model)
|
47
|
+
if not model_param:
|
48
|
+
raise ValueError(f"Invalid model name: {model}")
|
28
49
|
|
29
|
-
def send_message_hybrid(self, params: HybridParams):
|
30
50
|
try:
|
31
51
|
response = httpx.get(
|
32
|
-
f"{self.base_url}/v1/ai/akenox/
|
52
|
+
f"{self.base_url}/v1/ai/akenox/{model_param}",
|
33
53
|
params=params.dict(),
|
34
54
|
headers=self.headers,
|
35
55
|
timeout=10
|
@@ -37,5 +57,5 @@ class RyzenthXSync:
|
|
37
57
|
response.raise_for_status()
|
38
58
|
return response.json()
|
39
59
|
except httpx.HTTPError as e:
|
40
|
-
|
60
|
+
LOGS.error(f"[SYNC] Error fetching from model '{model_param}': {e}")
|
41
61
|
return None
|
Ryzenth/ryzenth_client.py
CHANGED
Ryzenth/types/__init__.py
CHANGED
@@ -18,9 +18,10 @@
|
|
18
18
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
|
20
20
|
|
21
|
-
from pydantic import BaseModel
|
22
21
|
from typing import Optional
|
23
22
|
|
24
|
-
|
23
|
+
from pydantic import BaseModel
|
24
|
+
|
25
|
+
|
26
|
+
class QueryParameter(BaseModel):
|
25
27
|
query: str
|
26
|
-
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: Ryzenth
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.2
|
4
4
|
Summary: Ryzenth Python Wrapper For Perfomance
|
5
5
|
Author: TeamKillerX
|
6
6
|
License: MIT
|
@@ -54,7 +54,7 @@ Dynamic: summary
|
|
54
54
|
|
55
55
|
# Ryzenth Library
|
56
56
|
|
57
|
-
**Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API**
|
57
|
+
**Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API** a successor to the AkenoX API supporting both synchronous and asynchronous workflows out of the box.
|
58
58
|
|
59
59
|
> Note: AkenoX API is still alive and supported, but Ryzenth is the next generation.
|
60
60
|
|
@@ -68,7 +68,7 @@ Dynamic: summary
|
|
68
68
|
## Installation
|
69
69
|
|
70
70
|
```bash
|
71
|
-
pip install ryzenth
|
71
|
+
pip install ryzenth[fast]
|
72
72
|
````
|
73
73
|
|
74
74
|
## Getting Started
|
@@ -77,21 +77,35 @@ pip install ryzenth
|
|
77
77
|
|
78
78
|
```python
|
79
79
|
from Ryzenth import ApiKeyFrom
|
80
|
+
from Ryzenth.types import QueryParameter
|
80
81
|
|
81
|
-
ryz = ApiKeyFrom("
|
82
|
-
|
82
|
+
ryz = ApiKeyFrom("akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC")
|
83
|
+
|
84
|
+
ok = await ryz.aio.send_message(
|
85
|
+
"hybrid",
|
86
|
+
QueryParameter(
|
87
|
+
query="hello world!"
|
88
|
+
)
|
89
|
+
)
|
83
90
|
```
|
84
91
|
|
85
92
|
### Sync Example
|
86
93
|
|
87
94
|
```python
|
88
95
|
from Ryzenth import ApiKeyFrom
|
96
|
+
from Ryzenth.types import QueryParameter
|
89
97
|
|
90
98
|
ryz = ApiKeyFrom("your-api-key")
|
91
|
-
ryz._sync.
|
99
|
+
ryz._sync.send_message(
|
100
|
+
"hybrid",
|
101
|
+
QueryParameter(
|
102
|
+
query="hello world!"
|
103
|
+
)
|
104
|
+
)
|
92
105
|
```
|
93
106
|
|
94
107
|
## Environment Variable Support
|
108
|
+
- Available API key v2 via [`@aknuserbot`](https://t.me/aknuserbot)
|
95
109
|
|
96
110
|
You can skip passing the API key directly by setting it via environment:
|
97
111
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Ryzenth/__init__.py,sha256=-_DvsIrYN1rtnUJzhhgRjdCspuD26jh_AbQBtDkmoyo,944
|
2
|
+
Ryzenth/__version__.py,sha256=nuXh4zeKc0SG9XKYzgVp26tL3QzX62rLChGPYS1gOnE,118
|
3
|
+
Ryzenth/_asynchisded.py,sha256=nkc3mdQur3akrZUZ0Tbc5l8eBlhztip1rutm51Cd8ck,2292
|
4
|
+
Ryzenth/_synchisded.py,sha256=xn0qEMQycXcRucKB6Q0ddIFqkoFm79P8wCtzGVlcHbw,2209
|
5
|
+
Ryzenth/ryzenth_client.py,sha256=fN_0BcK0ao6-CTpe5bRCT9jQD7Krr_Q8-Xlf-aFqdZY,1225
|
6
|
+
Ryzenth/types/__init__.py,sha256=avUo1Ya13w7m42Uf-jtWo_4iBquUPF7MbP9XXmSBJog,933
|
7
|
+
ryzenth-1.8.2.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
8
|
+
ryzenth-1.8.2.dist-info/METADATA,sha256=3c1wAYr9Zc710FVHyLx-iE7j5vP4M37-MXX6ASsIHr0,3292
|
9
|
+
ryzenth-1.8.2.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
10
|
+
ryzenth-1.8.2.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
11
|
+
ryzenth-1.8.2.dist-info/RECORD,,
|
ryzenth-1.8.1.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Ryzenth/__init__.py,sha256=GHr2eIrtZp0amBwj1qsvSGxCDkZM6iMjNBan5CdJYXA,944
|
2
|
-
Ryzenth/__version__.py,sha256=69dfO52GCQeqgHIHeMb7JHNZg16O-u-lrZzoqaZ4cuI,118
|
3
|
-
Ryzenth/_asynchisded.py,sha256=9j87R977IKzZhBdNeSDbQmGVUnB981gZ6Uwthyb9jgY,1653
|
4
|
-
Ryzenth/_synchisded.py,sha256=35sZjFm2HtgdGFUN-pLGbnEmXgBt--MckFHlpjbxTOw,1551
|
5
|
-
Ryzenth/ryzenth_client.py,sha256=SGq63zu6HW2CHl23ODBRcgDeocPqXzwcXMUDVcMza3A,1224
|
6
|
-
Ryzenth/types/__init__.py,sha256=pAiFktEAU2VRmZC7Ig9YCypR2IwNARWnhWJQzGLqX_Q,932
|
7
|
-
ryzenth-1.8.1.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
8
|
-
ryzenth-1.8.1.dist-info/METADATA,sha256=wDfsej2RzbJN2cgXRUT27_eNf5TTnufVtRdq8wKWZ3Q,3035
|
9
|
-
ryzenth-1.8.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
10
|
-
ryzenth-1.8.1.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
11
|
-
ryzenth-1.8.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|