fix: Address code review findings (backend validation, hydration efficiency, plot readability)
This commit is contained in:
@@ -91,7 +91,7 @@ async def stream_agent_events(
|
||||
encoded_plots: list[str] = []
|
||||
for fig in plots:
|
||||
buf = io.BytesIO()
|
||||
fig.savefig(buf, format="png", transparent=True)
|
||||
fig.savefig(buf, format="png")
|
||||
plot_bytes = buf.getvalue()
|
||||
assistant_plots.append(plot_bytes)
|
||||
encoded_plots.append(base64.b64encode(plot_bytes).decode('utf-8'))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from pydantic import BaseModel, EmailStr
|
||||
from typing import List, Optional
|
||||
from typing import List, Optional, Literal
|
||||
from datetime import datetime
|
||||
|
||||
# --- Auth Schemas ---
|
||||
@@ -17,10 +17,10 @@ class UserResponse(BaseModel):
|
||||
id: str
|
||||
email: str
|
||||
display_name: str
|
||||
theme_preference: str
|
||||
theme_preference: Literal["light", "dark"]
|
||||
|
||||
class ThemeUpdate(BaseModel):
|
||||
theme: str
|
||||
theme: Literal["light", "dark"]
|
||||
|
||||
# --- History Schemas ---
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ def main():
|
||||
st.pyplot(fig)
|
||||
# Convert fig to bytes
|
||||
buf = io.BytesIO()
|
||||
fig.savefig(buf, format="png", transparent=True)
|
||||
fig.savefig(buf, format="png")
|
||||
plot_bytes_list.append(buf.getvalue())
|
||||
|
||||
if final_state.get("dfs"):
|
||||
|
||||
Reference in New Issue
Block a user