pyconverters-openai_vision 0.5.38__py3-none-any.whl → 0.5.44__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.
- pyconverters_openai_vision/__init__.py +1 -1
- pyconverters_openai_vision/openai_vision.py +7 -1
- {pyconverters_openai_vision-0.5.38.dist-info → pyconverters_openai_vision-0.5.44.dist-info}/METADATA +1 -1
- pyconverters_openai_vision-0.5.44.dist-info/RECORD +7 -0
- pyconverters_openai_vision-0.5.38.dist-info/RECORD +0 -7
- {pyconverters_openai_vision-0.5.38.dist-info → pyconverters_openai_vision-0.5.44.dist-info}/WHEEL +0 -0
- {pyconverters_openai_vision-0.5.38.dist-info → pyconverters_openai_vision-0.5.44.dist-info}/entry_points.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""OpenAIVision converter"""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.44"
|
|
@@ -180,7 +180,7 @@ class OpenAIVisionConverterBase(ConverterBase):
|
|
|
180
180
|
return kwargs
|
|
181
181
|
|
|
182
182
|
def compute_result(self, base_url, **kwargs):
|
|
183
|
-
pattern: Pattern = re.compile(r"```(?:markdown
|
|
183
|
+
pattern: Pattern = re.compile(r"```(?:markdown|json|python|html)?(\W.*?)```", re.DOTALL)
|
|
184
184
|
"""Regex pattern to parse the output."""
|
|
185
185
|
response = openai_chat_completion(self.PREFIX, self.oauth_token, base_url, **kwargs)
|
|
186
186
|
contents = []
|
|
@@ -191,6 +191,12 @@ class OpenAIVisionConverterBase(ConverterBase):
|
|
|
191
191
|
action_match = pattern.search(choice.message.content)
|
|
192
192
|
if action_match is not None:
|
|
193
193
|
contents.append(action_match.group(1).strip())
|
|
194
|
+
else:
|
|
195
|
+
action_match = re.search(r"```(.*?)```", choice.message.content, re.DOTALL)
|
|
196
|
+
if action_match is not None:
|
|
197
|
+
contents.append(action_match.group(1).strip())
|
|
198
|
+
else:
|
|
199
|
+
contents.append(choice.message.content)
|
|
194
200
|
else:
|
|
195
201
|
contents.append(choice.message.content)
|
|
196
202
|
if contents:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyconverters_openai_vision/__init__.py,sha256=hBfrxG_uXGD5QstnWaOlIWJhQQVewmNJlOeSk1D4D6w,52
|
|
2
|
+
pyconverters_openai_vision/openai_utils.py,sha256=XI4WYZ-EAVG0Vxd5yUDuZNDgEzqHJeriScxTUusi1oo,7740
|
|
3
|
+
pyconverters_openai_vision/openai_vision.py,sha256=GLV7CsovwVlrqD9HpmKmsoTwJ9jWLwfIbJESx6Q1uHU,23696
|
|
4
|
+
pyconverters_openai_vision-0.5.44.dist-info/entry_points.txt,sha256=NR0re-yebKKyhApky1I6nDQzjJQfEyfOkJlJju0Ngzo,404
|
|
5
|
+
pyconverters_openai_vision-0.5.44.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
6
|
+
pyconverters_openai_vision-0.5.44.dist-info/METADATA,sha256=ybqHUZCL9oKAGYAauD3z_EGgFY0hwKqEsnStYWXh4sY,2662
|
|
7
|
+
pyconverters_openai_vision-0.5.44.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pyconverters_openai_vision/__init__.py,sha256=3A5S776Ll53ppRREl4pWtKE_bidstJRi9FI6GEKawAU,52
|
|
2
|
-
pyconverters_openai_vision/openai_utils.py,sha256=XI4WYZ-EAVG0Vxd5yUDuZNDgEzqHJeriScxTUusi1oo,7740
|
|
3
|
-
pyconverters_openai_vision/openai_vision.py,sha256=1wrjAhTpHdldkcW8BtdZhUgKowJPAoFoP4lQjKPI9nA,23330
|
|
4
|
-
pyconverters_openai_vision-0.5.38.dist-info/entry_points.txt,sha256=NR0re-yebKKyhApky1I6nDQzjJQfEyfOkJlJju0Ngzo,404
|
|
5
|
-
pyconverters_openai_vision-0.5.38.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
6
|
-
pyconverters_openai_vision-0.5.38.dist-info/METADATA,sha256=FlMVJfyWLJouofO0ECVmFnfNdsrThhUIh8oOMh7eoYg,2662
|
|
7
|
-
pyconverters_openai_vision-0.5.38.dist-info/RECORD,,
|
{pyconverters_openai_vision-0.5.38.dist-info → pyconverters_openai_vision-0.5.44.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|