chuk-tool-processor 0.6.12__tar.gz → 0.6.14__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.

Potentially problematic release.


This version of chuk-tool-processor might be problematic. Click here for more details.

Files changed (72) hide show
  1. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/PKG-INFO +1 -1
  2. chuk_tool_processor-0.6.14/pyproject.toml +169 -0
  3. chuk_tool_processor-0.6.14/src/chuk_tool_processor/core/__init__.py +1 -0
  4. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/core/exceptions.py +10 -4
  5. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/core/processor.py +97 -97
  6. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/strategies/inprocess_strategy.py +142 -150
  7. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/strategies/subprocess_strategy.py +200 -205
  8. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/tool_executor.py +82 -84
  9. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/wrappers/caching.py +102 -103
  10. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/wrappers/rate_limiting.py +45 -42
  11. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/wrappers/retry.py +23 -25
  12. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/logging/__init__.py +23 -17
  13. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/logging/context.py +40 -45
  14. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/logging/formatter.py +22 -21
  15. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/logging/helpers.py +24 -38
  16. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/logging/metrics.py +11 -13
  17. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/__init__.py +8 -12
  18. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/mcp_tool.py +124 -112
  19. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/register_mcp_tools.py +17 -17
  20. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/setup_mcp_http_streamable.py +11 -13
  21. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/setup_mcp_sse.py +11 -13
  22. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/setup_mcp_stdio.py +7 -9
  23. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/stream_manager.py +168 -204
  24. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/transport/__init__.py +4 -4
  25. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/transport/base_transport.py +43 -58
  26. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/transport/http_streamable_transport.py +145 -163
  27. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/transport/sse_transport.py +217 -255
  28. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/mcp/transport/stdio_transport.py +188 -190
  29. chuk_tool_processor-0.6.14/src/chuk_tool_processor/models/__init__.py +1 -0
  30. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/models/execution_strategy.py +16 -21
  31. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/models/streaming_tool.py +28 -25
  32. chuk_tool_processor-0.6.14/src/chuk_tool_processor/models/tool_call.py +44 -0
  33. chuk_tool_processor-0.6.14/src/chuk_tool_processor/models/tool_export_mixin.py +43 -0
  34. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/models/tool_result.py +40 -77
  35. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/models/validated_tool.py +14 -16
  36. chuk_tool_processor-0.6.14/src/chuk_tool_processor/plugins/__init__.py +1 -0
  37. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/discovery.py +10 -10
  38. chuk_tool_processor-0.6.14/src/chuk_tool_processor/plugins/parsers/__init__.py +1 -0
  39. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/parsers/base.py +1 -2
  40. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/parsers/function_call_tool.py +13 -8
  41. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/parsers/json_tool.py +4 -3
  42. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/parsers/openai_tool.py +12 -7
  43. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/plugins/parsers/xml_tool.py +4 -4
  44. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/__init__.py +12 -12
  45. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/auto_register.py +22 -30
  46. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/decorators.py +127 -129
  47. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/interface.py +26 -23
  48. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/metadata.py +27 -22
  49. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/provider.py +17 -18
  50. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/providers/__init__.py +16 -19
  51. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/providers/memory.py +18 -25
  52. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/registry/tool_export.py +42 -51
  53. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/utils/validation.py +15 -16
  54. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor.egg-info/PKG-INFO +1 -1
  55. chuk_tool_processor-0.6.12/pyproject.toml +0 -72
  56. chuk_tool_processor-0.6.12/src/chuk_tool_processor/core/__init__.py +0 -1
  57. chuk_tool_processor-0.6.12/src/chuk_tool_processor/models/__init__.py +0 -1
  58. chuk_tool_processor-0.6.12/src/chuk_tool_processor/models/tool_call.py +0 -59
  59. chuk_tool_processor-0.6.12/src/chuk_tool_processor/models/tool_export_mixin.py +0 -29
  60. chuk_tool_processor-0.6.12/src/chuk_tool_processor/plugins/__init__.py +0 -1
  61. chuk_tool_processor-0.6.12/src/chuk_tool_processor/plugins/parsers/__init__.py +0 -1
  62. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/README.md +0 -0
  63. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/setup.cfg +0 -0
  64. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/__init__.py +0 -0
  65. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/__init__.py +0 -0
  66. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/strategies/__init__.py +0 -0
  67. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/execution/wrappers/__init__.py +0 -0
  68. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor/utils/__init__.py +0 -0
  69. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor.egg-info/SOURCES.txt +0 -0
  70. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor.egg-info/dependency_links.txt +0 -0
  71. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor.egg-info/requires.txt +0 -0
  72. {chuk_tool_processor-0.6.12 → chuk_tool_processor-0.6.14}/src/chuk_tool_processor.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chuk-tool-processor
