chatterer 0.1.12__py3-none-any.whl → 0.1.13__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 (31) hide show
  1. chatterer/__init__.py +62 -60
  2. chatterer/common_types/__init__.py +21 -0
  3. chatterer/common_types/io.py +19 -0
  4. chatterer/language_model.py +577 -577
  5. chatterer/messages.py +9 -9
  6. chatterer/strategies/__init__.py +13 -13
  7. chatterer/strategies/atom_of_thoughts.py +975 -975
  8. chatterer/strategies/base.py +14 -14
  9. chatterer/tools/__init__.py +35 -28
  10. chatterer/tools/citation_chunking/__init__.py +3 -3
  11. chatterer/tools/citation_chunking/chunks.py +53 -53
  12. chatterer/tools/citation_chunking/citation_chunker.py +118 -118
  13. chatterer/tools/citation_chunking/citations.py +285 -285
  14. chatterer/tools/citation_chunking/prompt.py +157 -157
  15. chatterer/tools/citation_chunking/reference.py +26 -26
  16. chatterer/tools/citation_chunking/utils.py +138 -138
  17. chatterer/tools/convert_to_text.py +418 -463
  18. chatterer/tools/upstage_document_parser.py +438 -0
  19. chatterer/tools/webpage_to_markdown/__init__.py +4 -4
  20. chatterer/tools/webpage_to_markdown/playwright_bot.py +649 -649
  21. chatterer/tools/webpage_to_markdown/utils.py +334 -334
  22. chatterer/tools/youtube.py +146 -146
  23. chatterer/utils/__init__.py +15 -15
  24. chatterer/utils/bytesio.py +59 -0
  25. chatterer/utils/code_agent.py +138 -138
  26. chatterer/utils/image.py +291 -291
  27. {chatterer-0.1.12.dist-info → chatterer-0.1.13.dist-info}/METADATA +171 -170
  28. chatterer-0.1.13.dist-info/RECORD +31 -0
  29. chatterer-0.1.12.dist-info/RECORD +0 -27
  30. {chatterer-0.1.12.dist-info → chatterer-0.1.13.dist-info}/WHEEL +0 -0
  31. {chatterer-0.1.12.dist-info → chatterer-0.1.13.dist-info}/top_level.txt +0 -0
