"""Eligibility interpreter 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, MemoryType
from claim_validator.chains.output_schemas.eligibility_interpreter import EligibilityInterpreterOutput
from claim_validator.chains.prompts.eligibility_interpreter import ELIGIBILITY_INTERPRETER_PROMPT

def build_eligibility_interpreter_chain(config: dict[str, Any], memory_manager: MemoryManager | None = None) -> RunnableSerializable:
    return build_chain(prompt=ELIGIBILITY_INTERPRETER_PROMPT, output_schema=EligibilityInterpreterOutput, config=config,
                       memory_manager=memory_manager, input_key="eligibility_response")
