glchat-plugin 0.2.2__py3-none-any.whl → 0.2.4__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.
- glchat_plugin/service/base_rate_limiter_service.py +50 -0
- {glchat_plugin-0.2.2.dist-info → glchat_plugin-0.2.4.dist-info}/METADATA +2 -2
- {glchat_plugin-0.2.2.dist-info → glchat_plugin-0.2.4.dist-info}/RECORD +5 -4
- {glchat_plugin-0.2.2.dist-info → glchat_plugin-0.2.4.dist-info}/WHEEL +0 -0
- {glchat_plugin-0.2.2.dist-info → glchat_plugin-0.2.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Provides a base class for rate limiter service.
|
|
2
|
+
|
|
3
|
+
Authors:
|
|
4
|
+
Kevin Susanto (kevin.susanto@gdplabs.id)
|
|
5
|
+
|
|
6
|
+
References:
|
|
7
|
+
NONE
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from abc import ABC, abstractmethod
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BaseRateLimiterService(ABC):
|
|
15
|
+
"""A base class for tenant service."""
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
async def custom_identifier(self, request: Any, identifier_id: Any, **kwargs: Any) -> str:
|
|
19
|
+
"""Abstract method to get a custom identifier for rate limiting.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
request (Request): The incoming request.
|
|
23
|
+
identifier_id (str): The identifier ID for rate limiting.
|
|
24
|
+
**kwargs (Any): Additional keyword arguments.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
str: A custom identifier for rate limiting.
|
|
28
|
+
"""
|
|
29
|
+
raise NotImplementedError
|
|
30
|
+
|
|
31
|
+
@abstractmethod
|
|
32
|
+
async def setup_rate_limiter(self, **kwargs: Any) -> None:
|
|
33
|
+
"""Abstract method to set up the rate limiter.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
**kwargs (Any): Additional keyword arguments.
|
|
37
|
+
"""
|
|
38
|
+
raise NotImplementedError
|
|
39
|
+
|
|
40
|
+
@abstractmethod
|
|
41
|
+
def get_rate_limiter(self, key: str) -> Any:
|
|
42
|
+
"""Abstract method to get a rate limiter by key path.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
key: The keys to navigate to the rate limiter (e.g., "message" or "admin", "chatbot").
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
Any: The requested rate limiter instance.
|
|
49
|
+
"""
|
|
50
|
+
raise NotImplementedError
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: glchat-plugin
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Author-email: GenAI SDK Team <gat-sdk@gdplabs.id>
|
|
5
5
|
Requires-Python: <3.13,>=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
Requires-Dist: poetry>=2.1.3
|
|
8
|
-
Requires-Dist: bosa-core-binary>=0.
|
|
8
|
+
Requires-Dist: bosa-core-binary>=0.7.3
|
|
9
9
|
Requires-Dist: gllm-core-binary>=0.3.0
|
|
10
10
|
Requires-Dist: gllm-inference-binary>=0.4.0
|
|
11
11
|
Requires-Dist: gllm-pipeline-binary>=0.4.0
|
|
@@ -9,6 +9,7 @@ glchat_plugin/pipeline/base_pipeline_preset_config.py,sha256=2DxJlroZ_tvVO6DYo1R
|
|
|
9
9
|
glchat_plugin/pipeline/pipeline_handler.py,sha256=vDvIPI7Y39K_DI3jvQZsXC9YzQLUI4TuC-boyasdey8,24405
|
|
10
10
|
glchat_plugin/pipeline/pipeline_plugin.py,sha256=1i7w7WepM5gON4Kx10SjL7NV7-SYVAmRE1EW2m_dOYg,4028
|
|
11
11
|
glchat_plugin/service/__init__.py,sha256=9T4qzyYL052qLqva5el1F575OTRNaaf9tb9UvW-leTc,47
|
|
12
|
+
glchat_plugin/service/base_rate_limiter_service.py,sha256=ndm97wTdro4MQaOQW720Z2j9f6V7aWpL9DkuUV4a4PA,1399
|
|
12
13
|
glchat_plugin/service/base_tenant_service.py,sha256=CB-jJWXi87nTcjO1XhPoSgNMf2YA_LfXoHr30ye0VtI,734
|
|
13
14
|
glchat_plugin/service/base_user_service.py,sha256=qnRKl2u1xhGc4wMaOd_h_mAuxM7GduyDbqebj-k3GDE,2211
|
|
14
15
|
glchat_plugin/storage/__init__.py,sha256=VNO7ua2yAOLzXwe6H6zDZz9yXbhQfKqNJzxE3G8IyfA,50
|
|
@@ -16,7 +17,7 @@ glchat_plugin/storage/base_anonymizer_storage.py,sha256=oFwovWrsjM7v1YjeN-4p-M3O
|
|
|
16
17
|
glchat_plugin/storage/base_chat_history_storage.py,sha256=JvUUFMu_9jRBQ9yug_x7S4rQjZEA1vM5ombDvz-7zCE,11095
|
|
17
18
|
glchat_plugin/tools/__init__.py,sha256=OFotHbgQ8mZEbdlvlv5aVMdxfubPvkVWAcTwhIPdIqQ,542
|
|
18
19
|
glchat_plugin/tools/decorators.py,sha256=AvQBV18wzXWdC483RSSmpfh92zsqTyp8SzDLIkreIGU,3925
|
|
19
|
-
glchat_plugin-0.2.
|
|
20
|
-
glchat_plugin-0.2.
|
|
21
|
-
glchat_plugin-0.2.
|
|
22
|
-
glchat_plugin-0.2.
|
|
20
|
+
glchat_plugin-0.2.4.dist-info/METADATA,sha256=BZLbz7i8foo489j0yIbc8tS0fUhbcHJIEeXtmlTzPiY,2063
|
|
21
|
+
glchat_plugin-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
glchat_plugin-0.2.4.dist-info/top_level.txt,sha256=fzKSXmct5dY4CAKku4-mkdHX-QPAyQVvo8vpQj8qizY,14
|
|
23
|
+
glchat_plugin-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|