pyconverters-openai_vision 0.5.34__tar.gz → 0.5.36__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.
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/PKG-INFO +1 -1
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/pyconverters_openai_vision/__init__.py +1 -1
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/pyconverters_openai_vision/openai_vision.py +12 -2
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/setup.py +1 -1
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/ENG product fact files_general offer_2025_30pages_alts.json +20 -20
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/.dockerignore +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/.gitignore +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/Dockerfile +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/Jenkinsfile +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/README.md +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/bumpversion.py +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/pyconverters_openai_vision/openai_utils.py +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/pyproject.toml +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/__init__.py +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/ENG product fact files_general offer_2025_30pages.json +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/ENG product fact files_general offer_2025_30pages_descs.json +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/PC_Kairntech_LLM_v1.md.json +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/colducoq.jpg +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/webinar.png +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/test_openai_vision.py +0 -0
- {pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tox.ini +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""OpenAIVision converter"""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.36"
|
|
@@ -147,6 +147,10 @@ class OpenAIVisionConverterBase(ConverterBase):
|
|
|
147
147
|
PREFIX: str = ""
|
|
148
148
|
oauth_token: OAuthToken = OAuthToken()
|
|
149
149
|
|
|
150
|
+
@classmethod
|
|
151
|
+
def is_model_gpt_5_model(cls, model: str) -> bool:
|
|
152
|
+
return "gpt-5" in model
|
|
153
|
+
|
|
150
154
|
def compute_args(self, params: OpenAIVisionBaseParameters, source: UploadFile, kind
|
|
151
155
|
) -> Dict[str, Any]:
|
|
152
156
|
data = source.file.read()
|
|
@@ -167,10 +171,11 @@ class OpenAIVisionConverterBase(ConverterBase):
|
|
|
167
171
|
},
|
|
168
172
|
binary_block
|
|
169
173
|
]})
|
|
174
|
+
max_tokens_param = 'max_completion_tokens' if self.is_model_gpt_5_model(params.model_str) else 'max_tokens'
|
|
170
175
|
kwargs = {
|
|
171
176
|
'model': params.model_str,
|
|
172
177
|
'messages': messages,
|
|
173
|
-
|
|
178
|
+
max_tokens_param: params.max_tokens,
|
|
174
179
|
'temperature': params.temperature,
|
|
175
180
|
'top_p': params.top_p,
|
|
176
181
|
'n': params.n,
|
|
@@ -357,6 +362,10 @@ class OpenAIVisionProcessorBase(ProcessorBase):
|
|
|
357
362
|
PREFIX: str = ""
|
|
358
363
|
oauth_token: OAuthToken = OAuthToken()
|
|
359
364
|
|
|
365
|
+
@classmethod
|
|
366
|
+
def is_model_gpt_5_model(cls, model: str) -> bool:
|
|
367
|
+
return "gpt-5" in model
|
|
368
|
+
|
|
360
369
|
def compute_args(self, params: OpenAIVisionProcessorBaseParameters, source: str, kind
|
|
361
370
|
) -> Dict[str, Any]:
|
|
362
371
|
if kind.mime.startswith("image"):
|
|
@@ -375,10 +384,11 @@ class OpenAIVisionProcessorBase(ProcessorBase):
|
|
|
375
384
|
},
|
|
376
385
|
binary_block
|
|
377
386
|
]})
|
|
387
|
+
max_tokens_param = 'max_completion_tokens' if self.is_model_gpt_5_model(params.model_str) else 'max_tokens'
|
|
378
388
|
kwargs = {
|
|
379
389
|
'model': params.model_str,
|
|
380
390
|
'messages': messages,
|
|
381
|
-
|
|
391
|
+
max_tokens_param: params.max_tokens,
|
|
382
392
|
'temperature': params.temperature,
|
|
383
393
|
'top_p': params.top_p,
|
|
384
394
|
'n': params.n,
|
|
@@ -48,7 +48,7 @@ entry_points = \
|
|
|
48
48
|
'pyconverters_openai_vision.openai_vision:OpenAIVisionProcessor']}
|
|
49
49
|
|
|
50
50
|
setup(name='pyconverters-openai_vision',
|
|
51
|
-
version='0.5.
|
|
51
|
+
version='0.5.36',
|
|
52
52
|
description='OpenAIVision converter',
|
|
53
53
|
author='Olivier Terrier',
|
|
54
54
|
author_email='olivier.terrier@kairntech.com',
|
|
@@ -132,83 +132,83 @@
|
|
|
132
132
|
"altTexts": [
|
|
133
133
|
{
|
|
134
134
|
"name": "img-0.jpeg",
|
|
135
|
-
"text": "The image features a rhythmic gymnast in mid-performance, showcasing a dynamic pose. The gymnast is wearing a sparkling, intricately designed costume that is predominantly pink and adorned with
|
|
135
|
+
"text": "The image features a rhythmic gymnast in mid-performance, showcasing a dynamic pose. The gymnast is wearing a sparkling, intricately designed costume that is predominantly pink and adorned with sequins and embellishments. The outfit has a fitted bodice and a flared skirt, enhancing the elegance of the movement. \n\nInstead of a head, there is a large, shiny pink ball positioned where the head would typically be, creating a surreal and whimsical effect. The gymnast's arms are gracefully extended, and one leg is lifted, emphasizing the fluidity and artistry of the routine. The background is a soft, neutral color, which helps to highlight the vibrant costume and the gymnast's athletic form."
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"name": "img-1.jpeg",
|
|
139
|
-
"text": "The image features a textual layout with a black background at the top displaying the year \"2025\" in large, bold, white font. Below that, in a slightly smaller font, the words \"GENERAL S\" are presented, also in white. The bottom section of the image
|
|
139
|
+
"text": "The image features a textual layout with a black background at the top displaying the year \"2025\" in large, bold, white font. Below that, in a slightly smaller font, the words \"GENERAL S\" are presented, also in white. The bottom section of the image has a light blue background with the text \"PRODUCT FACT FIL\" in bold, black letters, suggesting it may be part of a product information document or label. The overall design is clean and modern, emphasizing clarity and readability."
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"name": "img-2.jpeg",
|
|
143
|
-
"text": "The image presents a pie chart illustrating the distribution of stories published per day
|
|
143
|
+
"text": "The image presents a pie chart illustrating the distribution of stories published per day, totaling 292 stories (excluding updates). The chart is divided into segments, each representing a different language:\n\n- **Arabic**: 35% (largest segment, colored blue)\n- **English**: 20% (colored orange)\n- **Spanish**: 16% (colored purple)\n- **French**: 14% (colored pink)\n- **German**: 10% (colored light blue)\n- **Portuguese**: 5% (smallest segment, colored yellow)\n\nThe chart visually emphasizes the proportion of stories in each language, with Arabic having the highest share. The title and the percentage labels are clearly displayed, providing a straightforward overview of the data."
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
"name": "img-3.jpeg",
|
|
147
|
-
"text": "The image is a pie chart
|
|
147
|
+
"text": "The image is a pie chart that visually represents the distribution of various sports. The largest segment, colored blue, occupies 57% of the chart and is labeled as \"Football.\" \n\nOther segments include:\n\n- \"Athletics\" (light blue) at 2%\n- \"Basketball\" (black) at 7%\n- \"Cycling\" (gray) at 3%\n- \"Handball\" (yellow) at 6%\n- \"Motor sports\" (purple) at 6%\n- \"Ski\" (light purple) at 6%\n- \"Tennis\" (green) at 6%\n- \"Olympics\" (orange) at 8%\n\nEach segment is accompanied by its respective percentage, indicating the proportion of interest or participation in each sport. The chart uses a variety of colors to differentiate between the sports clearly."
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "img-4.jpeg",
|
|
151
|
-
"text": "The image presents a
|
|
151
|
+
"text": "The image presents a pie chart alongside a textual description. The chart illustrates the distribution of reports per day (excluding updates) across various sports, totaling over 30 reports. \n\n- The largest segment, colored blue, represents Football, accounting for 67% of the reports.\n- The next largest segment is in orange, indicating Motor sports at 9%.\n- Following that, there are smaller segments for Basketball (8%), Athletics (7%), and Tennis (7%).\n- The smallest segment, colored purple, represents the Olympics, contributing 2% to the total.\n\nThe chart effectively visualizes the dominance of Football in the reporting landscape, while also highlighting the presence of other sports."
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
"name": "img-5.jpeg",
|
|
155
|
-
"text": "The image presents a visual representation of the distribution of photos taken per day across various sports. At the top left, it states \"1,490 photos per day\" in bold, emphasizing the total number of photos. \n\nTo the right,
|
|
155
|
+
"text": "The image presents a visual representation of the distribution of photos taken per day across various sports. At the top left, it states \"1,490 photos per day\" in bold, emphasizing the total number of photos captured. \n\nTo the right, a pie chart illustrates the percentage breakdown of these photos by sport. The segments are color-coded and labeled as follows:\n\n- **Football** (blue) accounts for the largest portion at 39%.\n- **Basketball** (black) follows with 22%.\n- **Motor sports** (purple) makes up 11%.\n- **Cycling** (pink) represents 9%.\n- **Athletics** (orange) is at 7%.\n- **Tennis** (light blue) and **Rugby** (green) each contribute 3%.\n- **Cricket** (red) also holds 4%.\n- The **Olympics** (cyan) is represented by a small segment at 2%.\n\nOverall, the chart provides a clear visual summary of the prevalence of different sports in daily photography."
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
"name": "img-6.jpeg",
|
|
159
|
-
"text": "The image features a logo
|
|
159
|
+
"text": "The image features a simple logo on a bright yellow background. The text \"AFP\" is displayed in bold blue letters, followed by a blue circle, and then the word \"Sports\" in black letters. The overall design is clean and modern, emphasizing the \"AFP\" branding prominently."
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
"name": "img-7.jpeg",
|
|
163
|
-
"text": "The image features a pie chart
|
|
163
|
+
"text": "The image features a pie chart that illustrates the distribution of infographics created per day in different languages. The chart is divided into five segments, each representing a language:\n\n- **German**: 24% (yellow segment)\n- **English**: 24% (purple segment)\n- **Spanish**: 21% (light blue segment)\n- **French**: 16% (orange segment)\n- **Portuguese**: 15% (blue segment)\n\nTo the left of the pie chart, there is a statement indicating that an average of 6 infographics are produced each day. The percentages in the segments reflect the proportion of infographics attributed to each language."
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
"name": "img-8.jpeg",
|
|
167
|
-
"text": "The image presents a pie chart illustrating the distribution of videographics produced per year, totaling 75. The chart is divided into five segments, each representing a different language:\n\n- **
|
|
167
|
+
"text": "The image presents a pie chart illustrating the distribution of videographics produced per year, totaling 75. The chart is divided into five segments, each representing a different language:\n\n- **German**: This segment is colored light blue and accounts for 4% of the total.\n- **English**: Represented in orange, this segment makes up 27%.\n- **Spanish**: Shown in blue, this portion comprises 28%.\n- **French**: This segment is colored yellow and represents 16%.\n- **Portuguese**: Illustrated in red, this segment accounts for 25%.\n\nThe overall message emphasizes the annual production of 75 videographics, with the pie chart visually breaking down the contributions by language."
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"name": "img-9.jpeg",
|
|
171
|
-
"text": "The image features a clean, minimalist design with three sections, each
|
|
171
|
+
"text": "The image features a clean, minimalist design with three sections, each set against a black background. \n\n1. The first section highlights \"Coverage\" with the text \"24 hours a day\" and \"7 days a week,\" emphasizing continuous availability.\n2. The second section states \"+ 300* editable videos per month,\" indicating a high volume of video content that can be customized.\n3. The third section mentions \"130 video production points worldwide,\" suggesting a global reach and extensive network for video production.\n\nThe text is presented in a bold, white font, making it easily readable against the dark background."
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
"name": "img-10.jpeg",
|
|
175
|
-
"text": "The image features a
|
|
175
|
+
"text": "The image features a clean and modern design with a black background. It presents three key points, each highlighted in white text. \n\n1. The first section emphasizes \"Coverage\" with the details \"24 hours a day\" and \"7 days a week,\" indicating continuous availability.\n2. The second section states \"3 Thematic sections,\" suggesting a structured approach to content organization.\n3. The final section notes \"+15* articles illustrated per day,\" implying a high volume of visual content produced daily.\n\nOverall, the layout is straightforward, focusing on clarity and easy readability."
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"name": "img-11.jpeg",
|
|
179
|
-
"text": "The image
|
|
179
|
+
"text": "The image features a pie chart divided into eight segments, each representing a different percentage. The segments are colored in various shades: \n\n- The largest segment, colored light blue, occupies 32% of the chart.\n- Next is a yellow segment at 17%.\n- A red segment follows at 14%.\n- The blue segment represents 12%.\n- There are three smaller segments, each at 7%, colored in orange, green, and a light purple.\n- Finally, a segment colored dark purple represents 11%.\n\nEach segment is labeled with its corresponding percentage, providing a clear visual representation of the data distribution."
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
"name": "img-12.jpeg",
|
|
183
|
-
"text": "The image features a sleek, modern design with a black background. It presents four key pieces of information in
|
|
183
|
+
"text": "The image features a sleek, modern design with a black background. It presents four key pieces of information, each enclosed in a rectangular box. \n\n1. The first box states \"Coverage\" followed by \"24 hours a day\" and \"7 days a week,\" emphasizing continuous availability.\n2. The second box highlights \"5\" in a larger font, accompanied by the phrase \"Thematic sections,\" indicating a structured approach to content.\n3. The third box notes \"+ 60*\" in bold, with the phrase \"articles illustrated per day,\" suggesting a high volume of daily content production.\n\nThe overall layout is clean and visually appealing, with white text contrasting against the black background for easy readability."
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
"name": "img-13.jpeg",
|
|
187
|
-
"text": "The image is a pie chart divided into several segments, each representing a percentage of a whole. The
|
|
187
|
+
"text": "The image is a pie chart divided into several segments, each representing a different percentage of a whole. The largest segment, colored blue, occupies 35% of the chart. Other segments include:\n\n- A purple segment at 15%\n- Two segments at 10% each, one in a dark gray and the other in a light blue\n- A black segment at 9%\n- An orange segment at 8%\n- A yellow segment at 5%\n- Two smaller segments, each at 3%, one in green and the other in a light teal.\n\nThe percentages are displayed prominently within each segment, providing a clear visual representation of the data distribution."
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
"name": "img-14.jpeg",
|
|
191
|
-
"text": "The image features a clean and modern design with three
|
|
191
|
+
"text": "The image features a clean and modern design with a black background. It presents three key pieces of information, each enclosed in a rectangular box. \n\n1. The first box states \"Coverage\" followed by \"6am to midnight,\" indicating the hours of operation or availability.\n2. The second box highlights \"6 Thematic sections,\" suggesting that the content is organized into six distinct categories or topics.\n3. The third box notes \"+ 45* articles illustrated per day,\" implying a high volume of daily content that is visually represented.\n\nThe text is displayed in a mix of bold and regular fonts, emphasizing the important details while maintaining a cohesive and professional appearance."
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
"name": "img-15.jpeg",
|
|
195
|
-
"text": "The image is a pie chart
|
|
195
|
+
"text": "The image is a pie chart representing the distribution of various sports. Each segment of the chart is color-coded and labeled with a percentage indicating its proportion of the total.\n\n- **Football** occupies the largest segment at **31%**, represented in blue.\n- **Athletics** follows with **21%**, shown in light blue.\n- **Cycling** and **Motor sports** each account for **6%**, depicted in gray and yellow, respectively.\n- **Basketball** is represented by a small segment at **5%**, shown in pink.\n- **Tennis** makes up **14%**, illustrated in purple.\n- **Olympics** holds a segment of **17%**, colored in orange.\n\nThe chart effectively visualizes the popularity or participation rates of these sports in a clear and colorful manner."
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"name": "img-16.jpeg",
|
|
199
|
-
"text": "The image features
|
|
199
|
+
"text": "The image features a minimalist design with a black background and white text. It presents three key points in a structured format:\n\n1. **Coverage**: The text states \"6am to midnight,\" indicating the hours of operation or coverage.\n2. **Thematic Sections**: The number \"2\" is highlighted, suggesting that there are two distinct thematic sections included.\n3. **Articles Illustrated**: The phrase \"+ 15* articles illustrated per day\" indicates a commitment to producing a significant number of illustrated articles daily.\n\nThe overall layout is clean and straightforward, emphasizing clarity and easy readability."
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"name": "img-17.jpeg",
|
|
203
|
-
"text": "The image is a pie chart divided into several segments, each representing a percentage of a whole. The largest segment, colored blue, occupies 62% of the chart.
|
|
203
|
+
"text": "The image is a pie chart divided into several segments, each representing a percentage of a whole. The largest segment, colored blue, occupies 62% of the chart. The next largest segment is red, representing 15%. Following that, there is a purple segment at 12%. Smaller segments include an orange section at 9%, and three tiny segments colored yellow, light blue, and another color, each representing 1%. The percentages are labeled within or near their respective segments, providing a clear visual representation of the data distribution."
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
206
|
"name": "img-18.jpeg",
|
|
207
|
-
"text": "The image features a minimalist design with a black background and white text. It presents three key points related to coverage and content:\n\n1. **Coverage**: The text states \"
|
|
207
|
+
"text": "The image features a minimalist design with a black background and white text. It presents three key points related to coverage and content:\n\n1. **Coverage**: The text states \"6am to midnight,\" indicating the hours of operation or availability.\n2. **Thematic Sections**: The number \"1\" is highlighted, suggesting that there is one main thematic section.\n3. **Articles**: The phrase \"+ 10* articles illustrated per day\" indicates that more than ten articles are illustrated daily, emphasizing the volume of content produced.\n\nOverall, the layout is clean and straightforward, focusing on the essential information without any additional graphics or distractions."
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"name": "img-19.jpeg",
|
|
211
|
-
"text": "The image is a pie chart
|
|
211
|
+
"text": "The image is a pie chart displaying the distribution of different sports. The largest segment, colored blue, represents \"Football,\" accounting for 56% of the total. Other segments include:\n\n- \"Athletics\" (purple) at 3%\n- \"Basketball\" (orange) at 12%\n- \"Motor sports\" (yellow) at 10%\n- \"Tennis\" (red) at 11%\n- \"Olympics\" (green) at 8%\n\nEach segment is labeled with its corresponding percentage, providing a clear visual representation of the proportions of interest in these sports."
|
|
212
212
|
}
|
|
213
213
|
]
|
|
214
214
|
}
|
|
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
|
{pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/colducoq.jpg
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/data/webinar.png
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.34 → pyconverters_openai_vision-0.5.36}/tests/test_openai_vision.py
RENAMED
|
File without changes
|
|
File without changes
|