mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-15 08:23:09 +00:00
fix: resolve recursion in OVHCloud get_supported_openai_params (#24118)
* fix: resolve recursion in OVHCloud get_supported_openai_params (#24111) Root cause: OVHCloudChatConfig.get_supported_openai_params() called get_model_info() which called back into get_supported_openai_params(), causing infinite recursion and falling back to no tools support. Made-with: Cursor * fix: use .get() for TypedDict + don't hardcode function_calling support Made-with: Cursor --------- Co-authored-by: themavik <themavik@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@ More information on our website: https://endpoints.ai.cloud.ovh.net
|
||||
from typing import Optional, Union, List
|
||||
|
||||
import httpx
|
||||
from litellm.utils import ModelResponseStream, get_model_info
|
||||
from litellm.utils import ModelResponseStream, _get_model_info_helper
|
||||
from litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.llms.ovhcloud.utils import OVHCloudException
|
||||
@@ -28,13 +28,17 @@ class OVHCloudChatConfig(OpenAIGPTConfig):
|
||||
"""
|
||||
supports_function_calling: Optional[bool] = None
|
||||
try:
|
||||
model_info = get_model_info(model, custom_llm_provider="ovhcloud")
|
||||
supports_function_calling = model_info.get(
|
||||
"supports_function_calling", False
|
||||
model_info = _get_model_info_helper(
|
||||
model, custom_llm_provider="ovhcloud"
|
||||
)
|
||||
supports_function_calling = model_info.get(
|
||||
"supports_function_calling", None
|
||||
)
|
||||
if supports_function_calling is None:
|
||||
supports_function_calling = False
|
||||
except Exception as e:
|
||||
verbose_logger.debug(f"Error getting supported OpenAI params: {e}")
|
||||
pass
|
||||
supports_function_calling = False
|
||||
|
||||
optional_params = super().get_supported_openai_params(model)
|
||||
if supports_function_calling is not True:
|
||||
|
||||
Reference in New Issue
Block a user