hammad-python 0.0.30__py3-none-any.whl → 0.0.32__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.
Files changed (137) hide show
  1. ham/__init__.py +200 -0
  2. {hammad_python-0.0.30.dist-info → hammad_python-0.0.32.dist-info}/METADATA +6 -32
  3. hammad_python-0.0.32.dist-info/RECORD +6 -0
  4. hammad/__init__.py +0 -84
  5. hammad/_internal.py +0 -256
  6. hammad/_main.py +0 -226
  7. hammad/cache/__init__.py +0 -40
  8. hammad/cache/base_cache.py +0 -181
  9. hammad/cache/cache.py +0 -169
  10. hammad/cache/decorators.py +0 -261
  11. hammad/cache/file_cache.py +0 -80
  12. hammad/cache/ttl_cache.py +0 -74
  13. hammad/cli/__init__.py +0 -33
  14. hammad/cli/animations.py +0 -573
  15. hammad/cli/plugins.py +0 -867
  16. hammad/cli/styles/__init__.py +0 -55
  17. hammad/cli/styles/settings.py +0 -139
  18. hammad/cli/styles/types.py +0 -358
  19. hammad/cli/styles/utils.py +0 -634
  20. hammad/data/__init__.py +0 -90
  21. hammad/data/collections/__init__.py +0 -49
  22. hammad/data/collections/collection.py +0 -326
  23. hammad/data/collections/indexes/__init__.py +0 -37
  24. hammad/data/collections/indexes/qdrant/__init__.py +0 -1
  25. hammad/data/collections/indexes/qdrant/index.py +0 -723
  26. hammad/data/collections/indexes/qdrant/settings.py +0 -94
  27. hammad/data/collections/indexes/qdrant/utils.py +0 -210
  28. hammad/data/collections/indexes/tantivy/__init__.py +0 -1
  29. hammad/data/collections/indexes/tantivy/index.py +0 -426
  30. hammad/data/collections/indexes/tantivy/settings.py +0 -40
  31. hammad/data/collections/indexes/tantivy/utils.py +0 -176
  32. hammad/data/configurations/__init__.py +0 -35
  33. hammad/data/configurations/configuration.py +0 -564
  34. hammad/data/models/__init__.py +0 -50
  35. hammad/data/models/extensions/__init__.py +0 -4
  36. hammad/data/models/extensions/pydantic/__init__.py +0 -42
  37. hammad/data/models/extensions/pydantic/converters.py +0 -759
  38. hammad/data/models/fields.py +0 -546
  39. hammad/data/models/model.py +0 -1078
  40. hammad/data/models/utils.py +0 -280
  41. hammad/data/sql/__init__.py +0 -24
  42. hammad/data/sql/database.py +0 -576
  43. hammad/data/sql/types.py +0 -127
  44. hammad/data/types/__init__.py +0 -75
  45. hammad/data/types/file.py +0 -431
  46. hammad/data/types/multimodal/__init__.py +0 -36
  47. hammad/data/types/multimodal/audio.py +0 -200
  48. hammad/data/types/multimodal/image.py +0 -182
  49. hammad/data/types/text.py +0 -1308
  50. hammad/formatting/__init__.py +0 -33
  51. hammad/formatting/json/__init__.py +0 -27
  52. hammad/formatting/json/converters.py +0 -158
  53. hammad/formatting/text/__init__.py +0 -63
  54. hammad/formatting/text/converters.py +0 -723
  55. hammad/formatting/text/markdown.py +0 -131
  56. hammad/formatting/yaml/__init__.py +0 -26
  57. hammad/formatting/yaml/converters.py +0 -5
  58. hammad/genai/__init__.py +0 -217
  59. hammad/genai/a2a/__init__.py +0 -32
  60. hammad/genai/a2a/workers.py +0 -552
  61. hammad/genai/agents/__init__.py +0 -59
  62. hammad/genai/agents/agent.py +0 -1973
  63. hammad/genai/agents/run.py +0 -1024
  64. hammad/genai/agents/types/__init__.py +0 -42
  65. hammad/genai/agents/types/agent_context.py +0 -13
  66. hammad/genai/agents/types/agent_event.py +0 -128
  67. hammad/genai/agents/types/agent_hooks.py +0 -220
  68. hammad/genai/agents/types/agent_messages.py +0 -31
  69. hammad/genai/agents/types/agent_response.py +0 -125
  70. hammad/genai/agents/types/agent_stream.py +0 -327
  71. hammad/genai/graphs/__init__.py +0 -125
  72. hammad/genai/graphs/_utils.py +0 -190
  73. hammad/genai/graphs/base.py +0 -1828
  74. hammad/genai/graphs/plugins.py +0 -316
  75. hammad/genai/graphs/types.py +0 -638
  76. hammad/genai/models/__init__.py +0 -1
  77. hammad/genai/models/embeddings/__init__.py +0 -43
  78. hammad/genai/models/embeddings/model.py +0 -226
  79. hammad/genai/models/embeddings/run.py +0 -163
  80. hammad/genai/models/embeddings/types/__init__.py +0 -37
  81. hammad/genai/models/embeddings/types/embedding_model_name.py +0 -75
  82. hammad/genai/models/embeddings/types/embedding_model_response.py +0 -76
  83. hammad/genai/models/embeddings/types/embedding_model_run_params.py +0 -66
  84. hammad/genai/models/embeddings/types/embedding_model_settings.py +0 -47
  85. hammad/genai/models/language/__init__.py +0 -57
  86. hammad/genai/models/language/model.py +0 -1098
  87. hammad/genai/models/language/run.py +0 -878
  88. hammad/genai/models/language/types/__init__.py +0 -40
  89. hammad/genai/models/language/types/language_model_instructor_mode.py +0 -47
  90. hammad/genai/models/language/types/language_model_messages.py +0 -28
  91. hammad/genai/models/language/types/language_model_name.py +0 -239
  92. hammad/genai/models/language/types/language_model_request.py +0 -127
  93. hammad/genai/models/language/types/language_model_response.py +0 -217
  94. hammad/genai/models/language/types/language_model_response_chunk.py +0 -56
  95. hammad/genai/models/language/types/language_model_settings.py +0 -89
  96. hammad/genai/models/language/types/language_model_stream.py +0 -600
  97. hammad/genai/models/language/utils/__init__.py +0 -28
  98. hammad/genai/models/language/utils/requests.py +0 -421
  99. hammad/genai/models/language/utils/structured_outputs.py +0 -135
  100. hammad/genai/models/model_provider.py +0 -4
  101. hammad/genai/models/multimodal.py +0 -47
  102. hammad/genai/models/reranking.py +0 -26
  103. hammad/genai/types/__init__.py +0 -1
  104. hammad/genai/types/base.py +0 -215
  105. hammad/genai/types/history.py +0 -290
  106. hammad/genai/types/tools.py +0 -507
  107. hammad/logging/__init__.py +0 -35
  108. hammad/logging/decorators.py +0 -834
  109. hammad/logging/logger.py +0 -1018
  110. hammad/mcp/__init__.py +0 -53
  111. hammad/mcp/client/__init__.py +0 -35
  112. hammad/mcp/client/client.py +0 -624
  113. hammad/mcp/client/client_service.py +0 -400
  114. hammad/mcp/client/settings.py +0 -178
  115. hammad/mcp/servers/__init__.py +0 -26
  116. hammad/mcp/servers/launcher.py +0 -1161
  117. hammad/runtime/__init__.py +0 -32
  118. hammad/runtime/decorators.py +0 -142
  119. hammad/runtime/run.py +0 -299
  120. hammad/service/__init__.py +0 -49
  121. hammad/service/create.py +0 -527
  122. hammad/service/decorators.py +0 -283
  123. hammad/types.py +0 -288
  124. hammad/typing/__init__.py +0 -435
  125. hammad/web/__init__.py +0 -43
  126. hammad/web/http/__init__.py +0 -1
  127. hammad/web/http/client.py +0 -944
  128. hammad/web/models.py +0 -275
  129. hammad/web/openapi/__init__.py +0 -1
  130. hammad/web/openapi/client.py +0 -740
  131. hammad/web/search/__init__.py +0 -1
  132. hammad/web/search/client.py +0 -1023
  133. hammad/web/utils.py +0 -472
  134. hammad_python-0.0.30.dist-info/RECORD +0 -135
  135. {hammad → ham}/py.typed +0 -0
  136. {hammad_python-0.0.30.dist-info → hammad_python-0.0.32.dist-info}/WHEEL +0 -0
  137. {hammad_python-0.0.30.dist-info → hammad_python-0.0.32.dist-info}/licenses/LICENSE +0 -0
