from pydantic import BaseModel
from typing import Optional, Any, List, Dict


class WorkflowRequest(BaseModel):
    user_input: str
    user_feedback: Optional[str] = None
    chat_history: Optional[List[Dict[str, str]]] = []
    spec: Optional[dict] = {}
    status: Optional[str] = "start"
    loop_count: Optional[int] = 0
    existing_project: Optional[Any] = None
    generated_code: Optional[Any] = None
    qa_result: Optional[Any] = None
    is_completed: Optional[bool] = False

class WorkflowResponse(BaseModel):
    user_input: str
    user_feedback: Optional[str] = None
    chat_history: Optional[List[Dict[str, str]]] = []
    spec: dict
    status: str
    loop_count: int
    existing_project: Optional[Any] = None
    generated_code: Optional[Any] = None
    qa_result: Optional[Any] = None
    is_completed: bool