mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(api): fix ApiDependencies.invoker
types
ApiDependencies.invoker` provides typing for the API's services layer. Marking it `Optional` results in all the routes seeing it as optional, which is not good. Instead of marking it optional to satisfy the initial assignment to `None`, we can just skip the initial assignment. This preserves the IDE hinting in API layer and is types-legal.
This commit is contained in:
parent
b8b589c150
commit
d4cf2d2666
@ -55,7 +55,7 @@ logger = InvokeAILogger.getLogger()
|
|||||||
class ApiDependencies:
|
class ApiDependencies:
|
||||||
"""Contains and initializes all dependencies for the API"""
|
"""Contains and initializes all dependencies for the API"""
|
||||||
|
|
||||||
invoker: Optional[Invoker] = None
|
invoker: Invoker
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def initialize(config: InvokeAIAppConfig, event_handler_id: int, logger: Logger = logger):
|
def initialize(config: InvokeAIAppConfig, event_handler_id: int, logger: Logger = logger):
|
||||||
|
Loading…
Reference in New Issue
Block a user