Fix issue #4809: [Bug]: Model does not support image upload when usin… (#4810)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang 2024-11-06 20:28:16 -06:00 committed by GitHub
parent 47464a9cfa
commit 4405b109e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 4 deletions

View File

@ -58,4 +58,3 @@ The main interface consists of several key components:
3. Use one of the recommended models, as described in the [LLMs section](usage/llms/llms.md).
Remember, the GUI mode of OpenHands is designed to make your interaction with the AI assistant as smooth and intuitive as possible. Don't hesitate to explore its features to maximize your productivity.

View File

@ -6,12 +6,14 @@ __package_name__ = 'openhands_ai'
def get_version():
try:
from importlib.metadata import PackageNotFoundError, version
return version(__package_name__)
except (ImportError, PackageNotFoundError):
pass
try:
from pkg_resources import DistributionNotFound, get_distribution
return get_distribution(__package_name__).version
except (ImportError, DistributionNotFound):
pass

View File

@ -342,9 +342,14 @@ class LLM(RetryMixin, DebugMixin):
# but model_info will have the correct value for some reason.
# we can go with it, but we will need to keep an eye if model_info is correct for Vertex or other providers
# remove when litellm is updated to fix https://github.com/BerriAI/litellm/issues/5608
return litellm.supports_vision(self.config.model) or (
self.model_info is not None
and self.model_info.get('supports_vision', False)
# Check both the full model name and the name after proxy prefix for vision support
return (
litellm.supports_vision(self.config.model)
or litellm.supports_vision(self.config.model.split('/')[-1])
or (
self.model_info is not None
and self.model_info.get('supports_vision', False)
)
)
def is_caching_prompt_active(self) -> bool:

View File

@ -92,6 +92,7 @@ reportlab = "*"
[tool.coverage.run]
concurrency = ["gevent"]
[tool.poetry.group.runtime.dependencies]
jupyterlab = "*"
notebook = "*"
@ -122,6 +123,7 @@ ignore = ["D1"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.poetry.group.evaluation.dependencies]
streamlit = "*"
whatthepatch = "*"