fix(llm): add fetch-models endpoint, fix SQL Lab INSERT (client_id truncation, sync mode, target_column, timestamp normalization)
- Add POST /api/llm/providers/fetch-models route with LLMClient.fetch_models() - Add target_column to TranslationJob model/schema/service/orchestrator - Fix SQL Lab execute: truncate client_id to 11 chars (varchar(11)) - Switch SQL Lab to sync mode (runAsync: false) — no Celery workers - Fix polling: unwrap nested result from Superset query API - Fix ClickHouse timestamp: normalize float timestamps to YYYY-MM-DD
This commit is contained in:
@@ -42,7 +42,8 @@ class TranslationJob(Base):
|
||||
# Column mapping
|
||||
source_key_cols = Column(JSON, nullable=True, comment="Source key column names for composite key")
|
||||
target_key_cols = Column(JSON, nullable=True, comment="Target key column names for composite key")
|
||||
translation_column = Column(String, nullable=True, comment="The column whose values will be translated")
|
||||
translation_column = Column(String, nullable=True, comment="Source column whose values will be translated")
|
||||
target_column = Column(String, nullable=True, comment="Target column for translated output (defaults to translation_column)")
|
||||
context_columns = Column(JSON, nullable=True, comment="Context column names included in LLM prompt")
|
||||
|
||||
# LLM & processing settings
|
||||
@@ -53,6 +54,7 @@ class TranslationJob(Base):
|
||||
|
||||
# Environment association
|
||||
environment_id = Column(String, nullable=True, comment="Superset environment ID for datasource access")
|
||||
target_database_id = Column(String, nullable=True, comment="Superset database ID for SQL Lab insert target")
|
||||
|
||||
created_by = Column(String, nullable=True)
|
||||
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
||||
@@ -119,6 +121,7 @@ class TranslationRecord(Base):
|
||||
source_object_type = Column(String, nullable=True) # query, dashboard, chart, dataset
|
||||
source_object_id = Column(String, nullable=True)
|
||||
source_object_name = Column(String, nullable=True)
|
||||
source_data = Column(JSON, nullable=True, comment="Original source row key columns for upsert matching")
|
||||
status = Column(String, nullable=False, default="PENDING") # PENDING, SUCCESS, FAILED, SKIPPED
|
||||
error_message = Column(Text, nullable=True)
|
||||
token_count_input = Column(Integer, nullable=True)
|
||||
@@ -174,6 +177,7 @@ class TranslationPreviewRecord(Base):
|
||||
source_object_type = Column(String, nullable=True)
|
||||
source_object_id = Column(String, nullable=True)
|
||||
source_object_name = Column(String, nullable=True)
|
||||
source_data = Column(JSON, nullable=True, comment="Original source row key columns for upsert matching")
|
||||
status = Column(String, nullable=False, default="PENDING") # PENDING, APPROVED, REJECTED
|
||||
feedback = Column(Text, nullable=True)
|
||||
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
||||
|
||||
Reference in New Issue
Block a user