feat:
1. 建立问题库大纲,对应每个人生阶段槽位 2. 鼓励使用更生活化的交流语言共情与总结 3. 降低评审模型可能发生截断的概率 4. 成稿质量维度强化情感表达和上下文连贯性
This commit is contained in:
@@ -26,10 +26,14 @@ def _column_names(table_name: str) -> set[str]:
|
||||
def upgrade() -> None:
|
||||
columns = _column_names("segments")
|
||||
if "transcript_text" in columns and "user_input_text" not in columns:
|
||||
op.execute("ALTER TABLE segments RENAME COLUMN transcript_text TO user_input_text")
|
||||
op.execute(
|
||||
"ALTER TABLE segments RENAME COLUMN transcript_text TO user_input_text"
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
columns = _column_names("segments")
|
||||
if "user_input_text" in columns and "transcript_text" not in columns:
|
||||
op.execute("ALTER TABLE segments RENAME COLUMN user_input_text TO transcript_text")
|
||||
op.execute(
|
||||
"ALTER TABLE segments RENAME COLUMN user_input_text TO transcript_text"
|
||||
)
|
||||
|
||||
@@ -74,7 +74,9 @@ def downgrade() -> None:
|
||||
|
||||
indexes = _index_names("timeline_events")
|
||||
if "ix_timeline_events_memory_source_id" in indexes:
|
||||
op.drop_index("ix_timeline_events_memory_source_id", table_name="timeline_events")
|
||||
op.drop_index(
|
||||
"ix_timeline_events_memory_source_id", table_name="timeline_events"
|
||||
)
|
||||
|
||||
columns = _column_names("timeline_events")
|
||||
if "memory_source_id" in columns:
|
||||
|
||||
@@ -254,7 +254,9 @@ def downgrade() -> None:
|
||||
if "ix_eval_cases_source_user_id" in indexes:
|
||||
op.drop_index("ix_eval_cases_source_user_id", table_name="eval_cases")
|
||||
if "ix_eval_cases_source_conversation_id" in indexes:
|
||||
op.drop_index("ix_eval_cases_source_conversation_id", table_name="eval_cases")
|
||||
op.drop_index(
|
||||
"ix_eval_cases_source_conversation_id", table_name="eval_cases"
|
||||
)
|
||||
op.drop_table("eval_cases")
|
||||
if _has_table("eval_versions"):
|
||||
op.drop_table("eval_versions")
|
||||
|
||||
@@ -35,14 +35,36 @@ def upgrade() -> None:
|
||||
sa.Column("chapter_id", sa.String(), nullable=False),
|
||||
sa.Column("user_id", sa.String(), nullable=False),
|
||||
sa.Column("version_no", sa.Integer(), nullable=False),
|
||||
sa.Column("schema_version", sa.Integer(), nullable=False, server_default="1"),
|
||||
sa.Column("segment_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("conversation_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("story_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("memory_chunk_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("memory_fact_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("timeline_event_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("summary_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column(
|
||||
"schema_version", sa.Integer(), nullable=False, server_default="1"
|
||||
),
|
||||
sa.Column(
|
||||
"segment_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True
|
||||
),
|
||||
sa.Column(
|
||||
"conversation_ids",
|
||||
postgresql.JSON(astext_type=sa.Text()),
|
||||
nullable=True,
|
||||
),
|
||||
sa.Column(
|
||||
"story_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True
|
||||
),
|
||||
sa.Column(
|
||||
"memory_chunk_ids",
|
||||
postgresql.JSON(astext_type=sa.Text()),
|
||||
nullable=True,
|
||||
),
|
||||
sa.Column(
|
||||
"memory_fact_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True
|
||||
),
|
||||
sa.Column(
|
||||
"timeline_event_ids",
|
||||
postgresql.JSON(astext_type=sa.Text()),
|
||||
nullable=True,
|
||||
),
|
||||
sa.Column(
|
||||
"summary_ids", postgresql.JSON(astext_type=sa.Text()), nullable=True
|
||||
),
|
||||
sa.Column("notes", postgresql.JSON(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column(
|
||||
"captured_at",
|
||||
@@ -132,9 +154,17 @@ def downgrade() -> None:
|
||||
)
|
||||
op.drop_column("chapters", "current_evidence_snapshot_id")
|
||||
if _has_table("chapter_evidence_links"):
|
||||
op.drop_index("ix_chapter_evidence_links_chapter_id", table_name="chapter_evidence_links")
|
||||
op.drop_index(
|
||||
"ix_chapter_evidence_links_chapter_id", table_name="chapter_evidence_links"
|
||||
)
|
||||
op.drop_table("chapter_evidence_links")
|
||||
if _has_table("chapter_evidence_snapshots"):
|
||||
op.drop_index("ix_chapter_evidence_snapshots_user_id", table_name="chapter_evidence_snapshots")
|
||||
op.drop_index("ix_chapter_evidence_snapshots_chapter_id", table_name="chapter_evidence_snapshots")
|
||||
op.drop_index(
|
||||
"ix_chapter_evidence_snapshots_user_id",
|
||||
table_name="chapter_evidence_snapshots",
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_chapter_evidence_snapshots_chapter_id",
|
||||
table_name="chapter_evidence_snapshots",
|
||||
)
|
||||
op.drop_table("chapter_evidence_snapshots")
|
||||
|
||||
Reference in New Issue
Block a user