lm-deluge 0.0.6__tar.gz → 0.0.7__tar.gz
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.
Potentially problematic release.
This version of lm-deluge might be problematic. Click here for more details.
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/PKG-INFO +3 -10
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/README.md +0 -5
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/pyproject.toml +2 -7
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge.egg-info/PKG-INFO +3 -10
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge.egg-info/SOURCES.txt +0 -1
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge.egg-info/requires.txt +0 -3
- lm_deluge-0.0.6/src/lm_deluge/util/pdf.py +0 -45
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/setup.cfg +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/__init__.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/__init__.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/anthropic.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/base.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/common.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/deprecated/bedrock.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/deprecated/cohere.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/deprecated/deepseek.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/deprecated/mistral.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/deprecated/vertex.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/mistral.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/api_requests/openai.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/cache.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/client.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/embed.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/errors.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/gemini_limits.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/image.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/llm_tools/__init__.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/llm_tools/extract.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/llm_tools/score.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/llm_tools/translate.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/models.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/prompt.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/rerank.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/sampling_params.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/tool.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/tracker.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/util/json.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/util/logprobs.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/util/validation.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge/util/xml.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge.egg-info/dependency_links.txt +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/src/lm_deluge.egg-info/top_level.txt +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_all_models.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_cache.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_image_models.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_image_utils.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_json_utils.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_sampling_params.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_translate.py +0 -0
- {lm_deluge-0.0.6 → lm_deluge-0.0.7}/tests/test_xml_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lm_deluge
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: Python utility for using LLM API models.
|
|
5
5
|
Author-email: Benjamin Anderson <ben@trytaylor.ai>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -20,10 +20,8 @@ Requires-Dist: bs4
|
|
|
20
20
|
Requires-Dist: lxml
|
|
21
21
|
Requires-Dist: pdf2image
|
|
22
22
|
Requires-Dist: pillow
|
|
23
|
-
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: fasttext-wheel; extra == "full"
|
|
26
|
-
Requires-Dist: fasttext-langdetect; extra == "full"
|
|
23
|
+
Requires-Dist: fasttext-wheel
|
|
24
|
+
Requires-Dist: fasttext-langdetect
|
|
27
25
|
|
|
28
26
|
# lm_deluge
|
|
29
27
|
|
|
@@ -44,11 +42,6 @@ Requires-Dist: fasttext-langdetect; extra == "full"
|
|
|
44
42
|
pip install lm-deluge
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
There are optional goodies. If you want support for PDFs and language-detection via FastText:
|
|
48
|
-
```bash
|
|
49
|
-
pip install "lm-deluge[full]"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
45
|
The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GOOGLE_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables.
|
|
53
46
|
|
|
54
47
|
## Quickstart
|
|
@@ -17,11 +17,6 @@
|
|
|
17
17
|
pip install lm-deluge
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
There are optional goodies. If you want support for PDFs and language-detection via FastText:
|
|
21
|
-
```bash
|
|
22
|
-
pip install "lm-deluge[full]"
|
|
23
|
-
```
|
|
24
|
-
|
|
25
20
|
The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GOOGLE_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables.
|
|
26
21
|
|
|
27
22
|
## Quickstart
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "lm_deluge"
|
|
6
|
-
version = "0.0.
|
|
6
|
+
version = "0.0.7"
|
|
7
7
|
authors = [{ name = "Benjamin Anderson", email = "ben@trytaylor.ai" }]
|
|
8
8
|
description = "Python utility for using LLM API models."
|
|
9
9
|
readme = "README.md"
|
|
@@ -26,12 +26,7 @@ dependencies = [
|
|
|
26
26
|
"bs4",
|
|
27
27
|
"lxml",
|
|
28
28
|
"pdf2image",
|
|
29
|
-
"pillow"
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
[project.optional-dependencies]
|
|
33
|
-
full = [
|
|
34
|
-
"pymupdf",
|
|
29
|
+
"pillow",
|
|
35
30
|
"fasttext-wheel",
|
|
36
31
|
"fasttext-langdetect",
|
|
37
32
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lm_deluge
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: Python utility for using LLM API models.
|
|
5
5
|
Author-email: Benjamin Anderson <ben@trytaylor.ai>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -20,10 +20,8 @@ Requires-Dist: bs4
|
|
|
20
20
|
Requires-Dist: lxml
|
|
21
21
|
Requires-Dist: pdf2image
|
|
22
22
|
Requires-Dist: pillow
|
|
23
|
-
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: fasttext-wheel; extra == "full"
|
|
26
|
-
Requires-Dist: fasttext-langdetect; extra == "full"
|
|
23
|
+
Requires-Dist: fasttext-wheel
|
|
24
|
+
Requires-Dist: fasttext-langdetect
|
|
27
25
|
|
|
28
26
|
# lm_deluge
|
|
29
27
|
|
|
@@ -44,11 +42,6 @@ Requires-Dist: fasttext-langdetect; extra == "full"
|
|
|
44
42
|
pip install lm-deluge
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
There are optional goodies. If you want support for PDFs and language-detection via FastText:
|
|
48
|
-
```bash
|
|
49
|
-
pip install "lm-deluge[full]"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
45
|
The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GOOGLE_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables.
|
|
53
46
|
|
|
54
47
|
## Quickstart
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import io
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def text_from_pdf(pdf: str | bytes | io.BytesIO):
|
|
5
|
-
"""
|
|
6
|
-
Extract text from a PDF. Does NOT use OCR, extracts the literal text.
|
|
7
|
-
The source can be:
|
|
8
|
-
- A file path (str)
|
|
9
|
-
- Bytes of a PDF file
|
|
10
|
-
- A BytesIO object containing a PDF file
|
|
11
|
-
"""
|
|
12
|
-
try:
|
|
13
|
-
import pymupdf # pyright: ignore
|
|
14
|
-
except ImportError:
|
|
15
|
-
raise ImportError(
|
|
16
|
-
"pymupdf is required to extract text from PDFs. Install lm_deluge[pdf] or lm_deluge[full]."
|
|
17
|
-
)
|
|
18
|
-
if isinstance(pdf, str):
|
|
19
|
-
# It's a file path
|
|
20
|
-
doc = pymupdf.open(pdf)
|
|
21
|
-
elif isinstance(pdf, (bytes, io.BytesIO)):
|
|
22
|
-
# It's bytes or a BytesIO object
|
|
23
|
-
if isinstance(pdf, bytes):
|
|
24
|
-
pdf = io.BytesIO(pdf)
|
|
25
|
-
doc = pymupdf.open(stream=pdf, filetype="pdf")
|
|
26
|
-
else:
|
|
27
|
-
raise ValueError("Unsupported pdf_source type. Must be str, bytes, or BytesIO.")
|
|
28
|
-
|
|
29
|
-
text_content = []
|
|
30
|
-
for page in doc:
|
|
31
|
-
blocks = page.get_text("blocks", sort=True)
|
|
32
|
-
for block in blocks:
|
|
33
|
-
# block[4] contains the text content
|
|
34
|
-
text_content.append(block[4].strip())
|
|
35
|
-
text_content.append("\n") # Add extra newlines between blocks
|
|
36
|
-
|
|
37
|
-
# Join all text content with newlines
|
|
38
|
-
full_text = "\n".join(text_content).strip()
|
|
39
|
-
# Replace multiple consecutive spaces with a single space
|
|
40
|
-
full_text = " ".join(full_text.split())
|
|
41
|
-
# Clean up any resulting double spaces or newlines
|
|
42
|
-
full_text = " ".join([x for x in full_text.split(" ") if x])
|
|
43
|
-
full_text = "\n".join([x for x in full_text.split("\n") if x])
|
|
44
|
-
|
|
45
|
-
return full_text
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|