chatterer 0.1.13__py3-none-any.whl → 0.1.14__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 (36) hide show
  1. chatterer/__init__.py +97 -62
  2. chatterer/common_types/__init__.py +21 -21
  3. chatterer/common_types/io.py +19 -19
  4. chatterer/interactive.py +353 -0
  5. chatterer/language_model.py +454 -577
  6. chatterer/messages.py +21 -9
  7. chatterer/strategies/__init__.py +13 -13
  8. chatterer/strategies/atom_of_thoughts.py +975 -975
  9. chatterer/strategies/base.py +14 -14
  10. chatterer/tools/__init__.py +46 -35
  11. chatterer/tools/{webpage_to_markdown/utils.py → caption_markdown_images.py} +384 -334
  12. chatterer/tools/citation_chunking/__init__.py +3 -3
  13. chatterer/tools/citation_chunking/chunks.py +53 -53
  14. chatterer/tools/citation_chunking/citation_chunker.py +118 -118
  15. chatterer/tools/citation_chunking/citations.py +285 -285
  16. chatterer/tools/citation_chunking/prompt.py +157 -157
  17. chatterer/tools/citation_chunking/reference.py +26 -26
  18. chatterer/tools/citation_chunking/utils.py +138 -138
  19. chatterer/tools/convert_pdf_to_markdown.py +302 -0
  20. chatterer/tools/convert_to_text.py +447 -418
  21. chatterer/tools/upstage_document_parser.py +705 -438
  22. chatterer/tools/{webpage_to_markdown/playwright_bot.py → webpage_to_markdown.py} +739 -649
  23. chatterer/tools/youtube.py +147 -146
  24. chatterer/utils/__init__.py +18 -15
  25. chatterer/utils/{image.py → base64_image.py} +285 -291
  26. chatterer/utils/bytesio.py +59 -59
  27. chatterer/utils/cli.py +476 -0
  28. chatterer/utils/code_agent.py +237 -138
  29. chatterer/utils/imghdr.py +148 -0
  30. chatterer-0.1.14.dist-info/METADATA +387 -0
  31. chatterer-0.1.14.dist-info/RECORD +34 -0
  32. chatterer/tools/webpage_to_markdown/__init__.py +0 -4
  33. chatterer-0.1.13.dist-info/METADATA +0 -171
  34. chatterer-0.1.13.dist-info/RECORD +0 -31
  35. {chatterer-0.1.13.dist-info → chatterer-0.1.14.dist-info}/WHEEL +0 -0
  36. {chatterer-0.1.13.dist-info → chatterer-0.1.14.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
1
- from abc import ABC, abstractmethod
2
-
3
- from ..language_model import LanguageModelInput
4
-
5
-
6
- class BaseStrategy(ABC):
7
- @abstractmethod
8
- def invoke(self, messages: LanguageModelInput) -> str:
9
- """
10
- Invoke the strategy with the given messages.
11
-
12
- messages: List of messages to be passed to the strategy.
13
- e.g. [{"role": "user", "content": "What is the meaning of life?"}]
14
- """
1
+ from abc import ABC, abstractmethod
2
+
3
+ from ..language_model import LanguageModelInput
4
+
5
+
6
+ class BaseStrategy(ABC):
7
+ @abstractmethod
8
+ def invoke(self, messages: LanguageModelInput) -> str:
9
+ """
10
+ Invoke the strategy with the given messages.
11
+
12
+ messages: List of messages to be passed to the strategy.
13
+ e.g. [{"role": "user", "content": "What is the meaning of life?"}]
14
+ """
@@ -1,35 +1,46 @@
1
- from .citation_chunking import citation_chunker
2
- from .convert_to_text import (
3
- anything_to_markdown,
4
- get_default_html_to_markdown_options,
5
- html_to_markdown,
6
- pdf_to_text,
7
- pyscripts_to_snippets,
8
- )
9
- from .youtube import get_youtube_video_details, get_youtube_video_subtitle
10
-
11
-
12
- def init_webpage_to_markdown():
13
- from . import webpage_to_markdown
14
-
15
- return webpage_to_markdown
16
-
17
-
18
- def init_upstage_document_parser():
19
- from . import upstage_document_parser
20
-
21
- return upstage_document_parser
22
-
23
-
24
- __all__ = [
25
- "html_to_markdown",
26
- "anything_to_markdown",
27
- "pdf_to_text",
28
- "get_default_html_to_markdown_options",
29
- "pyscripts_to_snippets",
30
- "citation_chunker",
31
- "init_webpage_to_markdown",
32
- "get_youtube_video_subtitle",
33
- "get_youtube_video_details",
34
- "init_upstage_document_parser",
35
- ]
1
+ from .caption_markdown_images import MarkdownLink, acaption_markdown_images, caption_markdown_images
2
+ from .citation_chunking import citation_chunker
3
+ from .convert_pdf_to_markdown import PdfToMarkdown, extract_text_from_pdf, open_pdf, render_pdf_as_image
4
+ from .convert_to_text import (
5
+ CodeSnippets,
6
+ anything_to_markdown,
7
+ get_default_html_to_markdown_options,
8
+ html_to_markdown,
9
+ pdf_to_text,
10
+ pyscripts_to_snippets,
11
+ )
12
+ from .upstage_document_parser import UpstageDocumentParseParser
13
+ from .webpage_to_markdown import (
14
+ PlayWrightBot,
15
+ PlaywrightLaunchOptions,
16
+ PlaywrightOptions,
17
+ PlaywrightPersistencyOptions,
18
+ get_default_playwright_launch_options,
19
+ )
20
+ from .youtube import get_youtube_video_details, get_youtube_video_subtitle
21
+
22
+ __all__ = [
23
+ "html_to_markdown",
24
+ "anything_to_markdown",
25
+ "pdf_to_text",
26
+ "get_default_html_to_markdown_options",
27
+ "pyscripts_to_snippets",
28
+ "citation_chunker",
29
+ "webpage_to_markdown",
30
+ "get_youtube_video_subtitle",
31
+ "get_youtube_video_details",
32
+ "CodeSnippets",
33
+ "PlayWrightBot",
34
+ "PlaywrightLaunchOptions",
35
+ "PlaywrightOptions",
36
+ "PlaywrightPersistencyOptions",
37
+ "get_default_playwright_launch_options",
38
+ "UpstageDocumentParseParser",
39
+ "acaption_markdown_images",
40
+ "caption_markdown_images",
41
+ "MarkdownLink",
42
+ "PdfToMarkdown",
43
+ "extract_text_from_pdf",
44
+ "open_pdf",
45
+ "render_pdf_as_image",
46
+ ]