3
- Version: 0.6.12
3
+ Version: 0.6.14
4
4
  Summary: Async-native framework for registering, discovering, and executing tools referenced in LLM responses
5
5
  Author-email: CHUK Team <chrishayuk@somejunkmailbox.com>
6
6
  Maintainer-email: CHUK Team <chrishayuk@somejunkmailbox.com>
@@ -0,0 +1,169 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "chuk-tool-processor"
7
+ version = "0.6.14"
8
+ description = "Async-native framework for registering, discovering, and executing tools referenced in LLM responses"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "CHUK Team", email = "chrishayuk@somejunkmailbox.com"},
14
+ ]
15
+ maintainers = [
16
+ {name = "CHUK Team", email = "chrishayuk@somejunkmailbox.com"},
17
+ ]
18
+ keywords = [
19
+ "llm",
20
+ "tools",
21
+ "async",
22
+ "ai",
23
+ "openai",
24
+ "mcp",
25
+ "model-context-protocol",
26
+ "tool-calling",
27
+ "function-calling"
28
+ ]
29
+ classifiers = [
30
+ "Development Status :: 4 - Beta",
31
+ "Intended Audience :: Developers",
32
+ "License :: OSI Approved :: MIT License",
33
+ "Operating System :: OS Independent",
34
+ "Programming Language :: Python :: 3",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Programming Language :: Python :: 3.13",
38
+ "Topic :: Software Development :: Libraries :: Python Modules",
39
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
40
+ "Framework :: AsyncIO",
41
+ "Typing :: Typed",
42
+ ]
43
+ dependencies = [
44
+ "chuk-mcp>=0.5.2",
45
+ "dotenv>=0.9.9",
46
+ "psutil>=7.0.0",
47
+ "pydantic>=2.11.3",
48
+ "uuid>=1.30",
49
+ ]
50
+
51
+ # Tell setuptools to look in src/ for your a2a package
52
+ [tool.setuptools.packages.find]
53
+ where = ["src"]
54
+ include = ["chuk_tool_processor*"]
55
+
56
+ # pytest settings so it finds your src/ layout automatically
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
59
+ pythonpath = ["src"]
60
+ addopts = "-v --cov=src --cov-report=term --cov-report=xml --cov-report=html"
61
+ asyncio_default_fixture_loop_scope = "function"
62
+ asyncio_mode = "strict"
63
+ minversion = "8.0"
64
+
65
+ [dependency-groups]
66
+ dev = [
67
+ "pytest-asyncio>=0.26.0",
68
+ "pytest>=8.3.5",
69
+ "pytest-cov>=5.0.0",
70
+ "colorama>=0.4.6",
71
+ "uvicorn>=0.34.2",
72
+ "fastapi>=0.115.12",
73
+ "langchain>=0.3.25",
74
+ "ruff>=0.7.1",
75
+ "mypy>=1.13.0",
76
+ "pre-commit>=3.8.0",
77
+ "coverage[toml]>=7.6.0",
78
+ ]
79
+
80
+ [tool.coverage.run]
81
+ source = ["src"]
82
+ omit = [
83
+ "*/tests/*",
84
+ "*/test_*.py",
85
+ "*/__main__.py",
86
+ "*/sample_tools/*",
87
+ "src/sample_tools/*",
88
+ ]
89
+
90
+ [tool.coverage.report]
91
+ exclude_lines = [
92
+ "pragma: no cover",
93
+ "def __repr__",
94
+ "if self.debug:",
95
+ "if __name__ == .__main__.:",
96
+ "raise AssertionError",
97
+ "raise NotImplementedError",
98
+ "if 0:",
99
+ "if False:",
100
+ "if TYPE_CHECKING:",
101
+ ]
102
+ skip_covered = false
103
+ show_missing = true
104
+ precision = 2
105
+ omit = [
106
+ "*/sample_tools/*",
107
+ "src/sample_tools/*",
108
+ ]
109
+
110
+ [tool.mypy]
111
+ python_version = "3.11"
112
+ warn_return_any = true
113
+ warn_unused_configs = true
114
+ disallow_untyped_defs = false
115
+ disallow_any_unimported = false
116
+ no_implicit_optional = true
117
+ warn_redundant_casts = true
118
+ warn_unused_ignores = false
119
+ warn_no_return = true
120
+ warn_unreachable = false
121
+ strict_equality = false
122
+
123
+ # Ignore import errors for packages without type stubs
124
+ [[tool.mypy.overrides]]
125
+ module = [
126
+ "chuk_mcp.*",
127
+ "httpx_sse.*",
128
+ ]
129
+ ignore_missing_imports = true
130
+
131
+ # Be less strict for test files
132
+ [[tool.mypy.overrides]]
133
+ module = ["tests.*", "sample_tools.*"]
134
+ ignore_errors = true
135
+
136
+ # Be more lenient for complex MCP integration code
137
+ [[tool.mypy.overrides]]
138
+ module = [
139
+ "chuk_tool_processor.mcp.*",
140
+ "chuk_tool_processor.plugins.*",
141
+ "chuk_tool_processor.registry.decorators",
142
+ "chuk_tool_processor.registry.auto_register",
143
+ "chuk_tool_processor.core.processor",
144
+ "chuk_tool_processor.execution.wrappers.*",
145
+ "chuk_tool_processor.execution.strategies.*",
146
+ "chuk_tool_processor.execution.tool_executor",
147
+ "chuk_tool_processor.models.validated_tool",
148
+ ]
149
+ ignore_errors = true
150
+
151
+ # Less strict for other modules
152
+ [[tool.mypy.overrides]]
153
+ module = [
154
+ "chuk_tool_processor.registry.*",
155
+ "chuk_tool_processor.core.*",
156
+ "chuk_tool_processor.execution.*",
157
+ "chuk_tool_processor.logging.*",
158
+ ]
159
+ warn_return_any = false
160
+ warn_no_return = false
161
+ no_implicit_optional = false
162
+ strict_optional = false
163
+ check_untyped_defs = false
164
+ disallow_untyped_defs = false
165
+
166
+ [tool.isort]
167
+ profile = "black"
168
+ line_length = 120
169
+ skip_gitignore = true
@@ -0,0 +1 @@
1
+ # chuk_tool_processor/core/__init__.py
@@ -1,14 +1,16 @@
1
1
  # chuk_tool_processor/exceptions.py
