pyconverters-openai_vision 0.5.38__py3-none-any.whl → 0.5.40__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.
@@ -1,2 +1,2 @@
1
1
  """OpenAIVision converter"""
2
- __version__ = "0.5.38"
2
+ __version__ = "0.5.40"
@@ -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\s+)?(\W.*?)```", re.DOTALL)
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyconverters-openai_vision
3
- Version: 0.5.38
3
+ Version: 0.5.40
4
4
  Summary: OpenAIVision converter
5
5
  Home-page: https://kairntech.com/
6
6
  Author: Olivier Terrier
@@ -0,0 +1,7 @@
1
+ pyconverters_openai_vision/__init__.py,sha256=nllf2jeljyeVthNdUtweGUh38v8sV1ezGTwnUTROXMc,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.40.dist-info/entry_points.txt,sha256=NR0re-yebKKyhApky1I6nDQzjJQfEyfOkJlJju0Ngzo,404
5
+ pyconverters_openai_vision-0.5.40.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
6
+ pyconverters_openai_vision-0.5.40.dist-info/METADATA,sha256=qrtL9hAuepmZMVz-Vyp7qZEhOs0ljksMGZxjluAkfTE,2662
7
+ pyconverters_openai_vision-0.5.40.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,,