mojentic 0.5.5__tar.gz → 0.5.7__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 (126) hide show
  1. {mojentic-0.5.5/src/mojentic.egg-info → mojentic-0.5.7}/PKG-INFO +1 -1
  2. {mojentic-0.5.5 → mojentic-0.5.7}/pyproject.toml +1 -1
  3. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/models.py +29 -1
  4. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/llm_tool.py +15 -0
  5. mojentic-0.5.7/src/mojentic/llm/tools/llm_tool_spec.py +76 -0
  6. {mojentic-0.5.5 → mojentic-0.5.7/src/mojentic.egg-info}/PKG-INFO +1 -1
  7. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic.egg-info/SOURCES.txt +1 -0
  8. {mojentic-0.5.5 → mojentic-0.5.7}/LICENSE.md +0 -0
  9. {mojentic-0.5.5 → mojentic-0.5.7}/README.md +0 -0
  10. {mojentic-0.5.5 → mojentic-0.5.7}/setup.cfg +0 -0
  11. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/__init__.py +0 -0
  12. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/broker_as_tool.py +0 -0
  13. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/broker_examples.py +0 -0
  14. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/broker_image_examples.py +0 -0
  15. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/characterize_ollama.py +0 -0
  16. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/characterize_openai.py +0 -0
  17. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/chat_session.py +0 -0
  18. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/chat_session_with_tool.py +0 -0
  19. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/coding_file_tool.py +0 -0
  20. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/current_datetime_tool_example.py +0 -0
  21. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/design_analysis.py +0 -0
  22. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/embeddings.py +0 -0
  23. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/ensures_files_exist.py +0 -0
  24. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/ephemeral_task_manager_example.py +0 -0
  25. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/file_deduplication.py +0 -0
  26. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/file_tool.py +0 -0
  27. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/image_analysis.py +0 -0
  28. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/image_broker.py +0 -0
  29. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/image_broker_splat.py +0 -0
  30. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/iterative_solver.py +0 -0
  31. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/list_models.py +0 -0
  32. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/oversized_embeddings.py +0 -0
  33. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/raw.py +0 -0
  34. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/__init__.py +0 -0
  35. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/agents/__init__.py +0 -0
  36. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/agents/decisioning_agent.py +0 -0
  37. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/agents/thinking_agent.py +0 -0
  38. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/formatters.py +0 -0
  39. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/models/__init__.py +0 -0
  40. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/models/base.py +0 -0
  41. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react/models/events.py +0 -0
  42. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/react.py +0 -0
  43. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/recursive_agent.py +0 -0
  44. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/routed_send_response.py +0 -0
  45. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/simple_llm.py +0 -0
  46. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/simple_llm_repl.py +0 -0
  47. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/simple_structured.py +0 -0
  48. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/simple_tool.py +0 -0
  49. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/solver_chat_session.py +0 -0
  50. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/streaming.py +0 -0
  51. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/tell_user_example.py +0 -0
  52. {mojentic-0.5.5 → mojentic-0.5.7}/src/_examples/working_memory.py +0 -0
  53. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/__init__.py +0 -0
  54. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/__init__.py +0 -0
  55. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/agent_broker.py +0 -0
  56. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/base_agent.py +0 -0
  57. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/base_llm_agent.py +0 -0
  58. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/base_llm_agent_spec.py +0 -0
  59. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/correlation_aggregator_agent.py +0 -0
  60. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/iterative_problem_solver.py +0 -0
  61. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/output_agent.py +0 -0
  62. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/agents/simple_recursive_agent.py +0 -0
  63. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/audit/event_store.py +0 -0
  64. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/audit/event_store_spec.py +0 -0
  65. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/context/__init__.py +0 -0
  66. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/context/shared_working_memory.py +0 -0
  67. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/dispatcher.py +0 -0
  68. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/event.py +0 -0
  69. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/__init__.py +0 -0
  70. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/chat_session.py +0 -0
  71. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/chat_session_spec.py +0 -0
  72. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/__init__.py +0 -0
  73. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/anthropic.py +0 -0
  74. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/anthropic_messages_adapter.py +0 -0
  75. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/embeddings_gateway.py +0 -0
  76. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/file_gateway.py +0 -0
  77. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/llm_gateway.py +0 -0
  78. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/ollama.py +0 -0
  79. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/ollama_messages_adapter.py +0 -0
  80. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/ollama_messages_adapter_spec.py +0 -0
  81. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/openai.py +0 -0
  82. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/openai_message_adapter_spec.py +0 -0
  83. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/openai_messages_adapter.py +0 -0
  84. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/gateways/tokenizer_gateway.py +0 -0
  85. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/llm_broker.py +0 -0
  86. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/llm_broker_spec.py +0 -0
  87. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/message_composers.py +0 -0
  88. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/message_composers_spec.py +0 -0
  89. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/registry/__init__.py +0 -0
  90. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/registry/llm_registry.py +0 -0
  91. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/registry/models.py +0 -0
  92. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/registry/populate_registry_from_ollama.py +0 -0
  93. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/__init__.py +0 -0
  94. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ask_user_tool.py +0 -0
  95. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/current_datetime.py +0 -0
  96. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/date_resolver.py +0 -0
  97. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/date_resolver_spec.py +0 -0
  98. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/__init__.py +0 -0
  99. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/append_task_tool.py +0 -0
  100. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/append_task_tool_spec.py +0 -0
  101. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/clear_tasks_tool.py +0 -0
  102. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/clear_tasks_tool_spec.py +0 -0
  103. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/complete_task_tool.py +0 -0
  104. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/complete_task_tool_spec.py +0 -0
  105. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/ephemeral_task_list.py +0 -0
  106. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/ephemeral_task_list_spec.py +0 -0
  107. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/insert_task_after_tool.py +0 -0
  108. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/insert_task_after_tool_spec.py +0 -0
  109. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/list_tasks_tool.py +0 -0
  110. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/list_tasks_tool_spec.py +0 -0
  111. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/prepend_task_tool.py +0 -0
  112. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/prepend_task_tool_spec.py +0 -0
  113. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/start_task_tool.py +0 -0
  114. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/ephemeral_task_manager/start_task_tool_spec.py +0 -0
  115. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/file_manager.py +0 -0
  116. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/organic_web_search.py +0 -0
  117. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/tell_user_tool.py +0 -0
  118. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/tool_wrapper.py +0 -0
  119. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/llm/tools/tool_wrapper_spec.py +0 -0
  120. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/router.py +0 -0
  121. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/router_spec.py +0 -0
  122. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/utils/__init__.py +0 -0
  123. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic/utils/formatting.py +0 -0
  124. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic.egg-info/dependency_links.txt +0 -0
  125. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic.egg-info/requires.txt +0 -0
  126. {mojentic-0.5.5 → mojentic-0.5.7}/src/mojentic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mojentic
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Mojentic is an agentic framework that aims to provide a simple and flexible way to assemble teams of agents to solve complex problems.
5
5
  Author-email: Stacey Vetzal <stacey@vetzal.com>
