mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 19:39:25 +08:00
chore: add ast-grep rule to convert Optional[T] to T | None (#25560)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
import logging
|
||||
from json import JSONDecodeError
|
||||
from typing import Optional, Union
|
||||
from typing import Union
|
||||
|
||||
from sqlalchemy import or_, select
|
||||
|
||||
@@ -211,7 +211,7 @@ class ModelLoadBalancingService:
|
||||
|
||||
def get_load_balancing_config(
|
||||
self, tenant_id: str, provider: str, model: str, model_type: str, config_id: str
|
||||
) -> Optional[dict]:
|
||||
) -> dict | None:
|
||||
"""
|
||||
Get load balancing configuration.
|
||||
:param tenant_id: workspace id
|
||||
@@ -478,7 +478,7 @@ class ModelLoadBalancingService:
|
||||
model: str,
|
||||
model_type: str,
|
||||
credentials: dict,
|
||||
config_id: Optional[str] = None,
|
||||
config_id: str | None = None,
|
||||
):
|
||||
"""
|
||||
Validate load balancing credentials.
|
||||
@@ -536,7 +536,7 @@ class ModelLoadBalancingService:
|
||||
model_type: ModelType,
|
||||
model: str,
|
||||
credentials: dict,
|
||||
load_balancing_model_config: Optional[LoadBalancingModelConfig] = None,
|
||||
load_balancing_model_config: LoadBalancingModelConfig | None = None,
|
||||
validate: bool = True,
|
||||
):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user