from __future__ import annotations

from typing import Optional

from analogai.deepthink.messaging.question_answering.question_answering_service import (
    QuestionAnsweringService,
)
from analogai.deepthink.messaging.commands import GenerateBackgroundInfoCommand, RememberCommand, SearchCommand
from analogai.deepthink.presentation.pipeline.pipeline import MessagePipeline


class ChatCommandFactory:
    def __init__(
        self,
        pipeline: MessagePipeline,
        question_answering_service: QuestionAnsweringService,
    ):
        self._pipeline = pipeline
        self._question_answering_service = question_answering_service

    def create_remember_command(self) -> RememberCommand:
        return RememberCommand(self._pipeline)

    def create_search_command(self) -> SearchCommand:
        return SearchCommand(self._question_answering_service)

    def create_background_info_command(self) -> GenerateBackgroundInfoCommand:
        return GenerateBackgroundInfoCommand(self._question_answering_service)
