attachments 0.2.2__tar.gz → 0.2.3__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.
- {attachments-0.2.2/src/attachments.egg-info → attachments-0.2.3}/PKG-INFO +35 -1
- {attachments-0.2.2 → attachments-0.2.3}/README.md +34 -0
- {attachments-0.2.2 → attachments-0.2.3}/pyproject.toml +1 -1
- {attachments-0.2.2 → attachments-0.2.3/src/attachments.egg-info}/PKG-INFO +35 -1
- {attachments-0.2.2 → attachments-0.2.3}/LICENSE +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/setup.cfg +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/__init__.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/audio_processing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/config.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/core.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/detectors.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/exceptions.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/image_processing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/office_contact_sheet.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/parsers.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/renderers.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments/utils.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/SOURCES.txt +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/dependency_links.txt +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/requires.txt +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/top_level.txt +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_audio_processing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_base.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_core_functionality.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_document_parsing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_html_parsing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_image_processing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_indexing_slicing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_markdown_rendering.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_office_contact_sheet.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_pdf_parsing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_pptx_parsing.py +0 -0
- {attachments-0.2.2 → attachments-0.2.3}/tests/test_simple.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: attachments
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A Python library to handle various file types for LLMs.
|
|
5
5
|
Author-email: Maxim Rivest <mrive052@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -88,6 +88,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
|
|
|
88
88
|
response.output_text
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
+
## How to give attachments to anthropic llms?
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import anthropic
|
|
95
|
+
from attachments import Attachments
|
|
96
|
+
|
|
97
|
+
pptx_file = Attachments(
|
|
98
|
+
"https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
|
|
99
|
+
|
|
100
|
+
prompt = f"""
|
|
101
|
+
Analyze the following documents:
|
|
102
|
+
{pptx_file}
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
content = [
|
|
106
|
+
{
|
|
107
|
+
"type": "image",
|
|
108
|
+
"source": {
|
|
109
|
+
"type": "base64",
|
|
110
|
+
"media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
|
|
111
|
+
"data": image.split(",")[1] # this is ugly but it works
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for image in pptx_file.images
|
|
115
|
+
] + [{"type": "text", "text": prompt}]
|
|
116
|
+
|
|
117
|
+
message = anthropic.Anthropic().messages.create(
|
|
118
|
+
max_tokens=8192,
|
|
119
|
+
model="claude-3-5-haiku-20241022",
|
|
120
|
+
messages=[{"role": "user", "content": content}])
|
|
121
|
+
print(message.content)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
|
|
91
125
|
## Usage
|
|
92
126
|
|
|
93
127
|
### Basic Initialization
|
|
@@ -49,6 +49,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
|
|
|
49
49
|
response.output_text
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## How to give attachments to anthropic llms?
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import anthropic
|
|
56
|
+
from attachments import Attachments
|
|
57
|
+
|
|
58
|
+
pptx_file = Attachments(
|
|
59
|
+
"https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
|
|
60
|
+
|
|
61
|
+
prompt = f"""
|
|
62
|
+
Analyze the following documents:
|
|
63
|
+
{pptx_file}
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
content = [
|
|
67
|
+
{
|
|
68
|
+
"type": "image",
|
|
69
|
+
"source": {
|
|
70
|
+
"type": "base64",
|
|
71
|
+
"media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
|
|
72
|
+
"data": image.split(",")[1] # this is ugly but it works
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for image in pptx_file.images
|
|
76
|
+
] + [{"type": "text", "text": prompt}]
|
|
77
|
+
|
|
78
|
+
message = anthropic.Anthropic().messages.create(
|
|
79
|
+
max_tokens=8192,
|
|
80
|
+
model="claude-3-5-haiku-20241022",
|
|
81
|
+
messages=[{"role": "user", "content": content}])
|
|
82
|
+
print(message.content)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
|
|
52
86
|
## Usage
|
|
53
87
|
|
|
54
88
|
### Basic Initialization
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: attachments
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A Python library to handle various file types for LLMs.
|
|
5
5
|
Author-email: Maxim Rivest <mrive052@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -88,6 +88,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
|
|
|
88
88
|
response.output_text
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
+
## How to give attachments to anthropic llms?
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import anthropic
|
|
95
|
+
from attachments import Attachments
|
|
96
|
+
|
|
97
|
+
pptx_file = Attachments(
|
|
98
|
+
"https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
|
|
99
|
+
|
|
100
|
+
prompt = f"""
|
|
101
|
+
Analyze the following documents:
|
|
102
|
+
{pptx_file}
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
content = [
|
|
106
|
+
{
|
|
107
|
+
"type": "image",
|
|
108
|
+
"source": {
|
|
109
|
+
"type": "base64",
|
|
110
|
+
"media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
|
|
111
|
+
"data": image.split(",")[1] # this is ugly but it works
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for image in pptx_file.images
|
|
115
|
+
] + [{"type": "text", "text": prompt}]
|
|
116
|
+
|
|
117
|
+
message = anthropic.Anthropic().messages.create(
|
|
118
|
+
max_tokens=8192,
|
|
119
|
+
model="claude-3-5-haiku-20241022",
|
|
120
|
+
messages=[{"role": "user", "content": content}])
|
|
121
|
+
print(message.content)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
|
|
91
125
|
## Usage
|
|
92
126
|
|
|
93
127
|
### Basic Initialization
|
|
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
|