""" Options: Date: 2025-01-08 03:23:37 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: QueryApiProviders.* #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 class AiProvider(str, Enum): OPEN_AI_PROVIDER = 'OpenAiProvider' GOOGLE_AI_PROVIDER = 'GoogleAiProvider' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ApiType: id: int = 0 provider: Optional[AiProvider] = None name: Optional[str] = None website: Optional[str] = None api_base_url: Optional[str] = None heartbeat_url: Optional[str] = None icon: Optional[str] = None api_models: Dict[str, str] = field(default_factory=dict) @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) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class QueryApiProviders(QueryDb[ApiProvider], IReturn[QueryResponse[ApiProvider]]): name: Optional[str] = None