igbot-base 0.0.17__tar.gz → 0.0.19__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.
- {igbot_base-0.0.17 → igbot_base-0.0.19}/PKG-INFO +1 -1
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/agent.py +4 -3
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/agent_response.py +0 -1
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/base_exception.py +13 -18
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base.egg-info/PKG-INFO +1 -1
- {igbot_base-0.0.17 → igbot_base-0.0.19}/pyproject.toml +1 -1
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/__init__.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/exception_handler.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/llm.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/llmmemory.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/logging_adapter.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/models.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/persistable_memory.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/prompt_template.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/response_formats.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/retriever.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/tool.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base/vectorstore.py +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base.egg-info/SOURCES.txt +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base.egg-info/dependency_links.txt +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base.egg-info/requires.txt +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/igbot_base.egg-info/top_level.txt +0 -0
- {igbot_base-0.0.17 → igbot_base-0.0.19}/setup.cfg +0 -0
@@ -4,6 +4,7 @@ from igbot_base.agent_response import AgentResponse
|
|
4
4
|
|
5
5
|
from igbot_base.exception_handler import ExceptionHandler, ReturnFailedResponseGracefully
|
6
6
|
from igbot_base.logging_adapter import get_logger
|
7
|
+
from llmmemory import LlmMemory
|
7
8
|
|
8
9
|
logger = get_logger("application")
|
9
10
|
|
@@ -14,15 +15,15 @@ class Agent(ABC):
|
|
14
15
|
self.__name = name
|
15
16
|
self.__ex_handler = exception_handler
|
16
17
|
|
17
|
-
def invoke(self, query) -> AgentResponse:
|
18
|
+
def invoke(self, query, memory: LlmMemory) -> AgentResponse:
|
18
19
|
try:
|
19
|
-
return self._invoke(query)
|
20
|
+
return self._invoke(query, memory)
|
20
21
|
except Exception as e:
|
21
22
|
logger.exception("Exception occurred at %s for query %s: %s", self.describe(), query, e)
|
22
23
|
return self.__ex_handler.handle(e)
|
23
24
|
|
24
25
|
@abstractmethod
|
25
|
-
def _invoke(self, query) -> AgentResponse:
|
26
|
+
def _invoke(self, query, memory: LlmMemory) -> AgentResponse:
|
26
27
|
pass
|
27
28
|
|
28
29
|
@abstractmethod
|
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
from igbot_base.llm import Llm
|
3
|
-
from igbot_base.llmmemory import LlmMemory
|
4
|
-
from igbot_base.prompt_template import Prompt
|
5
|
-
from igbot_base.retriever import Retriever
|
6
|
-
from igbot_base.tool import Tool
|
1
|
+
|
7
2
|
|
8
3
|
|
9
4
|
class IgBotBaseException(Exception):
|
@@ -22,9 +17,9 @@ class IgBotBaseException(Exception):
|
|
22
17
|
|
23
18
|
class BaseAgentException(IgBotBaseException):
|
24
19
|
|
25
|
-
def __init__(self, message, agent:
|
20
|
+
def __init__(self, message, agent: object, cause: Exception = None):
|
26
21
|
super().__init__(message, cause)
|
27
|
-
self.agent = agent
|
22
|
+
self.agent = agent.__str__()
|
28
23
|
|
29
24
|
def __str__(self):
|
30
25
|
result = super().__str__()
|
@@ -33,9 +28,9 @@ class BaseAgentException(IgBotBaseException):
|
|
33
28
|
|
34
29
|
class BaseLlmException(IgBotBaseException):
|
35
30
|
|
36
|
-
def __init__(self, message, llm:
|
31
|
+
def __init__(self, message, llm: object, cause: Exception = None):
|
37
32
|
super().__init__(message, cause)
|
38
|
-
self.llm = llm
|
33
|
+
self.llm = llm.__str__()
|
39
34
|
|
40
35
|
def __str__(self):
|
41
36
|
result = super().__str__()
|
@@ -44,9 +39,9 @@ class BaseLlmException(IgBotBaseException):
|
|
44
39
|
|
45
40
|
class BaseMemoryException(IgBotBaseException):
|
46
41
|
|
47
|
-
def __init__(self, message, memory:
|
42
|
+
def __init__(self, message, memory: object, cause: Exception = None):
|
48
43
|
super().__init__(message, cause)
|
49
|
-
self.memory = memory
|
44
|
+
self.memory = memory.__str__()
|
50
45
|
|
51
46
|
def __str__(self):
|
52
47
|
result = super().__str__()
|
@@ -55,9 +50,9 @@ class BaseMemoryException(IgBotBaseException):
|
|
55
50
|
|
56
51
|
class BasePromptException(IgBotBaseException):
|
57
52
|
|
58
|
-
def __init__(self, message, prompt:
|
53
|
+
def __init__(self, message, prompt: object, cause: Exception = None):
|
59
54
|
super().__init__(message, cause)
|
60
|
-
self.prompt = prompt
|
55
|
+
self.prompt = prompt.__str__()
|
61
56
|
|
62
57
|
def __str__(self):
|
63
58
|
result = super().__str__()
|
@@ -66,9 +61,9 @@ class BasePromptException(IgBotBaseException):
|
|
66
61
|
|
67
62
|
class BaseRetrieverException(IgBotBaseException):
|
68
63
|
|
69
|
-
def __init__(self, message, retriever:
|
64
|
+
def __init__(self, message, retriever: object, cause: Exception = None):
|
70
65
|
super().__init__(message, cause)
|
71
|
-
self.retriever = retriever
|
66
|
+
self.retriever = retriever.__str__()
|
72
67
|
|
73
68
|
def __str__(self):
|
74
69
|
result = super().__str__()
|
@@ -77,9 +72,9 @@ class BaseRetrieverException(IgBotBaseException):
|
|
77
72
|
|
78
73
|
class BaseToolException(IgBotBaseException):
|
79
74
|
|
80
|
-
def __init__(self, message, tool:
|
75
|
+
def __init__(self, message, tool: object, cause: Exception = None):
|
81
76
|
super().__init__(message, cause)
|
82
|
-
self.tool = tool
|
77
|
+
self.tool = tool.__str__()
|
83
78
|
|
84
79
|
def __str__(self):
|
85
80
|
result = super().__str__()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|