hammad-python 0.0.27__py3-none-any.whl → 0.0.29__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/data/__init__.py +2 -0
- hammad/data/collections/__init__.py +2 -0
- hammad/data/collections/collection.py +9 -5
- hammad/formatting/__init__.py +12 -0
- hammad/web/search/client.py +2 -2
- {hammad_python-0.0.27.dist-info → hammad_python-0.0.29.dist-info}/METADATA +1 -9
- {hammad_python-0.0.27.dist-info → hammad_python-0.0.29.dist-info}/RECORD +9 -9
- {hammad_python-0.0.27.dist-info → hammad_python-0.0.29.dist-info}/WHEEL +0 -0
- {hammad_python-0.0.27.dist-info → hammad_python-0.0.29.dist-info}/licenses/LICENSE +0 -0
hammad/data/__init__.py
CHANGED
@@ -23,6 +23,7 @@ if TYPE_CHECKING:
|
|
23
23
|
from .collections import (
|
24
24
|
Collection,
|
25
25
|
create_collection,
|
26
|
+
CollectionType,
|
26
27
|
TantivyCollectionIndex,
|
27
28
|
QdrantCollectionIndex,
|
28
29
|
TantivyCollectionIndexSettings,
|
@@ -59,6 +60,7 @@ __all__ = (
|
|
59
60
|
# hammad.data.collections
|
60
61
|
"Collection",
|
61
62
|
"create_collection",
|
63
|
+
"CollectionType",
|
62
64
|
"TantivyCollectionIndex",
|
63
65
|
"QdrantCollectionIndex",
|
64
66
|
"TantivyCollectionIndexSettings",
|
@@ -7,6 +7,7 @@ if TYPE_CHECKING:
|
|
7
7
|
from .collection import (
|
8
8
|
Collection,
|
9
9
|
create_collection,
|
10
|
+
CollectionType,
|
10
11
|
)
|
11
12
|
|
12
13
|
from .indexes import (
|
@@ -29,6 +30,7 @@ __all__ = (
|
|
29
30
|
# hammad.data.collections.collection
|
30
31
|
"Collection",
|
31
32
|
"create_collection",
|
33
|
+
"CollectionType",
|
32
34
|
# hammad.data.collections.indexes
|
33
35
|
"TantivyCollectionIndex",
|
34
36
|
"QdrantCollectionIndex",
|
@@ -1,14 +1,10 @@
|
|
1
1
|
"""hammad.data.collections.collection"""
|
2
2
|
|
3
3
|
from typing import (
|
4
|
-
Any,
|
5
|
-
Callable,
|
6
|
-
Dict,
|
7
|
-
List,
|
8
4
|
Literal,
|
9
5
|
Optional,
|
10
6
|
Type,
|
11
|
-
|
7
|
+
TypeAlias,
|
12
8
|
Union,
|
13
9
|
overload,
|
14
10
|
TYPE_CHECKING,
|
@@ -37,9 +33,17 @@ else:
|
|
37
33
|
__all__ = (
|
38
34
|
"Collection",
|
39
35
|
"VectorSearchResult",
|
36
|
+
"CollectionType",
|
40
37
|
)
|
41
38
|
|
42
39
|
|
40
|
+
CollectionType: TypeAlias = Union["TantivyCollectionIndex", "QdrantCollectionIndex"]
|
41
|
+
"""Alias for a type of collection index.
|
42
|
+
|
43
|
+
This is a union of TantivyCollectionIndex and QdrantCollectionIndex.
|
44
|
+
"""
|
45
|
+
|
46
|
+
|
43
47
|
class Collection:
|
44
48
|
"""
|
45
49
|
A unified collection factory that creates the appropriate collection index type
|
hammad/formatting/__init__.py
CHANGED
@@ -5,12 +5,24 @@ from .._internal import create_getattr_importer
|
|
5
5
|
|
6
6
|
if TYPE_CHECKING:
|
7
7
|
from . import json
|
8
|
+
from .json import (
|
9
|
+
convert_to_json_schema
|
10
|
+
)
|
8
11
|
from . import text
|
12
|
+
from .text import (
|
13
|
+
convert_to_text,
|
14
|
+
convert_type_to_text,
|
15
|
+
convert_docstring_to_text
|
16
|
+
)
|
9
17
|
from . import yaml
|
10
18
|
|
11
19
|
__all__ = (
|
12
20
|
"json",
|
21
|
+
"convert_to_json_schema",
|
13
22
|
"text",
|
23
|
+
"convert_to_text",
|
24
|
+
"convert_type_to_text",
|
25
|
+
"convert_docstring_to_text",
|
14
26
|
"yaml",
|
15
27
|
)
|
16
28
|
|
hammad/web/search/client.py
CHANGED
@@ -188,7 +188,7 @@ class AsyncSearchClient:
|
|
188
188
|
with DDGS() as ddgs:
|
189
189
|
raw_results = list(
|
190
190
|
ddgs.text(
|
191
|
-
|
191
|
+
query.strip(),
|
192
192
|
region=region,
|
193
193
|
safesearch=safesearch,
|
194
194
|
timelimit=timelimit,
|
@@ -256,7 +256,7 @@ class AsyncSearchClient:
|
|
256
256
|
with DDGS() as ddgs:
|
257
257
|
raw_results = list(
|
258
258
|
ddgs.news(
|
259
|
-
|
259
|
+
query.strip(),
|
260
260
|
region=region,
|
261
261
|
safesearch=safesearch,
|
262
262
|
timelimit=timelimit,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hammad-python
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.29
|
4
4
|
Author-email: Hammad Saeed <hammadaidev@gmail.com>
|
5
5
|
License: MIT License
|
6
6
|
|
@@ -41,14 +41,6 @@ Provides-Extra: ai
|
|
41
41
|
Requires-Dist: instructor>=1.9.0; extra == 'ai'
|
42
42
|
Requires-Dist: litellm>=1.73.6; extra == 'ai'
|
43
43
|
Requires-Dist: qdrant-client>=1.14.3; extra == 'ai'
|
44
|
-
Provides-Extra: all
|
45
|
-
Requires-Dist: fastapi>=0.115.6; extra == 'all'
|
46
|
-
Requires-Dist: instructor>=1.9.0; extra == 'all'
|
47
|
-
Requires-Dist: litellm>=1.73.6; extra == 'all'
|
48
|
-
Requires-Dist: mcp>=1.10.1; extra == 'all'
|
49
|
-
Requires-Dist: pydantic-graph>=0.4.2; extra == 'all'
|
50
|
-
Requires-Dist: qdrant-client>=1.14.3; extra == 'all'
|
51
|
-
Requires-Dist: uvicorn>=0.34.0; extra == 'all'
|
52
44
|
Provides-Extra: genai
|
53
45
|
Requires-Dist: fastapi>=0.115.6; extra == 'genai'
|
54
46
|
Requires-Dist: instructor>=1.9.0; extra == 'genai'
|
@@ -16,9 +16,9 @@ hammad/cli/styles/__init__.py,sha256=Ok7J_uhJgyswNkBWnDw50oTX9Xk1HPksUl3UbmT1qTI
|
|
16
16
|
hammad/cli/styles/settings.py,sha256=irChf9RsMij3djx_n9D9duoVIzxLCpd9-BlKl6U_OLk,5532
|
17
17
|
hammad/cli/styles/types.py,sha256=vNIeQY_23m10K8qVT7Iy-PMwosGL-La-UAZKszHJjEE,7911
|
18
18
|
hammad/cli/styles/utils.py,sha256=zzi0JdH1X7O8XWRlMVfJP2jB-OWt7zkpm_LeCHoSKVY,28287
|
19
|
-
hammad/data/__init__.py,sha256=
|
20
|
-
hammad/data/collections/__init__.py,sha256=
|
21
|
-
hammad/data/collections/collection.py,sha256=
|
19
|
+
hammad/data/__init__.py,sha256=VfrHgmyf4RU1y8U0oA23TcohuF-XUh8742rH3lUnw0g,2278
|
20
|
+
hammad/data/collections/__init__.py,sha256=_7qoquGARHfx6G_ui9D4czyQAx5RkVHyrdFBhB7UI9U,1156
|
21
|
+
hammad/data/collections/collection.py,sha256=zDx27gMv-5F-ClTSaI0_1_GZN8K9bzXmvWIvIBqpkH0,12172
|
22
22
|
hammad/data/collections/indexes/__init__.py,sha256=RmXKWKq2sbtA1swz5vamKKWut-eKfc-Q2tUnij-E-IU,960
|
23
23
|
hammad/data/collections/indexes/qdrant/__init__.py,sha256=KU89TIJkYmJPnVxWKHfXntkIYwhn86ejXtWG30hCyHg,49
|
24
24
|
hammad/data/collections/indexes/qdrant/index.py,sha256=UzhW64i5Yq5AXyGZjkW4dljgQxwKUbjF6vhzendbjko,25634
|
@@ -46,7 +46,7 @@ hammad/data/types/text.py,sha256=x22KAEX18eU0m5DUvY5P9f1kcYYtoUv9tPRlvmTJubA,408
|
|
46
46
|
hammad/data/types/multimodal/__init__.py,sha256=jPqoHTmgBJnc_8jg-QMjAYiOiRys29IcDnJ3FMrCH_0,689
|
47
47
|
hammad/data/types/multimodal/audio.py,sha256=6T3XJXrAazkAluwohfGff0ENmhRtIMAX0XV22KVGgDU,5380
|
48
48
|
hammad/data/types/multimodal/image.py,sha256=IDjuCfTpsNqWEaAZ2c6M28gwTpswHy6tGu16F3GE6Rg,4733
|
49
|
-
hammad/formatting/__init__.py,sha256=
|
49
|
+
hammad/formatting/__init__.py,sha256=HspdG2uFBPcqtUa5lMdqV_9gTon1Emvn61WBUAz4xCI,642
|
50
50
|
hammad/formatting/json/__init__.py,sha256=V4uODCUQdptfyw_D96R3XDopw1bgNIR2ogiEG-Z-FtQ,525
|
51
51
|
hammad/formatting/json/converters.py,sha256=CfEKtoTkeQbaGnpHHY3SAFVFjRjeG115X94L8Jq-14I,5597
|
52
52
|
hammad/formatting/text/__init__.py,sha256=ZAA7D4pwKFjeUxHsnm21QKSTtQ7Fj8ncO__m5Ry_eHY,1506
|
@@ -128,8 +128,8 @@ hammad/web/http/client.py,sha256=LWBSVjvHEuHmOOWq5EUT4zN5w6zSG45bOTk6FiSPHuA,330
|
|
128
128
|
hammad/web/openapi/__init__.py,sha256=JhJQ6_laBmB2djIYFc0vgGha2GsdUe4FP1LDdZCQ5J4,25
|
129
129
|
hammad/web/openapi/client.py,sha256=1pXz7KAO_0pN4kQZoWKWskXDYGiJ535TsPO1GGCiC0E,26816
|
130
130
|
hammad/web/search/__init__.py,sha256=e9A6znPIiZCz-4secyHbUs0uUGf5yAqW6wGacgx961U,24
|
131
|
-
hammad/web/search/client.py,sha256=
|
132
|
-
hammad_python-0.0.
|
133
|
-
hammad_python-0.0.
|
134
|
-
hammad_python-0.0.
|
135
|
-
hammad_python-0.0.
|
131
|
+
hammad/web/search/client.py,sha256=cBp8aNWFzVKoYimjip1IYJ09Z3lDgQ0EAzDST16e8Pk,36676
|
132
|
+
hammad_python-0.0.29.dist-info/METADATA,sha256=xM6ZjAZnYyC09TtSFNiYfG0XE0p-wZHlKkWtOwuTtDY,6425
|
133
|
+
hammad_python-0.0.29.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
134
|
+
hammad_python-0.0.29.dist-info/licenses/LICENSE,sha256=h74yFUWjbBaodcWG5wNmm30npjl8obVcxD-1nQfUp2I,1069
|
135
|
+
hammad_python-0.0.29.dist-info/RECORD,,
|
File without changes
|
File without changes
|