File size: 747 Bytes
7ccd501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# --- Chart Models ---
from typing import Optional
from pydantic import BaseModel, Field

# --- Chart Models ---
class ChartExecutionPayload(BaseModel):
    code: str = Field(..., description="The Python code to execute.")
    csv_url: Optional[str] = Field(None, description="Optional CSV URL to be injected into scope")
    chat_id: str = Field(..., description="Chat ID required for Supabase mapping")
    return_base64: bool = Field(False, description="If True, returns base64 string instead of uploading to Supabase") 

class ChartExecutionResponse(BaseModel):
    status: str
    image_url: Optional[str] = None
    base64_image: Optional[str] = None 
    output_log: Optional[str] = None
    error: Optional[str] = None
    request_id: str