from __future__ import annotations

from ninja import Schema


class ExplanationsSchema(Schema):
    trace_id: str
    source_code: str
    optimized_code: str
    original_line_profiler_results: str
    optimized_line_profiler_results: str
    original_code_runtime: str
    optimized_code_runtime: str
    speedup: str
    annotated_tests: str
    dependency_code: str | None
    optimization_id: str
    original_explanation: str
    original_throughput: str | None = None
    optimized_throughput: str | None = None
    throughput_improvement: str | None = None
    python_version: str | None = None
    function_references: str | None = None
    acceptance_reason: str | None = None
    original_concurrency_ratio: str | None = None
    optimized_concurrency_ratio: str | None = None
    concurrency_improvement: str | None = None
    codeflash_version: str = "0.18.2"
    call_sequence: int | None = None


class ExplanationsResponseSchema(Schema):
    explanation: str


class ExplanationsErrorResponseSchema(Schema):
    error: str
