feat: mypy for all type check (#10921)

This commit is contained in:
yihong
2024-12-24 18:38:51 +08:00
committed by GitHub
parent c91e8b1737
commit 56e15d09a9
584 changed files with 3975 additions and 2826 deletions

View File

@@ -36,7 +36,7 @@ class ProviderQuotaType(Enum):
raise ValueError(f"No matching enum found for value '{value}'")
class Provider(db.Model):
class Provider(db.Model): # type: ignore[name-defined]
"""
Provider model representing the API providers and their configurations.
"""
@@ -89,7 +89,7 @@ class Provider(db.Model):
return self.is_valid and self.token_is_set
class ProviderModel(db.Model):
class ProviderModel(db.Model): # type: ignore[name-defined]
"""
Provider model representing the API provider_models and their configurations.
"""
@@ -114,7 +114,7 @@ class ProviderModel(db.Model):
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
class TenantDefaultModel(db.Model):
class TenantDefaultModel(db.Model): # type: ignore[name-defined]
__tablename__ = "tenant_default_models"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="tenant_default_model_pkey"),
@@ -130,7 +130,7 @@ class TenantDefaultModel(db.Model):
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
class TenantPreferredModelProvider(db.Model):
class TenantPreferredModelProvider(db.Model): # type: ignore[name-defined]
__tablename__ = "tenant_preferred_model_providers"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="tenant_preferred_model_provider_pkey"),
@@ -145,7 +145,7 @@ class TenantPreferredModelProvider(db.Model):
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
class ProviderOrder(db.Model):
class ProviderOrder(db.Model): # type: ignore[name-defined]
__tablename__ = "provider_orders"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="provider_order_pkey"),
@@ -170,7 +170,7 @@ class ProviderOrder(db.Model):
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
class ProviderModelSetting(db.Model):
class ProviderModelSetting(db.Model): # type: ignore[name-defined]
"""
Provider model settings for record the model enabled status and load balancing status.
"""
@@ -192,7 +192,7 @@ class ProviderModelSetting(db.Model):
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
class LoadBalancingModelConfig(db.Model):
class LoadBalancingModelConfig(db.Model): # type: ignore[name-defined]
"""
Configurations for load balancing models.
"""