pyconverters-openai_vision 0.5.2__tar.gz → 0.5.3__tar.gz
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-0.5.2 → pyconverters_openai_vision-0.5.3}/PKG-INFO +1 -1
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/pyconverters_openai_vision/__init__.py +1 -1
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/pyconverters_openai_vision/openai_utils.py +13 -1
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/pyproject.toml +1 -1
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/setup.py +2 -4
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/.dockerignore +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/.gitignore +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/Dockerfile +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/Jenkinsfile +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/README.md +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/bumpversion.py +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/pyconverters_openai_vision/openai_vision.py +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/__init__.py +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/data/colducoq.jpg +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/data/webinar.png +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/test_openai_vision.py +0 -0
- {pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tox.ini +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:
|
|
@@ -45,7 +45,7 @@ requires-python = ">=3.8"
|
|
|
45
45
|
[tool.flit.entrypoints."pyconverters.plugins"]
|
|
46
46
|
openai_vision = "pyconverters_openai_vision.openai_vision:OpenAIVisionConverter"
|
|
47
47
|
deepinfra_openai_vision = "pyconverters_openai_vision.openai_vision:DeepInfraOpenAIVisionConverter"
|
|
48
|
-
azure_openai_vision = "pyconverters_openai_vision.openai_vision:AzureOpenAIVisionConverter"
|
|
48
|
+
# azure_openai_vision = "pyconverters_openai_vision.openai_vision:AzureOpenAIVisionConverter"
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
[tool.flit.metadata.requires-extra]
|
|
@@ -37,15 +37,13 @@ extras_require = \
|
|
|
37
37
|
'flask==2.1.3']}
|
|
38
38
|
|
|
39
39
|
entry_points = \
|
|
40
|
-
{'pyconverters.plugins': ['
|
|
41
|
-
'pyconverters_openai_vision.openai_vision:AzureOpenAIVisionConverter',
|
|
42
|
-
'deepinfra_openai_vision = '
|
|
40
|
+
{'pyconverters.plugins': ['deepinfra_openai_vision = '
|
|
43
41
|
'pyconverters_openai_vision.openai_vision:DeepInfraOpenAIVisionConverter',
|
|
44
42
|
'openai_vision = '
|
|
45
43
|
'pyconverters_openai_vision.openai_vision:OpenAIVisionConverter']}
|
|
46
44
|
|
|
47
45
|
setup(name='pyconverters-openai_vision',
|
|
48
|
-
version='0.5.
|
|
46
|
+
version='0.5.3',
|
|
49
47
|
description='OpenAIVision converter',
|
|
50
48
|
author='Olivier Terrier',
|
|
51
49
|
author_email='olivier.terrier@kairntech.com',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/data/colducoq.jpg
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/data/webinar.png
RENAMED
|
File without changes
|
{pyconverters_openai_vision-0.5.2 → pyconverters_openai_vision-0.5.3}/tests/test_openai_vision.py
RENAMED
|
File without changes
|
|
File without changes
|