优化情报分栏和日报展示
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from typing import Literal, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -14,6 +14,7 @@ class SearchTopic(BaseModel):
|
||||
|
||||
class SignalItem(BaseModel):
|
||||
# 模型产出的结构化情报会通过这个契约进入数据库和日报。
|
||||
source_type: Literal["news", "github"]
|
||||
topic: str
|
||||
title: str
|
||||
summary: str
|
||||
@@ -51,6 +52,7 @@ class RunRead(BaseModel):
|
||||
class SignalRead(BaseModel):
|
||||
id: int
|
||||
run_id: int
|
||||
source_type: Literal["news", "github"]
|
||||
topic: str
|
||||
title: str
|
||||
summary: str
|
||||
@@ -77,7 +79,8 @@ class ReportRead(BaseModel):
|
||||
|
||||
class DashboardRead(BaseModel):
|
||||
runs: list[RunRead]
|
||||
signals: list[SignalRead]
|
||||
news_signals: list[SignalRead]
|
||||
github_signals: list[SignalRead]
|
||||
latest_report: Optional[ReportRead]
|
||||
topics: list["TopicRead"]
|
||||
|
||||
@@ -95,4 +98,3 @@ class TopicRead(BaseModel):
|
||||
enabled: bool
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user