6
6
  Project-URL: Homepage, https://github.com/mojility/mojentic
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mojentic"
3
- version = "0.5.5"
3
+ version = "0.5.7"
4
4
  authors = [
5
5
  { name = "Stacey Vetzal", email = "stacey@vetzal.com" },
6
6
  ]
@@ -1,5 +1,5 @@
1
1
  from enum import Enum
2
- from typing import Optional, List, Union, Type
2
+ from typing import Optional, List, Union, Annotated, Literal
3
3
 
4
4
  from pydantic import BaseModel, Field
5
5
 
@@ -14,6 +14,34 @@ class MessageRole(Enum):
14
14
  Tool = 'tool'
15
15
 
16
16
 
17
+ class Annotations(BaseModel):
18
+ audience: list[MessageRole] | None = None
19
+ priority: Annotated[float, Field(ge=0.0, le=1.0)] | None = None
20
+
21
+
22
+ class TextContent(BaseModel):
23
+ """Text content for a message."""
24
+
25
+ type: Literal["text"]
26
+ text: str
27
+ """The text content of the message."""
28
+ annotations: Annotations | None = None
29
+
30
+
31
+ class ImageContent(BaseModel):
32
+ """Image content for a message."""
33
+
34
+ type: Literal["image"]
35
+ data: str
36
+ """The base64-encoded image data."""
37
+ mimeType: str
38
+ """
39
+ The MIME type of the image. Different providers may support different
40
+ image types.
41
+ """
42
+ annotations: Annotations | None = None
43
+
44
+
17
45
  class LLMToolCall(BaseModel):
