""" Options: Date: 2025-01-08 03:06:25 Version: 8.53 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://blazordiffusion.com #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: CreateApiProvider.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ApiProviderModel: model: Optional[str] = None api_model: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ApiProvider: id: int = 0 name: Optional[str] = None api_base_url: Optional[str] = None api_type_id: int = 0 api_key_var: Optional[str] = None api_key: Optional[str] = None api_key_header: Optional[str] = None heartbeat_url: Optional[str] = None concurrency: int = 0 priority: int = 0 enabled: bool = False offline_date: Optional[datetime.datetime] = None created_date: datetime.datetime = datetime.datetime(1, 1, 1) models: List[ApiProviderModel] = field(default_factory=list) api_type: Optional[ApiType] = None # @Ignore() selected_models: List[str] = field(default_factory=list) class TaskType(IntEnum): OPEN_AI_CHAT = 1 COMFY = 2 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CreateApiProvider(IReturn[IdResponse], ICreateDb[ApiProvider]): # @Validate(Validator="GreaterThan(0)") api_type_id: int = 0 api_base_url: Optional[str] = None # @Validate(Validator="NotEmpty") name: Optional[str] = None api_key_var: Optional[str] = None api_key: Optional[str] = None api_key_header: Optional[str] = None heartbeat_url: Optional[str] = None task_paths: Optional[Dict[str, str]] = None concurrency: int = 0 priority: int = 0 enabled: bool = False models: Optional[List[ApiProviderModel]] = None selected_models: Optional[List[str]] = None