chatterer/__init__.py CHANGED
@@ -1,60 +1,62 @@
1
- from .language_model import Chatterer, interactive_shell
2
- from .messages import (
3
- AIMessage,
4
- BaseMessage,
5
- FunctionMessage,
6
- HumanMessage,
7
- SystemMessage,
8
- )
9
- from .strategies import (
10
- AoTPipeline,
11
- AoTPrompter,
12
- AoTStrategy,
13
- BaseStrategy,
14
- )
15
- from .tools import (
16
- anything_to_markdown,
17
- citation_chunker,
18
- get_default_html_to_markdown_options,
19
- get_youtube_video_subtitle,
20
- html_to_markdown,
21
- init_webpage_to_markdown,
22
- pdf_to_text,
23
- pyscripts_to_snippets,
24
- get_youtube_video_details,
25
- )
26
- from .utils import (
27
- Base64Image,
28
- CodeExecutionResult,
29
- FunctionSignature,
30
- get_default_repl_tool,
31
- insert_callables_into_global,
32
- )
33
-
34
- __all__ = [
35
- "BaseStrategy",
36
- "Chatterer",
37
- "AoTStrategy",
38
- "AoTPipeline",
39
- "AoTPrompter",
40
- "html_to_markdown",
41
- "anything_to_markdown",
42
- "pdf_to_text",
43
- "get_default_html_to_markdown_options",
44
- "pyscripts_to_snippets",
45
- "citation_chunker",
46
- "BaseMessage",
47
- "HumanMessage",
48
- "SystemMessage",
49
- "AIMessage",
50
- "FunctionMessage",
51
- "Base64Image",
52
- "init_webpage_to_markdown",
53
- "FunctionSignature",
54
- "CodeExecutionResult",
55
- "get_default_repl_tool",
56
- "insert_callables_into_global",
57
- "get_youtube_video_subtitle",
58
- "get_youtube_video_details",
59
- "interactive_shell",
60
- ]
1
+ from .language_model import Chatterer, interactive_shell
2
+ from .messages import (
3
+ AIMessage,
4
+ BaseMessage,
5
+ FunctionMessage,
6
+ HumanMessage,
7
+ SystemMessage,
8
+ )
9
+ from .strategies import (
10
+ AoTPipeline,
11
+ AoTPrompter,
12
+ AoTStrategy,
13
+ BaseStrategy,
14
+ )
15
+ from .tools import (
16
+ anything_to_markdown,
17
+ citation_chunker,
18
+ get_default_html_to_markdown_options,
19
+ get_youtube_video_details,
20
+ get_youtube_video_subtitle,
21
+ html_to_markdown,
22
+ init_upstage_document_parser,
23
+ init_webpage_to_markdown,
24
+ pdf_to_text,
25
+ pyscripts_to_snippets,
26
+ )
27
+ from .utils import (
28
+ Base64Image,
29
+ CodeExecutionResult,
30
+ FunctionSignature,
31
+ get_default_repl_tool,
32
+ insert_callables_into_global,
33
+ )
34
+
35
+ __all__ = [
36
+ "BaseStrategy",
37
+ "Chatterer",
38
+ "AoTStrategy",
39
+ "AoTPipeline",
40
+ "AoTPrompter",
41
+ "html_to_markdown",
42
+ "anything_to_markdown",
43
+ "pdf_to_text",
44
+ "get_default_html_to_markdown_options",
45
+ "pyscripts_to_snippets",
46
+ "citation_chunker",
47
+ "BaseMessage",
48
+ "HumanMessage",
49
+ "SystemMessage",
50
+ "AIMessage",
51
+ "FunctionMessage",
52
+ "Base64Image",
53
+ "init_webpage_to_markdown",
54
+ "FunctionSignature",
55
+ "CodeExecutionResult",
56
+ "get_default_repl_tool",
57
+ "insert_callables_into_global",
58
+ "get_youtube_video_subtitle",
59
+ "get_youtube_video_details",
60
+ "interactive_shell",
61
+ "init_upstage_document_parser",
62
+ ]
@@ -0,0 +1,21 @@
1
+ from .io import (
2
+ BytesReadable,
3
+ BytesWritable,
4
+ FileDescriptorOrPath,
5
+ PathOrReadable,
6
+ Readable,
7
+ StringReadable,
8
+ StringWritable,
9
+ Writable,
10
+ )
11
+
12
+ __all__ = [
13
+ "BytesReadable",
14
+ "BytesWritable",
15
+ "FileDescriptorOrPath",
16
+ "PathOrReadable",
17
+ "Readable",
18
+ "StringReadable",
19
+ "StringWritable",
20
+ "Writable",
21
+ ]
@@ -0,0 +1,19 @@
1
+ import os
2
+ from io import BufferedReader, BufferedWriter, BytesIO, StringIO, TextIOWrapper
3
+ from typing import TypeAlias
4
+
5
+ # Type aliases for callback functions and file descriptors
6
+ FileDescriptorOrPath: TypeAlias = int | str | bytes | os.PathLike[str] | os.PathLike[bytes]
7
+
8
+ # Type aliases for different types of IO objects
9
+ BytesReadable: TypeAlias = BytesIO | BufferedReader
10
+ BytesWritable: TypeAlias = BytesIO | BufferedWriter
11
+ StringReadable: TypeAlias = StringIO | TextIOWrapper
12
+ StringWritable: TypeAlias = StringIO | TextIOWrapper
13
+
14
+ # Combined type aliases for readable and writable objects
15
+ Readable: TypeAlias = BytesReadable | StringReadable
16
+ Writable: TypeAlias = BytesWritable | StringWritable
17
+
18
+ # Type alias for path or readable object
19
+ PathOrReadable: TypeAlias = FileDescriptorOrPath | Readable