pyconverters-openai_vision 0.5.46__tar.gz → 0.5.52__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.46 → pyconverters_openai_vision-0.5.52}/PKG-INFO +1 -1
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/pyconverters_openai_vision/__init__.py +1 -1
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/pyconverters_openai_vision/openai_vision.py +15 -12
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/setup.py +1 -1
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/.dockerignore +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/.gitignore +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/Dockerfile +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/Jenkinsfile +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/README.md +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/bumpversion.py +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/pyconverters_openai_vision/openai_utils.py +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/pyproject.toml +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/__init__.py +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_alts.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_descs.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_gpt-4.1-mini.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_gpt-4.1-nano.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_gpt-4o-mini.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/ENG product fact files_general offer_2025_30pages_gpt-4o.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/PC_Kairntech_LLM_v1.md.json +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/colducoq.jpg +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/webinar.png +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/test_openai_vision.py +0 -0
- {pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tox.ini +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""OpenAIVision converter"""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.52"
|
|
@@ -396,19 +396,22 @@ class OpenAIVisionProcessorBase(ProcessorBase):
|
|
|
396
396
|
def compute_result(self, base_url, **kwargs):
|
|
397
397
|
pattern: Pattern = re.compile(r"```(?:markdown\s+)?(\W.*?)```", re.DOTALL)
|
|
398
398
|
"""Regex pattern to parse the output."""
|
|
399
|
-
response = openai_chat_completion(self.PREFIX, self.oauth_token, base_url, **kwargs)
|
|
400
|
-
contents = []
|
|
401
399
|
result = None
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
400
|
+
try:
|
|
401
|
+
response = openai_chat_completion(self.PREFIX, self.oauth_token, base_url, **kwargs)
|
|
402
|
+
contents = []
|
|
403
|
+
for choice in response.choices:
|
|
404
|
+
if choice.message.content:
|
|
405
|
+
if "```" in choice.message.content:
|
|
406
|
+
action_match = pattern.search(choice.message.content)
|
|
407
|
+
if action_match is not None:
|
|
408
|
+
contents.append(action_match.group(1).strip())
|
|
409
|
+
else:
|
|
410
|
+
contents.append(choice.message.content)
|
|
411
|
+
if contents:
|
|
412
|
+
result = "\n".join(contents)
|
|
413
|
+
except Exception:
|
|
414
|
+
logger.warning("Conversion of image failed", exc_info=True)
|
|
412
415
|
return result
|
|
413
416
|
|
|
414
417
|
def process(
|
|
@@ -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.52',
|
|
52
52
|
description='OpenAIVision converter',
|
|
53
53
|
author='Olivier Terrier',
|
|
54
54
|
author_email='olivier.terrier@kairntech.com',
|
|
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
|
{pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/colducoq.jpg
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/data/webinar.png
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.46 → pyconverters_openai_vision-0.5.52}/tests/test_openai_vision.py
RENAMED
|
File without changes
|
|
File without changes
|