memoryscope.core.operation.frontend_operation

class memoryscope.core.operation.frontend_operation.FrontendOperation(name: str, user_name: str, target_names: List[str], chat_messages: List[List[Message]], description: str, **kwargs)[source]

Bases: BaseWorkflow, BaseOperation

operation_type: Literal['frontend', 'backend'] = 'frontend'
__init__(name: str, user_name: str, target_names: List[str], chat_messages: List[List[Message]], description: str, **kwargs)[source]

Initializes a new instance of the BaseOperation.

init_workflow(**kwargs)[source]

Initializes the workflow by setting up workers with provided keyword arguments.

Parameters:

**kwargs – Arbitrary keyword arguments to be passed during worker initialization.

run_operation(target_name: str, **kwargs)[source]

Executes the main operation of reading recent chat messages, initializing workflow, and returning the result of the workflow execution.

Parameters:
  • target_name (str) – target_name(human name).

  • **kwargs – Additional keyword arguments used in the operation context.

Returns:

The result obtained from executing the workflow.

Return type:

Any

name: str
memoryscope_context: MemoryscopeContext
thread_pool: ThreadPoolExecutor
workflow: str
workflow_worker_list: List[List[List[str]]]
worker_dict: Dict[str, BaseWorker | bool]
workflow_context: Dict[str, Any]
logger: Logger
user_name: str
target_names: List[str]
chat_messages: List[List[Message]]
description: str