"""RAG server API client stub."""

from __future__ import annotations

from typing import Any


class RagServerClient:
    """Minimal stub mirroring RAG server endpoints."""

    def __init__(self, base_url: str) -> None:
        self.base_url = base_url

    async def upload_files(self, paths: list[str]) -> dict[str, Any]:
        """Stub upload; would POST /v1/files."""
        return {"file_ids": [f"file-{idx}" for idx, _ in enumerate(paths)]}

    async def ingest(self, file_ids: list[str]) -> dict[str, Any]:
        """Stub ingest; would POST /v1/ingest."""
        return {"job_id": "job-123", "file_ids": file_ids}

    async def check_status(self, job_id: str) -> dict[str, Any]:
        """Stub status; would GET /v1/ingest/{job_id}."""
        return {"job_id": job_id, "status": "ready"}

    async def query(self, question: str) -> dict[str, Any]:
        """Stub query; would POST /v1/query."""
        return {"answer": f"stub answer for '{question}'", "sources": ["doc-1", "doc-2"]}
