from __future__ import annotations

from graph.connections.db_instance import DbInstance
from graph.connections.kuzu.db_instance import KuzuDbInstance
from graph.connections.neo4j.db_instance import Neo4jDbInstance
from graph.exploration.llm.db_strategies import (
    KuzuLLMStrategy,
    LLMCypherDbStrategy,
    Neo4jLLMStrategy,
)


def create_llm_strategy(db_instance: DbInstance) -> LLMCypherDbStrategy:
    if isinstance(db_instance, KuzuDbInstance):
        return KuzuLLMStrategy(db_instance)
    elif isinstance(db_instance, Neo4jDbInstance):
        return Neo4jLLMStrategy(db_instance)
    else:
        raise ValueError("Unsupported database type.")
