pyconverters-openai_vision 0.5.30__py3-none-any.whl → 0.5.34__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 +9 -8
- {pyconverters_openai_vision-0.5.30.dist-info → pyconverters_openai_vision-0.5.34.dist-info}/METADATA +1 -1
- pyconverters_openai_vision-0.5.34.dist-info/RECORD +7 -0
- {pyconverters_openai_vision-0.5.30.dist-info → pyconverters_openai_vision-0.5.34.dist-info}/entry_points.txt +2 -2
- pyconverters_openai_vision-0.5.30.dist-info/RECORD +0 -7
- {pyconverters_openai_vision-0.5.30.dist-info → pyconverters_openai_vision-0.5.34.dist-info}/WHEEL +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""OpenAIVision converter"""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.34"
|
|
@@ -155,7 +155,7 @@ class OpenAIVisionConverterBase(ConverterBase):
|
|
|
155
155
|
binary_block = {
|
|
156
156
|
"type": "image_url",
|
|
157
157
|
"image_url": {
|
|
158
|
-
"url": f"data:
|
|
158
|
+
"url": f"data:{kind.mime};base64,{rv.decode('utf-8')}"
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
messages = [{"role": "system", "content": params.system_prompt}] if params.system_prompt is not None else []
|
|
@@ -287,11 +287,6 @@ class OpenAIVisionProcessorBaseParameters(ProcessorParameters):
|
|
|
287
287
|
model: str = Field(
|
|
288
288
|
None, extra="internal"
|
|
289
289
|
)
|
|
290
|
-
prompt: str = Field(
|
|
291
|
-
"""If the attached file is an image: describe the image.""",
|
|
292
|
-
description="""Contains the prompt as a string""",
|
|
293
|
-
extra="multiline",
|
|
294
|
-
)
|
|
295
290
|
max_tokens: int = Field(
|
|
296
291
|
16384,
|
|
297
292
|
description="""The maximum number of tokens to generate in the completion.
|
|
@@ -308,6 +303,11 @@ class OpenAIVisionProcessorBaseParameters(ProcessorParameters):
|
|
|
308
303
|
description="""Contains the system prompt""",
|
|
309
304
|
extra="multiline,advanced",
|
|
310
305
|
)
|
|
306
|
+
prompt: str = Field(
|
|
307
|
+
"Generate a textual description of the image",
|
|
308
|
+
description="""Contains the prompt""",
|
|
309
|
+
extra="multiline",
|
|
310
|
+
)
|
|
311
311
|
temperature: float = Field(
|
|
312
312
|
0.1,
|
|
313
313
|
description="""What sampling temperature to use, between 0 and 2.
|
|
@@ -446,8 +446,9 @@ class OpenAIVisionProcessorBase(ProcessorBase):
|
|
|
446
446
|
m = matchobj.group(0)
|
|
447
447
|
m_id = matchobj.group(1)
|
|
448
448
|
if m_id in alts:
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
# markdown blockquote
|
|
450
|
+
m_desc = "\n".join(["> " + li for li in alts[m_id].splitlines()])
|
|
451
|
+
return f"{m}\n{m_desc}\n"
|
|
451
452
|
return m
|
|
452
453
|
|
|
453
454
|
ptext = re.sub(link_regex, convert_links, text, 0,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyconverters_openai_vision/__init__.py,sha256=P6tzrDdFYeRIdqRSjEScaB_11FMag8S6GgFb3bfoV3E,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.34.dist-info/entry_points.txt,sha256=NR0re-yebKKyhApky1I6nDQzjJQfEyfOkJlJju0Ngzo,404
|
|
5
|
+
pyconverters_openai_vision-0.5.34.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
6
|
+
pyconverters_openai_vision-0.5.34.dist-info/METADATA,sha256=xChsPy5Twbdqi4lcwrQfvQxRf8BAe_8qWyawpUNIdn0,2662
|
|
7
|
+
pyconverters_openai_vision-0.5.34.dist-info/RECORD,,
|
|
@@ -3,6 +3,6 @@ deepinfra_openai_vision=pyconverters_openai_vision.openai_vision:DeepInfraOpenAI
|
|
|
3
3
|
openai_vision=pyconverters_openai_vision.openai_vision:OpenAIVisionConverter
|
|
4
4
|
|
|
5
5
|
[pyprocessors.plugins]
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
deepinfra_openai_vision_proc=pyconverters_openai_vision.openai_vision:DeepInfraOpenAIVisionProcessor
|
|
7
|
+
openai_vision_proc=pyconverters_openai_vision.openai_vision:OpenAIVisionProcessor
|
|
8
8
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pyconverters_openai_vision/__init__.py,sha256=YpBtaTvYkHfd21ln1wvLKLx4cODmfZCfNczh0p6hISg,52
|
|
2
|
-
pyconverters_openai_vision/openai_utils.py,sha256=XI4WYZ-EAVG0Vxd5yUDuZNDgEzqHJeriScxTUusi1oo,7740
|
|
3
|
-
pyconverters_openai_vision/openai_vision.py,sha256=j4-Y-h5eXxLt59UpRARxYB1__pF4mSNN8n_N-HxKwD0,23257
|
|
4
|
-
pyconverters_openai_vision-0.5.30.dist-info/entry_points.txt,sha256=KLlvDTMJjHy0fk6mvTXFNpn0pC8UKsTJLd9wre9SOHw,394
|
|
5
|
-
pyconverters_openai_vision-0.5.30.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
6
|
-
pyconverters_openai_vision-0.5.30.dist-info/METADATA,sha256=3bIoR_kFbNusWyEaFe-IE5WxzSu9hHjxDidDqzH7vds,2662
|
|
7
|
-
pyconverters_openai_vision-0.5.30.dist-info/RECORD,,
|
{pyconverters_openai_vision-0.5.30.dist-info → pyconverters_openai_vision-0.5.34.dist-info}/WHEEL
RENAMED
|
File without changes
|