2
- from typing import Optional, Any, Dict
2
+ from typing import Any
3
3
 
4
4
 
5
5
  class ToolProcessorError(Exception):
6
6
  """Base exception for all tool processor errors."""
7
+
7
8
  pass
8
9
 
9
10
 
10
11
  class ToolNotFoundError(ToolProcessorError):
11
12
  """Raised when a requested tool is not found in the registry."""
13
+
12
14
  def __init__(self, tool_name: str):
13
15
  self.tool_name = tool_name
14
16
  super().__init__(f"Tool '{tool_name}' not found in registry")
@@ -16,7 +18,8 @@ class ToolNotFoundError(ToolProcessorError):
16
18
 
17
19
  class ToolExecutionError(ToolProcessorError):
18
20
  """Raised when a tool execution fails."""
19
- def __init__(self, tool_name: str, original_error: Optional[Exception] = None):
21
+
22
+ def __init__(self, tool_name: str, original_error: Exception | None = None):
20
23
  self.tool_name = tool_name
21
24
  self.original_error = original_error
22
25
  message = f"Tool '{tool_name}' execution failed"
@@ -27,6 +30,7 @@ class ToolExecutionError(ToolProcessorError):
27
30
 
28
31
  class ToolTimeoutError(ToolExecutionError):
29
32
  """Raised when a tool execution times out."""
33
+
30
34
  def __init__(self, tool_name: str, timeout: float):
31
35
  self.timeout = timeout
32
36
  super().__init__(tool_name, Exception(f"Execution timed out after {timeout}s"))
@@ -34,7 +38,8 @@ class ToolTimeoutError(ToolExecutionError):
34
38
 
35
39
  class ToolValidationError(ToolProcessorError):
36
40
  """Raised when tool arguments or results fail validation."""
37
- def __init__(self, tool_name: str, errors: Dict[str, Any]):
41
+
42
+ def __init__(self, tool_name: str, errors: dict[str, Any]):
38
43
  self.tool_name = tool_name
39
44
  self.errors = errors
40
45
  super().__init__(f"Validation failed for tool '{tool_name}': {errors}")
@@ -42,4 +47,5 @@ class ToolValidationError(ToolProcessorError):
42
47
 
43
48
  class ParserError(ToolProcessorError):
44
49
  """Raised when parsing tool calls from raw input fails."""
45
- pass
50
+
51
+ pass