igbot-base 0.0.10__py3-none-any.whl → 0.0.11__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.
- igbot_base/agent.py +8 -1
- igbot_base/exception/agent_exception.py +14 -0
- igbot_base/exception/base_exception.py +12 -0
- igbot_base/exception/llm_exception.py +13 -0
- igbot_base/exception/memory_exception.py +14 -0
- igbot_base/exception/prompt_exception.py +14 -0
- igbot_base/exception/retriever_exception.py +14 -0
- igbot_base/exception/tool_exception.py +14 -0
- igbot_base/llm.py +4 -0
- igbot_base/llmmemory.py +7 -0
- igbot_base/prompt_template.py +3 -0
- igbot_base/retriever.py +7 -0
- igbot_base/tool.py +7 -0
- {igbot_base-0.0.10.dist-info → igbot_base-0.0.11.dist-info}/METADATA +1 -1
- igbot_base-0.0.11.dist-info/RECORD +25 -0
- igbot_base-0.0.10.dist-info/RECORD +0 -18
- {igbot_base-0.0.10.dist-info → igbot_base-0.0.11.dist-info}/WHEEL +0 -0
- {igbot_base-0.0.10.dist-info → igbot_base-0.0.11.dist-info}/top_level.txt +0 -0
igbot_base/agent.py
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
from igbot_base.agent import Agent
|
2
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
3
|
+
|
4
|
+
|
5
|
+
class BaseAgentException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, agent: Agent, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.agent = agent
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at agent {self.agent}"
|
14
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class IgBotBaseException(Exception):
|
2
|
+
|
3
|
+
def __init__(self, message, cause: Exception = None):
|
4
|
+
super().__init__(message)
|
5
|
+
self.cause = cause
|
6
|
+
|
7
|
+
def __str__(self):
|
8
|
+
result = self.args[0]
|
9
|
+
if self.cause:
|
10
|
+
result += f" Caused by: {self.cause}"
|
11
|
+
|
12
|
+
return result
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
2
|
+
from igbot_base.llm import Llm
|
3
|
+
|
4
|
+
|
5
|
+
class BaseLlmException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, llm: Llm, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.llm = llm
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at llm {self.llm}"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
2
|
+
from igbot_base.llmmemory import LlmMemory
|
3
|
+
|
4
|
+
|
5
|
+
class BaseMemoryException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, memory: LlmMemory, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.memory = memory
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at memory {self.memory}"
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
2
|
+
from igbot_base.prompt_template import Prompt
|
3
|
+
|
4
|
+
|
5
|
+
class BasePromptException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, prompt: Prompt, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.prompt = prompt
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at prompt {self.prompt}"
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
2
|
+
from igbot_base.retriever import Retriever
|
3
|
+
|
4
|
+
|
5
|
+
class BaseRetrieverException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, retriever: Retriever, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.retriever = retriever
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at retriever {self.retriever}"
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from igbot_base.exception.base_exception import IgBotBaseException
|
2
|
+
from igbot_base.tool import Tool
|
3
|
+
|
4
|
+
|
5
|
+
class BaseToolException(IgBotBaseException):
|
6
|
+
|
7
|
+
def __init__(self, message, tool: Tool, cause: Exception = None):
|
8
|
+
super().__init__(message, cause)
|
9
|
+
self.tool = tool
|
10
|
+
|
11
|
+
def __str__(self):
|
12
|
+
result = super().__str__()
|
13
|
+
result += f" at tool {self.tool}"
|
14
|
+
|
igbot_base/llm.py
CHANGED
@@ -25,6 +25,9 @@ class Llm(ABC):
|
|
25
25
|
self._format = response_format
|
26
26
|
self._exception_handler = llm_exception_handler
|
27
27
|
|
28
|
+
def __str__(self):
|
29
|
+
return f"Llm({self._name} {self._model.get_name()})"
|
30
|
+
|
28
31
|
@abstractmethod
|
29
32
|
def _call(self, user_query: str, history: LlmMemory, params: dict) -> str:
|
30
33
|
pass
|
@@ -52,3 +55,4 @@ class Llm(ABC):
|
|
52
55
|
args["response_format"] = self._format
|
53
56
|
|
54
57
|
return args
|
58
|
+
|
igbot_base/llmmemory.py
CHANGED
igbot_base/prompt_template.py
CHANGED
@@ -18,6 +18,9 @@ class Prompt:
|
|
18
18
|
self.__variables = variables
|
19
19
|
self.__exception_handler = exception_handler
|
20
20
|
|
21
|
+
def __str__(self):
|
22
|
+
return f"Prompt({self.__get_content_short()} ({",".join(self.__variables)}))"
|
23
|
+
|
21
24
|
@staticmethod
|
22
25
|
def replace_placeholders(text: str, values: dict) -> str:
|
23
26
|
def replacer(match):
|
igbot_base/retriever.py
CHANGED
igbot_base/tool.py
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
igbot_base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
igbot_base/agent.py,sha256=xU1jDgoyfXfSJlXcdLl1Va7BX-Z5QLXz4ZpjOuz2z9M,301
|
3
|
+
igbot_base/agent_response.py,sha256=eAps47djL_aWYn8P_BMpVGkPwO6m8nhltWWyh8qSG6E,1042
|
4
|
+
igbot_base/exception_handler.py,sha256=BMzQpgP4jnnRuTcEItx0oMljTZmKgMRCHzpybHn88Ig,341
|
5
|
+
igbot_base/llm.py,sha256=xwd-AyMXYtzIlGV9Hcshof_h84R_n5vcT57tjcCDI10,1913
|
6
|
+
igbot_base/llmmemory.py,sha256=I6eSBPW1DK8UNiHhayon-DLbSbWSinO_EwM5S8C3tHA,1090
|
7
|
+
igbot_base/logging_adapter.py,sha256=kMuAaQPCba2luk0-WPxAbPNJaBL1yZsaff35ltKWgww,256
|
8
|
+
igbot_base/models.py,sha256=15bitUZy4Z4JhZbLd_SMx5pD7m8YuZiIq-wYGumf0ws,622
|
9
|
+
igbot_base/persistable_memory.py,sha256=867Z4l_awD23QSTFDK3uN9TEttKfDpxx9g19c7ULG1Y,167
|
10
|
+
igbot_base/prompt_template.py,sha256=q7bnU2Rp2Cvm4ixEmKHCyuolTPan6CHfYVAomT5kp10,1573
|
11
|
+
igbot_base/response_formats.py,sha256=Sp679VfkcyxsR19ddFEHTOM7Ox0u2WBhdji_Y9pVc2M,94
|
12
|
+
igbot_base/retriever.py,sha256=YHBHxiuPttsIAtjwwIz0fa9q2uFtsg0WoMRCorCt1PM,635
|
13
|
+
igbot_base/tool.py,sha256=ghjuU3cK_VElHGStUl3IYf9dlRDOGM_aQucUQNUH3mU,431
|
14
|
+
igbot_base/vectorstore.py,sha256=f-S9DmOuehC0rtVAPGz22Guo7ddb1jVw7BygzFJM624,928
|
15
|
+
igbot_base/exception/agent_exception.py,sha256=qDnVYMpzaiwkhO4QI-zasySFewoA7T9ee2XIe-0E-DI,395
|
16
|
+
igbot_base/exception/base_exception.py,sha256=Hlu_hNRW4Krx41CdUtYYaxI4VknKUw1Bs1stpm2XFTY,307
|
17
|
+
igbot_base/exception/llm_exception.py,sha256=54oAekBvzjL6x_JckqbY34m54EAh3GKRAwJJQ8ZjkvQ,377
|
18
|
+
igbot_base/exception/memory_exception.py,sha256=ZGKw3dN2tMf9XHacYaVTXgvYpWi14z7unJBFjrEUVyM,413
|
19
|
+
igbot_base/exception/prompt_exception.py,sha256=_u-O9E2Z1DK_OT4StyOmIDLfr_Mmk4k0GLe67kIoQNc,413
|
20
|
+
igbot_base/exception/retriever_exception.py,sha256=A46sBV6_1N3jgBl-nFRw4KgEcz3oPb8d5Eb83YWDEPo,431
|
21
|
+
igbot_base/exception/tool_exception.py,sha256=1EX7R90MplT4Vqv1-zzPslFrNvDwcrh7wgEWun2Ba6k,386
|
22
|
+
igbot_base-0.0.11.dist-info/METADATA,sha256=qRbglwrx7br3mjX0RH6I_KjsJ-lyR6dxOL4I7ECvtTo,211
|
23
|
+
igbot_base-0.0.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
24
|
+
igbot_base-0.0.11.dist-info/top_level.txt,sha256=RGpEN0pLsnfNLoLfpw1D_nLSyZwi3ggSaDq07o4ZEAI,11
|
25
|
+
igbot_base-0.0.11.dist-info/RECORD,,
|
@@ -1,18 +0,0 @@
|
|
1
|
-
igbot_base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
igbot_base/agent.py,sha256=186kf599wrK4z41RVddeh0dH_iJ-_fCTqxM7J00P8IE,188
|
3
|
-
igbot_base/agent_response.py,sha256=eAps47djL_aWYn8P_BMpVGkPwO6m8nhltWWyh8qSG6E,1042
|
4
|
-
igbot_base/exception_handler.py,sha256=BMzQpgP4jnnRuTcEItx0oMljTZmKgMRCHzpybHn88Ig,341
|
5
|
-
igbot_base/llm.py,sha256=Tuj8DJtHIDnG0ebbcQfeWHV0rheI-5MvfW3Vi-yytrA,1827
|
6
|
-
igbot_base/llmmemory.py,sha256=KslOeTSZwvHVyFglbFhPcb6_GCCXZOqHz5YBTzJ2mew,977
|
7
|
-
igbot_base/logging_adapter.py,sha256=kMuAaQPCba2luk0-WPxAbPNJaBL1yZsaff35ltKWgww,256
|
8
|
-
igbot_base/models.py,sha256=15bitUZy4Z4JhZbLd_SMx5pD7m8YuZiIq-wYGumf0ws,622
|
9
|
-
igbot_base/persistable_memory.py,sha256=867Z4l_awD23QSTFDK3uN9TEttKfDpxx9g19c7ULG1Y,167
|
10
|
-
igbot_base/prompt_template.py,sha256=hw5oZDYRpjllso8J0TYf9MrsppnqkSfwBpuMIu9e6OU,1463
|
11
|
-
igbot_base/response_formats.py,sha256=Sp679VfkcyxsR19ddFEHTOM7Ox0u2WBhdji_Y9pVc2M,94
|
12
|
-
igbot_base/retriever.py,sha256=TeHWi6Sy5EvmmXOnNXuWLJO1Imlj0i6CEihv3WVN0SI,523
|
13
|
-
igbot_base/tool.py,sha256=8QwzQuokkVSITCjZuZJeEbCvJU-n2yh9D-QauQex4Ko,319
|
14
|
-
igbot_base/vectorstore.py,sha256=f-S9DmOuehC0rtVAPGz22Guo7ddb1jVw7BygzFJM624,928
|
15
|
-
igbot_base-0.0.10.dist-info/METADATA,sha256=klA4DKfpsEshdzy5MAIwyLpGnYYwN4nJqb0bIp47oG4,211
|
16
|
-
igbot_base-0.0.10.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
17
|
-
igbot_base-0.0.10.dist-info/top_level.txt,sha256=RGpEN0pLsnfNLoLfpw1D_nLSyZwi3ggSaDq07o4ZEAI,11
|
18
|
-
igbot_base-0.0.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|