mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-06 06:12:40 +02:00
- Added a new tool for generating structured Markdown reports based on user input. - Implemented routes for creating, reading, exporting, and deleting reports. - Integrated report generation into the chat flow, allowing users to generate reports inline. - Updated schemas to support report data structures and responses. - Enhanced frontend components to handle report generation and display results.
41 lines
842 B
Python
41 lines
842 B
Python
"""Report schemas for API responses."""
|
|
|
|
from datetime import datetime
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ReportBase(BaseModel):
|
|
"""Base report schema."""
|
|
|
|
title: str
|
|
content: str | None = None
|
|
report_style: str | None = None
|
|
search_space_id: int
|
|
|
|
|
|
class ReportRead(BaseModel):
|
|
"""Schema for reading a report (list view, no content)."""
|
|
|
|
id: int
|
|
title: str
|
|
report_style: str | None = None
|
|
report_metadata: dict[str, Any] | None = None
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class ReportContentRead(BaseModel):
|
|
"""Schema for reading a report with full Markdown content."""
|
|
|
|
id: int
|
|
title: str
|
|
content: str | None = None
|
|
report_metadata: dict[str, Any] | None = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|