add gpt4o mini support (#666)

This commit is contained in:
LawyZheng 2024-08-02 19:35:52 +08:00 committed by GitHub
parent a9f52c4dbb
commit 98e2f7f206
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 5 deletions

View file

@ -1,12 +1,18 @@
from dataclasses import dataclass, field
from typing import Any, Awaitable, Literal, Protocol
from typing import Any, Awaitable, Literal, Optional, Protocol, TypedDict
from skyvern.forge.sdk.models import Step
from skyvern.forge.sdk.settings_manager import SettingsManager
class LiteLLMParams(TypedDict):
api_key: str | None
api_version: str | None
api_base: str | None
@dataclass(frozen=True)
class LLMConfig:
class LLMConfigBase:
model_name: str
required_env_vars: list[str]
supports_vision: bool
@ -22,6 +28,11 @@ class LLMConfig:
return missing_env_vars
@dataclass(frozen=True)
class LLMConfig(LLMConfigBase):
litellm_params: Optional[LiteLLMParams] = field(default=None)
@dataclass(frozen=True)
class LLMRouterModelConfig:
model_name: str
@ -33,7 +44,7 @@ class LLMRouterModelConfig:
@dataclass(frozen=True)
class LLMRouterConfig(LLMConfig):
class LLMRouterConfig(LLMConfigBase):
model_list: list[LLMRouterModelConfig]
# All three redis parameters are required. Even if there isn't a password, it should be an empty string.
main_model_group: str