"""Pre-submission summary chain builder."""
from __future__ import annotations
from typing import Any
from langchain_core.runnables import RunnableSerializable
from claim_validator.chains.base import build_chain
from claim_validator.chains.memory.manager import MemoryManager
from claim_validator.chains.output_schemas.pre_submission import PreSubmissionOutput
from claim_validator.chains.prompts.pre_submission import PRE_SUBMISSION_PROMPT

def build_pre_submission_chain(config: dict[str, Any], memory_manager: MemoryManager | None = None) -> RunnableSerializable:
    return build_chain(prompt=PRE_SUBMISSION_PROMPT, output_schema=PreSubmissionOutput, config=config,
                       memory_manager=memory_manager, input_key="workflow_status")
