igbot-base 0.0.36__tar.gz → 0.0.38__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.
Files changed (26) hide show
  1. {igbot_base-0.0.36 → igbot_base-0.0.38}/PKG-INFO +1 -1
  2. igbot_base-0.0.38/igbot_base/additional_data.py +17 -0
  3. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/agent.py +2 -1
  4. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/llm.py +2 -1
  5. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base.egg-info/PKG-INFO +1 -1
  6. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base.egg-info/SOURCES.txt +1 -0
  7. {igbot_base-0.0.36 → igbot_base-0.0.38}/pyproject.toml +1 -1
  8. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/__init__.py +0 -0
  9. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/agent_response.py +0 -0
  10. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/base_exception.py +0 -0
  11. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/exception_handler.py +0 -0
  12. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/llmmemory.py +0 -0
  13. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/logging_adapter.py +0 -0
  14. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/models.py +0 -0
  15. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/notifier.py +0 -0
  16. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/persistable_memory.py +0 -0
  17. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/prompt_template.py +0 -0
  18. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/response_formats.py +0 -0
  19. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/retriever.py +0 -0
  20. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/tokenizer.py +0 -0
  21. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/tool.py +0 -0
  22. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base/vectorstore.py +0 -0
  23. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base.egg-info/dependency_links.txt +0 -0
  24. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base.egg-info/requires.txt +0 -0
  25. {igbot_base-0.0.36 → igbot_base-0.0.38}/igbot_base.egg-info/top_level.txt +0 -0
  26. {igbot_base-0.0.36 → igbot_base-0.0.38}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: igbot_base
3
- Version: 0.0.36
3
+ Version: 0.0.38
4
4
  Summary: Base classes for igbot
5
5
  Author-email: Igor Kopeć <igor.kopec95@gmail.com>
6
6
  License: LGPL-3.0-or-later
@@ -0,0 +1,17 @@
1
+ from pydantic.v1 import BaseModel
2
+ from typing import Any, Dict, Optional
3
+
4
+ class AdditionalData(BaseModel):
5
+ data: Dict[str, Any]
6
+
7
+ def get(self, key: str) -> Optional[Any]:
8
+ """
9
+ Get the value associated with the key, or return None if the key doesn't exist.
10
+
11
+ :param key: The key to look for in the dictionary.
12
+ :return: The value associated with the key, or None.
13
+ """
14
+ return self.data.get(key)
15
+
16
+
17
+ EMPTY = AdditionalData(data={})
@@ -1,5 +1,6 @@
1
1
  from abc import ABC, abstractmethod
2
2
 
3
+ from igbot_base.additional_data import AdditionalData, EMPTY
3
4
  from igbot_base.agent_response import AgentResponse
4
5
 
5
6
  from igbot_base.exception_handler import ExceptionHandler, ReturnFailedResponseGracefully
@@ -30,7 +31,7 @@ class Agent(ABC):
30
31
  return self.__ex_handler.handle(e)
31
32
 
32
33
  @abstractmethod
33
- def _invoke(self, query, memory: LlmMemory) -> AgentResponse:
34
+ def _invoke(self, query, memory: LlmMemory, params: AdditionalData = EMPTY) -> AgentResponse:
34
35
  pass
35
36
 
36
37
  @abstractmethod
@@ -2,6 +2,7 @@ from abc import ABC, abstractmethod
2
2
  from builtins import dict
3
3
  from typing import Optional
4
4
 
5
+ from igbot_base.additional_data import AdditionalData, EMPTY
5
6
  from igbot_base.exception_handler import ExceptionHandler, NoopExceptionHandler
6
7
  from igbot_base.llmmemory import LlmMemory
7
8
  from igbot_base.models import Model
@@ -31,7 +32,7 @@ class Llm(ABC):
31
32
  return f"Llm({self._name} {self._model.value.get_name()})"
32
33
 
33
34
  @abstractmethod
34
- def _call(self, user_query: str, history: LlmMemory, params: dict) -> str:
35
+ def _call(self, user_query: str, history: LlmMemory, params: dict, additonal_data: AdditionalData = EMPTY) -> str:
35
36
  pass
36
37
 
37
38
  @abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: igbot_base
3
- Version: 0.0.36
3
+ Version: 0.0.38
4
4
  Summary: Base classes for igbot
5
5
  Author-email: Igor Kopeć <igor.kopec95@gmail.com>
6
6
  License: LGPL-3.0-or-later
@@ -1,5 +1,6 @@
1
1
  pyproject.toml
2
2
  igbot_base/__init__.py
3
+ igbot_base/additional_data.py
3
4
  igbot_base/agent.py
4
5
  igbot_base/agent_response.py
5
6
  igbot_base/base_exception.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "igbot_base"
7
- version = "0.0.36"
7
+ version = "0.0.38"
8
8
  description = "Base classes for igbot"
9
9
  authors = [{name = "Igor Kopeć", email = "igor.kopec95@gmail.com"}]
10
10
  license={text="LGPL-3.0-or-later"}
File without changes