pyconverters-openai_vision 0.5.2__py3-none-any.whl → 0.5.3__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_utils.py +13 -1
- {pyconverters_openai_vision-0.5.2.dist-info → pyconverters_openai_vision-0.5.3.dist-info}/METADATA +1 -1
- pyconverters_openai_vision-0.5.3.dist-info/RECORD +7 -0
- {pyconverters_openai_vision-0.5.2.dist-info → pyconverters_openai_vision-0.5.3.dist-info}/entry_points.txt +0 -1
- pyconverters_openai_vision-0.5.2.dist-info/RECORD +0 -7
- {pyconverters_openai_vision-0.5.2.dist-info → pyconverters_openai_vision-0.5.3.dist-info}/WHEEL +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""OpenAIVision converter"""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.3"
|
|
@@ -9,6 +9,11 @@ from strenum import StrEnum
|
|
|
9
9
|
|
|
10
10
|
logger = Logger("pymultirole")
|
|
11
11
|
DEFAULT_CHAT_GPT_MODEL = "gpt-4o-mini"
|
|
12
|
+
DEEPINFRA_VISION_MODELS = [
|
|
13
|
+
"vision",
|
|
14
|
+
"llava",
|
|
15
|
+
"pixtral"
|
|
16
|
+
]
|
|
12
17
|
|
|
13
18
|
|
|
14
19
|
# Now use default retry with backoff of openai api
|
|
@@ -18,6 +23,13 @@ def openai_chat_completion(prefix, **kwargs):
|
|
|
18
23
|
return response
|
|
19
24
|
|
|
20
25
|
|
|
26
|
+
def is_vision_model(model):
|
|
27
|
+
for m in DEEPINFRA_VISION_MODELS:
|
|
28
|
+
if m in model.lower():
|
|
29
|
+
return True
|
|
30
|
+
return False
|
|
31
|
+
|
|
32
|
+
|
|
21
33
|
def openai_list_models(prefix, **kwargs):
|
|
22
34
|
def sort_by_created(x):
|
|
23
35
|
if 'created' in x:
|
|
@@ -63,7 +75,7 @@ def openai_list_models(prefix, **kwargs):
|
|
|
63
75
|
mods = list(
|
|
64
76
|
{m['model_name'] for m in mods if m['task'] == 'text-generation' and m['status'] == 'running'})
|
|
65
77
|
deepinfra_models.update({m: m for m in mods})
|
|
66
|
-
models = [m for m in deepinfra_models.keys() if
|
|
78
|
+
models = [m for m in deepinfra_models.keys() if is_vision_model(m)]
|
|
67
79
|
elif prefix.startswith("AZURE"):
|
|
68
80
|
models = comma_separated_to_list(os.getenv(prefix + "OPENAI_DEPLOYMENT_ID", None))
|
|
69
81
|
else:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyconverters_openai_vision/__init__.py,sha256=3OKw8raUFiHJX-jh8L1RvKEFeD7DZW5-8hpnp21EK-A,51
|
|
2
|
+
pyconverters_openai_vision/openai_utils.py,sha256=HRJ6sJg88en66gkQbOpQKh7cbwtfoAwVLNh7JQSA9ps,5014
|
|
3
|
+
pyconverters_openai_vision/openai_vision.py,sha256=MoEyjYCZ75jWiMonaQdR1erpFBpWgYEiqabp9D8102Y,9562
|
|
4
|
+
pyconverters_openai_vision-0.5.3.dist-info/entry_points.txt,sha256=-DS1gRUTf08Fjb79S_8sqCaqxBifC3q3EJZqXXdcf7Q,197
|
|
5
|
+
pyconverters_openai_vision-0.5.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
6
|
+
pyconverters_openai_vision-0.5.3.dist-info/METADATA,sha256=PJWwNjeSChCjjJQhgWxR1RIn9jA7-HvcPvKHWT7sJjk,2635
|
|
7
|
+
pyconverters_openai_vision-0.5.3.dist-info/RECORD,,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
[pyconverters.plugins]
|
|
2
|
-
azure_openai_vision=pyconverters_openai_vision.openai_vision:AzureOpenAIVisionConverter
|
|
3
2
|
deepinfra_openai_vision=pyconverters_openai_vision.openai_vision:DeepInfraOpenAIVisionConverter
|
|
4
3
|
openai_vision=pyconverters_openai_vision.openai_vision:OpenAIVisionConverter
|
|
5
4
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pyconverters_openai_vision/__init__.py,sha256=59Qc-bsfVK9kVVX4vnt2PQF_YysgYAQ-T0KEABdUD64,51
|
|
2
|
-
pyconverters_openai_vision/openai_utils.py,sha256=YNOcbeh1sJKeRvkaMh6FnixrUcOfF4rJIGKG5fmnUDo,4806
|
|
3
|
-
pyconverters_openai_vision/openai_vision.py,sha256=MoEyjYCZ75jWiMonaQdR1erpFBpWgYEiqabp9D8102Y,9562
|
|
4
|
-
pyconverters_openai_vision-0.5.2.dist-info/entry_points.txt,sha256=BeU_sWrRTfIdBnkWCBALpYNOrYOYIlRjQdpR2XQhkSU,285
|
|
5
|
-
pyconverters_openai_vision-0.5.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
6
|
-
pyconverters_openai_vision-0.5.2.dist-info/METADATA,sha256=d2SvC6t_svBjtYRBo-JLShoD_9fVg5ODMvlI9pDULRo,2635
|
|
7
|
-
pyconverters_openai_vision-0.5.2.dist-info/RECORD,,
|
{pyconverters_openai_vision-0.5.2.dist-info → pyconverters_openai_vision-0.5.3.dist-info}/WHEEL
RENAMED
|
File without changes
|