Skip to content

Commit

Permalink
Ykeremy/fix router pass empty redis password (Skyvern-AI#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykeremy authored Apr 1, 2024
1 parent f175545 commit 3cc07c9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
31 changes: 30 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ types-toml = "^0.10.8.7"
apscheduler = "^3.10.4"
httpx = "^0.27.0"
filetype = "^1.2.0"
redis = "^5.0.3"


[tool.poetry.group.dev.dependencies]
Expand Down
1 change: 1 addition & 0 deletions skyvern/forge/sdk/api/llm/api_handler_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def get_llm_api_handler_with_router(llm_key: str) -> LLMAPIHandler:
model_list=[dataclasses.asdict(model) for model in llm_config.model_list],
redis_host=llm_config.redis_host,
redis_port=llm_config.redis_port,
redis_password=llm_config.redis_password,
routing_strategy=llm_config.routing_strategy,
fallbacks=[{llm_config.main_model_group: llm_config.fallback_model_group}]
if llm_config.fallback_model_group
Expand Down
4 changes: 3 additions & 1 deletion skyvern/forge/sdk/api/llm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ class LLMRouterModelConfig:
@dataclass(frozen=True)
class LLMRouterConfig(LLMConfig):
model_list: list[LLMRouterModelConfig]
# All three redis parameters are required. Even if there isn't a password, it should be an empty string.
redis_host: str
redis_port: int
redis_password: str
main_model_group: str
fallback_model_group: str | None = None
routing_strategy: Literal[
Expand All @@ -45,7 +47,7 @@ class LLMRouterConfig(LLMConfig):
] = "usage-based-routing"
num_retries: int = 2
retry_delay_seconds: int = 15
set_verbose: bool = True
set_verbose: bool = False


class LLMAPIHandler(Protocol):
Expand Down

0 comments on commit 3cc07c9

Please sign in to comment.