Ryzenth 1.8.1__tar.gz → 1.8.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 1.8.1
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**a successor to the AkenoX API supporting both synchronous and asynchronous workflows out of the box.
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("your-api-key")
82
- await ryz.aio.send_message_hybrid("Hello from Ryzenth!")
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.send_message_hybrid("Hello from Ryzenth (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
 
@@ -1,6 +1,6 @@
1
1
  # Ryzenth Library
2
2
 
3
- **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.
3
+ **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.
4
4
 
5
5
  > Note: AkenoX API is still alive and supported, but Ryzenth is the next generation.
6
6
 
@@ -14,7 +14,7 @@
14
14
  ## Installation
15
15
 
16
16
  ```bash
17
- pip install ryzenth
17
+ pip install ryzenth[fast]
18
18
  ````
19
19
 
20
20
  ## Getting Started
@@ -23,21 +23,35 @@ pip install ryzenth
23
23
 
24
24
  ```python
25
25
  from Ryzenth import ApiKeyFrom
26
+ from Ryzenth.types import QueryParameter
26
27
 
27
- ryz = ApiKeyFrom("your-api-key")
28
- await ryz.aio.send_message_hybrid("Hello from Ryzenth!")
28
+ ryz = ApiKeyFrom("akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC")
29
+
30
+ ok = await ryz.aio.send_message(
31
+ "hybrid",
32
+ QueryParameter(
33
+ query="hello world!"
34
+ )
35
+ )
29
36
  ```
30
37
 
31
38
  ### Sync Example
32
39
 
33
40
  ```python
34
41
  from Ryzenth import ApiKeyFrom
42
+ from Ryzenth.types import QueryParameter
35
43
 
36
44
  ryz = ApiKeyFrom("your-api-key")
37
- ryz._sync.send_message_hybrid("Hello from Ryzenth (sync)!")
45
+ ryz._sync.send_message(
46
+ "hybrid",
47
+ QueryParameter(
48
+ query="hello world!"
49
+ )
50
+ )
38
51
  ```
39
52
 
40
53
  ## Environment Variable Support
54
+ - Available API key v2 via [`@aknuserbot`](https://t.me/aknuserbot)
41
55
 
42
56
  You can skip passing the API key directly by setting it via environment:
43
57
 
@@ -1,4 +1,4 @@
1
- __version__ = "1.8.1"
1
+ __version__ = "1.8.2"
2
2
  __author__ = "TeamKillerX"
3
3
  __title__ = "Ryzenth"
4
4
  __description__ = "Ryzenth Python API Wrapper"
@@ -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
- from Ryzenth.types import *
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": f"{self.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/AkenoX-1.9-Hybrid",
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
- print(f"[ASYNC] Error: {e}")
61
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
42
62
  return None
@@ -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
- from Ryzenth.types import *
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": f"{self.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/AkenoX-1.9-Hybrid",
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
- print(f"[SYNC] Error: {e}")
60
+ LOGS.error(f"[SYNC] Error fetching from model '{model_param}': {e}")
41
61
  return None
@@ -19,8 +19,9 @@
19
19
 
20
20
  import os
21
21
 
22
- from Ryzenth._synchisded import RyzenthXSync
23
22
  from Ryzenth._asynchisded import RyzenthXAsync
23
+ from Ryzenth._synchisded import RyzenthXSync
24
+
24
25
 
25
26
  class ApiKeyFrom:
26
27
  def __init__(self, api_key: str = None):
@@ -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
- class HybridParams(BaseModel):
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.1
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**a successor to the AkenoX API supporting both synchronous and asynchronous workflows out of the box.
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("your-api-key")
82
- await ryz.aio.send_message_hybrid("Hello from Ryzenth!")
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.send_message_hybrid("Hello from Ryzenth (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
 
@@ -3,6 +3,7 @@ import re
3
3
 
4
4
  import setuptools
5
5
 
6
+
6
7
  def read(fname, version=False):
7
8
  text = open(os.path.join(os.path.dirname(__file__), fname), encoding="utf8").read()
8
9
  return re.search(r'__version__ = "(.*?)"', text)[1] if version else text
File without changes
@@ -18,8 +18,8 @@
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
20
  from . import *
21
- from .ryzenth_client import ApiKeyFrom
22
21
  from .__version__ import __version__
22
+ from .ryzenth_client import ApiKeyFrom
23
23
 
24
24
  __all__ = [
25
25
  "ApiKeyFrom"
File without changes