2022-12-01 05:33:20 +00:00
|
|
|
# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
|
2023-02-25 04:11:28 +00:00
|
|
|
from .invocation_queue import InvocationQueueABC
|
|
|
|
from .item_storage import ItemStorageABC
|
2022-12-01 05:33:20 +00:00
|
|
|
from .image_storage import ImageStorageBase
|
|
|
|
from .events import EventServiceBase
|
|
|
|
from ....generate import Generate
|
|
|
|
|
|
|
|
|
|
|
|
class InvocationServices():
|
|
|
|
"""Services that can be used by invocations"""
|
|
|
|
generate: Generate # TODO: wrap Generate, or split it up from model?
|
|
|
|
events: EventServiceBase
|
|
|
|
images: ImageStorageBase
|
2023-02-25 04:11:28 +00:00
|
|
|
queue: InvocationQueueABC
|
|
|
|
|
|
|
|
# NOTE: we must forward-declare any types that include invocations, since invocations can use services
|
|
|
|
graph_execution_manager: ItemStorageABC['GraphExecutionState']
|
|
|
|
processor: 'InvocationProcessorABC'
|
2022-12-01 05:33:20 +00:00
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
generate: Generate,
|
|
|
|
events: EventServiceBase,
|
2023-02-25 04:11:28 +00:00
|
|
|
images: ImageStorageBase,
|
|
|
|
queue: InvocationQueueABC,
|
|
|
|
graph_execution_manager: ItemStorageABC['GraphExecutionState'],
|
|
|
|
processor: 'InvocationProcessorABC'
|
2022-12-01 05:33:20 +00:00
|
|
|
):
|
|
|
|
self.generate = generate
|
|
|
|
self.events = events
|
|
|
|
self.images = images
|
2023-02-25 04:11:28 +00:00
|
|
|
self.queue = queue
|
|
|
|
self.graph_execution_manager = graph_execution_manager
|
|
|
|
self.processor = processor
|