hammad-python 0.0.14__py3-none-any.whl → 0.0.15__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.
- hammad_python-0.0.15.dist-info/METADATA +184 -0
- hammad_python-0.0.15.dist-info/RECORD +4 -0
- hammad/__init__.py +0 -1
- hammad/ai/__init__.py +0 -1
- hammad/ai/_utils.py +0 -142
- hammad/ai/completions/__init__.py +0 -45
- hammad/ai/completions/client.py +0 -684
- hammad/ai/completions/create.py +0 -710
- hammad/ai/completions/settings.py +0 -100
- hammad/ai/completions/types.py +0 -792
- hammad/ai/completions/utils.py +0 -486
- hammad/ai/embeddings/__init__.py +0 -35
- hammad/ai/embeddings/client/__init__.py +0 -1
- hammad/ai/embeddings/client/base_embeddings_client.py +0 -26
- hammad/ai/embeddings/client/fastembed_text_embeddings_client.py +0 -200
- hammad/ai/embeddings/client/litellm_embeddings_client.py +0 -288
- hammad/ai/embeddings/create.py +0 -159
- hammad/ai/embeddings/types.py +0 -69
- hammad/cache/__init__.py +0 -40
- hammad/cache/base_cache.py +0 -181
- hammad/cache/cache.py +0 -169
- hammad/cache/decorators.py +0 -261
- hammad/cache/file_cache.py +0 -80
- hammad/cache/ttl_cache.py +0 -74
- hammad/cli/__init__.py +0 -33
- hammad/cli/animations.py +0 -573
- hammad/cli/plugins.py +0 -781
- hammad/cli/styles/__init__.py +0 -55
- hammad/cli/styles/settings.py +0 -139
- hammad/cli/styles/types.py +0 -358
- hammad/cli/styles/utils.py +0 -480
- hammad/data/__init__.py +0 -56
- hammad/data/collections/__init__.py +0 -34
- hammad/data/collections/base_collection.py +0 -58
- hammad/data/collections/collection.py +0 -452
- hammad/data/collections/searchable_collection.py +0 -556
- hammad/data/collections/vector_collection.py +0 -596
- hammad/data/configurations/__init__.py +0 -35
- hammad/data/configurations/configuration.py +0 -564
- hammad/data/databases/__init__.py +0 -21
- hammad/data/databases/database.py +0 -902
- hammad/data/models/__init__.py +0 -44
- hammad/data/models/base/__init__.py +0 -35
- hammad/data/models/base/fields.py +0 -546
- hammad/data/models/base/model.py +0 -1078
- hammad/data/models/base/utils.py +0 -280
- hammad/data/models/pydantic/__init__.py +0 -55
- hammad/data/models/pydantic/converters.py +0 -632
- hammad/data/models/pydantic/models/__init__.py +0 -28
- hammad/data/models/pydantic/models/arbitrary_model.py +0 -46
- hammad/data/models/pydantic/models/cacheable_model.py +0 -79
- hammad/data/models/pydantic/models/fast_model.py +0 -318
- hammad/data/models/pydantic/models/function_model.py +0 -176
- hammad/data/models/pydantic/models/subscriptable_model.py +0 -63
- hammad/data/types/__init__.py +0 -41
- hammad/data/types/file.py +0 -358
- hammad/data/types/multimodal/__init__.py +0 -24
- hammad/data/types/multimodal/audio.py +0 -96
- hammad/data/types/multimodal/image.py +0 -80
- hammad/data/types/text.py +0 -1066
- hammad/formatting/__init__.py +0 -38
- hammad/formatting/json/__init__.py +0 -21
- hammad/formatting/json/converters.py +0 -152
- hammad/formatting/text/__init__.py +0 -63
- hammad/formatting/text/converters.py +0 -723
- hammad/formatting/text/markdown.py +0 -131
- hammad/formatting/yaml/__init__.py +0 -26
- hammad/formatting/yaml/converters.py +0 -5
- hammad/logging/__init__.py +0 -35
- hammad/logging/decorators.py +0 -834
- hammad/logging/logger.py +0 -954
- hammad/mcp/__init__.py +0 -50
- hammad/mcp/client/__init__.py +0 -1
- hammad/mcp/client/client.py +0 -523
- hammad/mcp/client/client_service.py +0 -393
- hammad/mcp/client/settings.py +0 -178
- hammad/mcp/servers/__init__.py +0 -1
- hammad/mcp/servers/launcher.py +0 -1161
- hammad/performance/__init__.py +0 -36
- hammad/performance/imports.py +0 -231
- hammad/performance/runtime/__init__.py +0 -32
- hammad/performance/runtime/decorators.py +0 -142
- hammad/performance/runtime/run.py +0 -299
- hammad/py.typed +0 -0
- hammad/service/__init__.py +0 -49
- hammad/service/create.py +0 -532
- hammad/service/decorators.py +0 -285
- hammad/typing/__init__.py +0 -407
- hammad/web/__init__.py +0 -43
- hammad/web/http/__init__.py +0 -1
- hammad/web/http/client.py +0 -944
- hammad/web/models.py +0 -245
- hammad/web/openapi/__init__.py +0 -1
- hammad/web/openapi/client.py +0 -740
- hammad/web/search/__init__.py +0 -1
- hammad/web/search/client.py +0 -988
- hammad/web/utils.py +0 -472
- hammad_python-0.0.14.dist-info/METADATA +0 -70
- hammad_python-0.0.14.dist-info/RECORD +0 -99
- {hammad_python-0.0.14.dist-info → hammad_python-0.0.15.dist-info}/WHEEL +0 -0
- {hammad_python-0.0.14.dist-info → hammad_python-0.0.15.dist-info}/licenses/LICENSE +0 -0
hammad/web/models.py
DELETED
@@ -1,245 +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
|
-
from typing_extensions import TypedDict, NotRequired
|
10
|
-
|
11
|
-
|
12
|
-
# -----------------------------------------------------------------------------
|
13
|
-
# Search Result Models
|
14
|
-
# -----------------------------------------------------------------------------
|
15
|
-
|
16
|
-
|
17
|
-
class SearchResult(TypedDict):
|
18
|
-
"""DuckDuckGo web search result."""
|
19
|
-
|
20
|
-
title: str
|
21
|
-
"""Title of the search result."""
|
22
|
-
|
23
|
-
href: str
|
24
|
-
"""URL of the search result."""
|
25
|
-
|
26
|
-
body: str
|
27
|
-
"""Description/snippet of the search result."""
|
28
|
-
|
29
|
-
|
30
|
-
class NewsResult(TypedDict):
|
31
|
-
"""DuckDuckGo news search result."""
|
32
|
-
|
33
|
-
date: str
|
34
|
-
"""Publication date of the news article."""
|
35
|
-
|
36
|
-
title: str
|
37
|
-
"""Title of the news article."""
|
38
|
-
|
39
|
-
body: str
|
40
|
-
"""Description/snippet of the news article."""
|
41
|
-
|
42
|
-
url: str
|
43
|
-
"""URL of the news article."""
|
44
|
-
|
45
|
-
image: str
|
46
|
-
"""Image URL associated with the news article."""
|
47
|
-
|
48
|
-
source: str
|
49
|
-
"""Source/publisher of the news article."""
|
50
|
-
|
51
|
-
|
52
|
-
# -----------------------------------------------------------------------------
|
53
|
-
# Web Page Parsing Models
|
54
|
-
# -----------------------------------------------------------------------------
|
55
|
-
|
56
|
-
|
57
|
-
class LinkInfo(TypedDict):
|
58
|
-
"""Information about a link extracted from a web page."""
|
59
|
-
|
60
|
-
href: str
|
61
|
-
"""Absolute URL of the link."""
|
62
|
-
|
63
|
-
text: str
|
64
|
-
"""Text content of the link."""
|
65
|
-
|
66
|
-
|
67
|
-
class ImageInfo(TypedDict):
|
68
|
-
"""Information about an image extracted from a web page."""
|
69
|
-
|
70
|
-
src: str
|
71
|
-
"""Source URL of the image."""
|
72
|
-
|
73
|
-
alt: str
|
74
|
-
"""Alt text of the image."""
|
75
|
-
|
76
|
-
title: str
|
77
|
-
"""Title attribute of the image."""
|
78
|
-
|
79
|
-
|
80
|
-
class SelectedElement(TypedDict):
|
81
|
-
"""Information about a selected element from CSS selector."""
|
82
|
-
|
83
|
-
tag: str
|
84
|
-
"""HTML tag name of the element."""
|
85
|
-
|
86
|
-
text: str
|
87
|
-
"""Text content of the element."""
|
88
|
-
|
89
|
-
html: str
|
90
|
-
"""HTML content of the element."""
|
91
|
-
|
92
|
-
attributes: Dict[str, str]
|
93
|
-
"""Attributes of the element."""
|
94
|
-
|
95
|
-
|
96
|
-
class WebPageResult(TypedDict):
|
97
|
-
"""Result from parsing a single web page."""
|
98
|
-
|
99
|
-
url: str
|
100
|
-
"""URL of the parsed page."""
|
101
|
-
|
102
|
-
status_code: int
|
103
|
-
"""HTTP status code of the response."""
|
104
|
-
|
105
|
-
content_type: str
|
106
|
-
"""Content-Type header from the response."""
|
107
|
-
|
108
|
-
title: str
|
109
|
-
"""Title of the web page."""
|
110
|
-
|
111
|
-
text: str
|
112
|
-
"""Extracted text content of the page."""
|
113
|
-
|
114
|
-
links: List[LinkInfo]
|
115
|
-
"""List of links found on the page."""
|
116
|
-
|
117
|
-
images: List[ImageInfo]
|
118
|
-
"""List of images found on the page."""
|
119
|
-
|
120
|
-
selected_elements: List[SelectedElement]
|
121
|
-
"""List of elements matching the CSS selector."""
|
122
|
-
|
123
|
-
|
124
|
-
class WebPageErrorResult(TypedDict):
|
125
|
-
"""Result from a failed web page parsing attempt."""
|
126
|
-
|
127
|
-
url: str
|
128
|
-
"""URL that failed to be parsed."""
|
129
|
-
|
130
|
-
error: str
|
131
|
-
"""Error message describing what went wrong."""
|
132
|
-
|
133
|
-
status_code: None
|
134
|
-
"""Always None for error results."""
|
135
|
-
|
136
|
-
content_type: str
|
137
|
-
"""Always empty string for error results."""
|
138
|
-
|
139
|
-
title: str
|
140
|
-
"""Always empty string for error results."""
|
141
|
-
|
142
|
-
text: str
|
143
|
-
"""Always empty string for error results."""
|
144
|
-
|
145
|
-
links: List[LinkInfo]
|
146
|
-
"""Always empty list for error results."""
|
147
|
-
|
148
|
-
images: List[ImageInfo]
|
149
|
-
"""Always empty list for error results."""
|
150
|
-
|
151
|
-
selected_elements: List[SelectedElement]
|
152
|
-
"""Always empty list for error results."""
|
153
|
-
|
154
|
-
|
155
|
-
# -----------------------------------------------------------------------------
|
156
|
-
# Enhanced Link Models
|
157
|
-
# -----------------------------------------------------------------------------
|
158
|
-
|
159
|
-
|
160
|
-
class ExtractedLink(TypedDict):
|
161
|
-
"""Information about a link extracted with classification."""
|
162
|
-
|
163
|
-
href: str
|
164
|
-
"""Absolute URL of the link."""
|
165
|
-
|
166
|
-
original_href: str
|
167
|
-
"""Original href attribute value (may be relative)."""
|
168
|
-
|
169
|
-
text: str
|
170
|
-
"""Text content of the link."""
|
171
|
-
|
172
|
-
title: str
|
173
|
-
"""Title attribute of the link."""
|
174
|
-
|
175
|
-
type: str
|
176
|
-
"""Type of link: 'internal' or 'external'."""
|
177
|
-
|
178
|
-
|
179
|
-
# -----------------------------------------------------------------------------
|
180
|
-
# HTTP Request Models
|
181
|
-
# -----------------------------------------------------------------------------
|
182
|
-
|
183
|
-
|
184
|
-
class HttpResponse(TypedDict):
|
185
|
-
"""HTTP response from web requests."""
|
186
|
-
|
187
|
-
status_code: int
|
188
|
-
"""HTTP status code."""
|
189
|
-
|
190
|
-
headers: Dict[str, str]
|
191
|
-
"""Response headers."""
|
192
|
-
|
193
|
-
content: Union[str, bytes]
|
194
|
-
"""Response content."""
|
195
|
-
|
196
|
-
url: str
|
197
|
-
"""Final URL after redirects."""
|
198
|
-
|
199
|
-
elapsed: float
|
200
|
-
"""Time elapsed for the request in seconds."""
|
201
|
-
|
202
|
-
json: NotRequired[Optional[Dict[str, Any]]]
|
203
|
-
"""Parsed JSON content if Content-Type is JSON."""
|
204
|
-
|
205
|
-
text: NotRequired[str]
|
206
|
-
"""Text content if response is text-based."""
|
207
|
-
|
208
|
-
|
209
|
-
# -----------------------------------------------------------------------------
|
210
|
-
# Batch Operation Models
|
211
|
-
# -----------------------------------------------------------------------------
|
212
|
-
|
213
|
-
|
214
|
-
WebPageResults = List[Union[WebPageResult, WebPageErrorResult]]
|
215
|
-
"""Results from batch web page parsing operations."""
|
216
|
-
|
217
|
-
SearchResults = List[SearchResult]
|
218
|
-
"""Results from web search operations."""
|
219
|
-
|
220
|
-
NewsResults = List[NewsResult]
|
221
|
-
"""Results from news search operations."""
|
222
|
-
|
223
|
-
ExtractedLinks = List[ExtractedLink]
|
224
|
-
"""Results from link extraction operations."""
|
225
|
-
|
226
|
-
|
227
|
-
__all__ = (
|
228
|
-
# Search models
|
229
|
-
"SearchResult",
|
230
|
-
"NewsResult",
|
231
|
-
"SearchResults",
|
232
|
-
"NewsResults",
|
233
|
-
# Web page models
|
234
|
-
"LinkInfo",
|
235
|
-
"ImageInfo",
|
236
|
-
"SelectedElement",
|
237
|
-
"WebPageResult",
|
238
|
-
"WebPageErrorResult",
|
239
|
-
"WebPageResults",
|
240
|
-
# Link extraction models
|
241
|
-
"ExtractedLink",
|
242
|
-
"ExtractedLinks",
|
243
|
-
# HTTP models
|
244
|
-
"HttpResponse",
|
245
|
-
)
|
hammad/web/openapi/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"""hammad.web.openapi"""
|