18
46
  """
19
47
  A tool call to be made available to the LLM.
@@ -1,7 +1,22 @@
1
+ import json
2
+
3
+ from mojentic.llm.gateways.models import TextContent
4
+
5
+
1
6
  class LLMTool:
2
7
  def run(self, **kwargs):
3
8
  raise NotImplementedError
4
9
 
10
+ def call_tool(self, **kwargs):
11
+ result = self.run(**kwargs)
12
+ if isinstance(result, dict):
13
+ result = json.dumps(result)
14
+ return {
15
+ "content": [
16
+ TextContent(type="text", text=result).model_dump(),
17
+ ]
18
+ }
19
+
5
20
  @property
6
21
  def descriptor(self):
7
22
  raise NotImplementedError
@@ -0,0 +1,76 @@
1
+ import json
2
+ from unittest.mock import Mock
3
+
4
+ import pytest
5
+
6
+ from mojentic.llm.gateways.models import TextContent
7
+ from mojentic.llm.tools.llm_tool import LLMTool
8
+
9
+
10
+ class MockLLMTool(LLMTool):
11
+ """A mock implementation of LLMTool for testing purposes."""
12
+
13
+ def __init__(self, run_result=None):
14
+ self._run_result = run_result
15
+ self._descriptor = {
16
+ "function": {
17
+ "name": "mock_tool",
18
+ "description": "A mock tool for testing"
19
+ }
20
+ }
21
+
22
+ def run(self, **kwargs):
23
+ return self._run_result
24
+
25
+ @property
26
+ def descriptor(self):
27
+ return self._descriptor
28
+
29
+
30
+ @pytest.fixture
31
+ def mock_tool_with_dict_result():
32
+ return MockLLMTool(run_result={"key": "value"})
33
+
34
+
35
+ @pytest.fixture
36
+ def mock_tool_with_string_result():
37
+ return MockLLMTool(run_result="test result")
38
+
39
+
40
+ class DescribeLLMTool:
41
+ class DescribeCallTool:
42
+
43
+ def should_convert_dict_result_to_json_string(self, mock_tool_with_dict_result):
44
+ result = mock_tool_with_dict_result.call_tool()
45
+
46
+ assert result == {
47
+ "content": [
48
+ {
49
+ "type": "text",
50
+ "text": '{"key": "value"}',
51
+ "annotations": None
52
+ }
53
+ ]
54
+ }
55
+
56
+ def should_handle_string_result_directly(self, mock_tool_with_string_result):
57
+ result = mock_tool_with_string_result.call_tool()
58
+
59
+ assert result == {
60
+ "content": [
61
+ {
62
+ "type": "text",
63
+ "text": "test result",
64
+ "annotations": None
65
+ }
66
+ ]
67
+ }
68
+
69
+ def should_pass_kwargs_to_run_method(self):
70
+ mock_run = Mock(return_value="test result")
71
+ tool = MockLLMTool()
72
+ tool.run = mock_run
73
+
74
+ tool.call_tool(param1="value1", param2="value2")
75
+
76
+ mock_run.assert_called_once_with(param1="value1", param2="value2")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mojentic
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Mojentic is an agentic framework that aims to provide a simple and flexible way to assemble teams of agents to solve complex problems.
5
5
  Author-email: Stacey Vetzal <stacey@vetzal.com>
6
6
  Project-URL: Homepage, https://github.com/mojility/mojentic
@@ -99,6 +99,7 @@ src/mojentic/llm/tools/date_resolver.py
99
99
  src/mojentic/llm/tools/date_resolver_spec.py
100
100
  src/mojentic/llm/tools/file_manager.py
101
101
  src/mojentic/llm/tools/llm_tool.py
102
+ src/mojentic/llm/tools/llm_tool_spec.py
102
103
  src/mojentic/llm/tools/organic_web_search.py
103
104
  src/mojentic/llm/tools/tell_user_tool.py
104
105
  src/mojentic/llm/tools/tool_wrapper.py
File without changes
File without changes
File without changes
File without changes
File without changes