File size: 794 Bytes
c29f1fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Request schemas for code analysis endpoints and UI."""

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel, Field


DomainHint = Literal["auto", "dsa", "data_science", "ml_dl", "web"]


class AnalyzeCodeRequest(BaseModel):
    """Validated input payload for multi-domain code analysis."""

    code: str = Field(..., min_length=1, description="Source code to analyze.")
    context_window: str = Field(default="", max_length=2000, description="Optional repository or task context.")
    traceback_text: str = Field(default="", max_length=2000, description="Optional runtime or test failure output.")
    domain_hint: DomainHint = Field(default="auto", description="Optional domain override when auto detection is not desired.")