aix 0.0.19__py3-none-any.whl → 0.0.20__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.
- aix/__init__.py +5 -1
- aix/contexts.py +4 -4
- {aix-0.0.19.dist-info → aix-0.0.20.dist-info}/METADATA +1 -1
- {aix-0.0.19.dist-info → aix-0.0.20.dist-info}/RECORD +7 -7
- {aix-0.0.19.dist-info → aix-0.0.20.dist-info}/LICENSE +0 -0
- {aix-0.0.19.dist-info → aix-0.0.20.dist-info}/WHEEL +0 -0
- {aix-0.0.19.dist-info → aix-0.0.20.dist-info}/top_level.txt +0 -0
aix/__init__.py
CHANGED
|
@@ -28,7 +28,11 @@ Choose a chat function and chat with it:
|
|
|
28
28
|
|
|
29
29
|
from aix.gen_ai import chat, chat_models, chat_funcs
|
|
30
30
|
from aix import contexts
|
|
31
|
-
from aix.contexts import
|
|
31
|
+
from aix.contexts import (
|
|
32
|
+
bytes_to_markdown, # Convert bytes to markdown (with plugin support for different types of files)
|
|
33
|
+
bytes_store_to_markdown_store, # Convert a bytes store to a markdown store based on extensions
|
|
34
|
+
aggregate_store, # Aggregate a store into a single value (say, a string)
|
|
35
|
+
)
|
|
32
36
|
|
|
33
37
|
# TODO: Change this so that there's a load_pkg function that loads the packages dynamically
|
|
34
38
|
# if and when use wants.
|
aix/contexts.py
CHANGED
|
@@ -242,7 +242,7 @@ def default_fallback(b: bytes, input_format: str) -> str:
|
|
|
242
242
|
return f"# Conversion Error\n\nCould not convert {input_format}: {str(e)}"
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
def
|
|
245
|
+
def bytes_to_markdown(
|
|
246
246
|
b: bytes,
|
|
247
247
|
input_format: str,
|
|
248
248
|
*,
|
|
@@ -324,7 +324,7 @@ def _resolve_src_bytes_store_and_target_text_store(src_files, target_store):
|
|
|
324
324
|
return src_files, target_store
|
|
325
325
|
|
|
326
326
|
|
|
327
|
-
def
|
|
327
|
+
def bytes_store_to_markdown_store(
|
|
328
328
|
src_files: Union[str, Mapping[str, bytes]],
|
|
329
329
|
target_store: Union[str, MutableMapping[str, bytes]] = None,
|
|
330
330
|
*,
|
|
@@ -342,14 +342,14 @@ def convert_files_to_markdown(
|
|
|
342
342
|
src_files, target_store = _resolve_src_bytes_store_and_target_text_store(
|
|
343
343
|
src_files, target_store
|
|
344
344
|
)
|
|
345
|
-
|
|
345
|
+
_bytes_to_markdown = partial(bytes_to_markdown, converters=converters)
|
|
346
346
|
|
|
347
347
|
for src_key, src_bytes in src_files.items():
|
|
348
348
|
if verbose:
|
|
349
349
|
print(f"Converting {src_key} to markdown")
|
|
350
350
|
ext = get_extension(src_key)
|
|
351
351
|
target_key = old_to_new_key(src_key)
|
|
352
|
-
target_store[target_key] =
|
|
352
|
+
target_store[target_key] = _bytes_to_markdown(src_bytes, ext)
|
|
353
353
|
|
|
354
354
|
return target_store_egress(target_store)
|
|
355
355
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
aix/__init__.py,sha256=
|
|
2
|
-
aix/contexts.py,sha256=
|
|
1
|
+
aix/__init__.py,sha256=5_Ktv6lJbdwGf6c94mLYGi00zMTn2HkrUOvHAawhr_4,1921
|
|
2
|
+
aix/contexts.py,sha256=_Ze-qlz2OwOTTpYl1wBzL47mGA563wA8zmucye4kniM,33852
|
|
3
3
|
aix/misc.py,sha256=evC4FqE63z_gnZ_4vCLsfKZkksuPBDlfK0fI8jHEbGg,204
|
|
4
4
|
aix/np.py,sha256=D6uTumkK5Y9kB_XbSqtMzzBsnuai9WZWLVa6-sWybls,194
|
|
5
5
|
aix/pd.py,sha256=LqJ13OEOox6K6vs9hMYkhBRgCu0EMPiYSnd2no4RdDc,197
|
|
@@ -9,8 +9,8 @@ aix/util.py,sha256=d0VjSbpTNzjGFH_upNOnaUnrRawrVbXdlFBan1Q9CRo,107
|
|
|
9
9
|
aix/gen_ai/__init__.py,sha256=ky5WRID0rIb8KLxtulB9t2CN_GKUxu1KdiRN-n92q2U,2341
|
|
10
10
|
aix/gen_ai/google_genai.py,sha256=KRYc52DQtn-V5vycULyoNpoHcR3lcBt1Z0DHj0XYcuI,966
|
|
11
11
|
aix/gen_ai/openai_genai.py,sha256=RzJy7pIu4dngUThEJdALqZpexHK_quDkug-SjAXm41E,539
|
|
12
|
-
aix-0.0.
|
|
13
|
-
aix-0.0.
|
|
14
|
-
aix-0.0.
|
|
15
|
-
aix-0.0.
|
|
16
|
-
aix-0.0.
|
|
12
|
+
aix-0.0.20.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
+
aix-0.0.20.dist-info/METADATA,sha256=Fjp_23Iw0bSfZxM06uoMKrzngPSF300RsfAquK3MYyc,6010
|
|
14
|
+
aix-0.0.20.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
15
|
+
aix-0.0.20.dist-info/top_level.txt,sha256=JV67V91ws1X6NwMtcBSxqB7HJx0xOuo_of1K7yg33Z0,4
|
|
16
|
+
aix-0.0.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|