hammad/web/models.py DELETED
@@ -1,275 +0,0 @@
1
- """hammad.web.models
2
-
3
- Output models for web search and parsing functionality.
4
- """
5
-
6
- from __future__ import annotations
7
-
8
- from typing import List, Dict, Any, Optional, Union
9
-
10
- from pydantic import BaseModel, Field
11
-
12
-
13
- # -----------------------------------------------------------------------------
14
- # Search Result Models
15
- # -----------------------------------------------------------------------------
16
-
17
-
18
- class SearchResult(BaseModel):
19
- """DuckDuckGo web search result."""
20
-
21
- title: str
22
- """Title of the search result."""
23
-
24
- href: str
25
- """URL of the search result."""
26
-
27
- body: str
28
- """Description/snippet of the search result."""
29
-
30
-
31
- class NewsResult(BaseModel):
32
- """DuckDuckGo news search result."""
33
-
34
- date: str
35
- """Publication date of the news article."""
36
-
37
- title: str
38
- """Title of the news article."""
39
-
40
- body: str
41
- """Description/snippet of the news article."""
42
-
43
- url: str
44
- """URL of the news article."""
45
-
46
- image: str
47
- """Image URL associated with the news article."""
48
-
49
- source: str
50
- """Source/publisher of the news article."""
51
-
52
-
53
- # -----------------------------------------------------------------------------
54
- # Web Page Parsing Models
55
- # -----------------------------------------------------------------------------
56
-
57
-
58
- class LinkInfo(BaseModel):
59
- """Information about a link extracted from a web page."""
60
-
61
- href: str
62
- """Absolute URL of the link."""
63
-
64
- text: str
65
- """Text content of the link."""
66
-
67
-
68
- class ImageInfo(BaseModel):
69
- """Information about an image extracted from a web page."""
70
-
71
- src: str
72
- """Source URL of the image."""
73
-
74
- alt: str
75
- """Alt text of the image."""
76
-
77
- title: str
78
- """Title attribute of the image."""
79
-
80
-
81
- class SelectedElement(BaseModel):
82
- """Information about a selected element from CSS selector."""
83
-
84
- tag: str
85
- """HTML tag name of the element."""
86
-
87
- text: str
88
- """Text content of the element."""
89
-
90
- html: str
91
- """HTML content of the element."""
92
-
93
- attributes: Dict[str, str]
94
- """Attributes of the element."""
95
-
96
-
97
- class WebPageResult(BaseModel):
98
- """Result from parsing a single web page."""
99
-
100
- url: str
101
- """URL of the parsed page."""
102
-
103
- status_code: int
104
- """HTTP status code of the response."""
105
-
106
- content_type: str
107
- """Content-Type header from the response."""
108
-
109
- title: str
110
- """Title of the web page."""
111
-
112
- text: str
113
- """Extracted text content of the page."""
114
-
115
- links: List[LinkInfo]
116
- """List of links found on the page."""
117
-
118
- images: List[ImageInfo]
119
- """List of images found on the page."""
120
-
121
- selected_elements: List[SelectedElement]
122
- """List of elements matching the CSS selector."""
123
-
124
-
125
- class WebPageErrorResult(BaseModel):
126
- """Result from a failed web page parsing attempt."""
127
-
128
- url: str
129
- """URL that failed to be parsed."""
130
-
131
- error: str
132
- """Error message describing what went wrong."""
133
-
134
- status_code: Optional[int]
135
- """Always None for error results."""
136
-
137
- content_type: str
138
- """Always empty string for error results."""
139
-
140
- title: str
141
- """Always empty string for error results."""
142
-
143
- text: str
144
- """Always empty string for error results."""
145
-
146
- links: List[LinkInfo]
147
- """Always empty list for error results."""
148
-
149
- images: List[ImageInfo]
150
- """Always empty list for error results."""
151
-
152
- selected_elements: List[SelectedElement]
153
- """Always empty list for error results."""
154
-
155
-
156
- # -----------------------------------------------------------------------------
157
- # Enhanced Link Models
158
- # -----------------------------------------------------------------------------
159
-
160
-
161
- class ExtractedLink(BaseModel):
162
- """Information about a link extracted with classification."""
163
-
164
- href: str
165
- """Absolute URL of the link."""
166
-
167
- original_href: str
168
- """Original href attribute value (may be relative)."""
169
-
170
- text: str
171
- """Text content of the link."""
172
-
173
- title: str
174
- """Title attribute of the link."""
175
-
176
- type: str
177
- """Type of link: 'internal' or 'external'."""
178
-
179
-
180
- # -----------------------------------------------------------------------------
181
- # HTTP Request Models
182
- # -----------------------------------------------------------------------------
183
-
184
-
185
- class HttpResponse(BaseModel):
186
- """HTTP response from web requests."""
187
-
188
- status_code: int
189
- """HTTP status code."""
190
-
191
- headers: Dict[str, str]
192
- """Response headers."""
193
-
194
- content: Union[str, bytes]
195
- """Response content."""
196
-
197
- url: str
198
- """Final URL after redirects."""
199
-
200
- elapsed: float
201
- """Time elapsed for the request in seconds."""
202
-
203
- # NOTE: This is a workaround to avoid the issue with the `json` field
204
- # might consider moving to dataclasses
205
- json_data: Optional[Dict[str, Any]] = Field(alias="json")
206
- """Parsed JSON content if Content-Type is JSON."""
207
-
208
- text: str
209
- """Text content if response is text-based."""
210
-
211
-
212
- # -----------------------------------------------------------------------------
213
- # Batch Operation Models
214
- # -----------------------------------------------------------------------------
215
-
216
-
217
- class WebPageResults(BaseModel):
218
- """Results from batch web page parsing operations."""
219
-
220
- urls: List[str]
221
- """URLs used for the web page parsing operations."""
222
-
223
- results: List[Union[WebPageResult, WebPageErrorResult]]
224
- """List of results from batch web page parsing operations."""
225
-
226
-
227
- class SearchResults(BaseModel):
228
- """Results from web search operations."""
229
-
230
- query: str
231
- """Query used for the web search operations."""
232
-
233
- results: List[SearchResult]
234
- """List of results from web search operations."""
235
-
236
-
237
- class NewsResults(BaseModel):
238
- """Results from news search operations."""
239
-
240
- query: str
241
- """Query used for the news search operations."""
242
-
243
- results: List[NewsResult]
244
- """List of results from news search operations."""
245
-
246
-
247
- class ExtractedLinks(BaseModel):
248
- """Results from link extraction operations."""
249
-
250
- url: str
251
- """URL used for the link extraction operations."""
252
-
253
- results: List[ExtractedLink]
254
- """List of results from link extraction operations."""
255
-
256
-
257
- __all__ = (
258
- # Search models
259
- "SearchResult",
260
- "NewsResult",
261
- "SearchResults",
262
- "NewsResults",
263
- # Web page models
264
- "LinkInfo",
265
- "ImageInfo",
266
- "SelectedElement",
267
- "WebPageResult",
268
- "WebPageErrorResult",
269
- "WebPageResults",
270
- # Link extraction models
271
- "ExtractedLink",
272
- "ExtractedLinks",
273
- # HTTP models
274
- "HttpResponse",
275
- )
@@ -1 +0,0 @@
1
- """hammad.web.openapi"""