pyconverters-openai_vision 0.5.34__py3-none-any.whl → 0.5.36__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 +12 -2
- {pyconverters_openai_vision-0.5.34.dist-info → pyconverters_openai_vision-0.5.36.dist-info}/METADATA +1 -1
- pyconverters_openai_vision-0.5.36.dist-info/RECORD +7 -0
- pyconverters_openai_vision-0.5.34.dist-info/RECORD +0 -7
- {pyconverters_openai_vision-0.5.34.dist-info → pyconverters_openai_vision-0.5.36.dist-info}/WHEEL +0 -0
- {pyconverters_openai_vision-0.5.34.dist-info → pyconverters_openai_vision-0.5.36.dist-info}/entry_points.txt +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,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyconverters_openai_vision/__init__.py,sha256=-BX6FHKC8AX-7vCq_-SC81FmeXDVkY1SIy4vU9f9-gU,52
|
|
2
|
+
pyconverters_openai_vision/openai_utils.py,sha256=XI4WYZ-EAVG0Vxd5yUDuZNDgEzqHJeriScxTUusi1oo,7740
|
|
3
|
+
pyconverters_openai_vision/openai_vision.py,sha256=Lp8g8KbTvRznOrC7dPRM-C9qmZcgzs-Kq6QidHtZwA4,23780
|
|
4
|
+
pyconverters_openai_vision-0.5.36.dist-info/entry_points.txt,sha256=NR0re-yebKKyhApky1I6nDQzjJQfEyfOkJlJju0Ngzo,404
|
|
5
|
+
pyconverters_openai_vision-0.5.36.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
6
|
+
pyconverters_openai_vision-0.5.36.dist-info/METADATA,sha256=govETANuIkSFp_1AAH1t2AxwryMgupNpZ2VERpWhbyI,2662
|
|
7
|
+
pyconverters_openai_vision-0.5.36.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
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,,
|
{pyconverters_openai_vision-0.5.34.dist-info → pyconverters_openai_vision-0.5.36.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|