Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(api): type DataSourceApiKeyAuthBinding.to_dict with TypedDict (#35001)
YBoy095962f13e3b
diff --git a/api/models/source.py b/api/models/source.pyindex a8addbe3423..8078b32f8c3 100644--- a/api/models/source.py+++ b/api/models/source.py@@ -1,5 +1,6 @@import jsonfrom datetime import datetime+from typing import Any, TypedDictfrom uuid import uuid4import sqlalchemy as sa@@ -38,6 +39,17 @@ class DataSourceOauthBinding(TypeBase):disabled: Mapped[bool] = mapped_column(sa.Boolean, nullable=True, server_default=sa.text("false"), default=False)+class DataSourceApiKeyAuthBindingDict(TypedDict):+ id: str+ tenant_id: str+ category: str+ provider: str+ credentials: Any+ created_at: float+ updated_at: float+ disabled: bool++class DataSourceApiKeyAuthBinding(TypeBase):__tablename__ = "data_source_api_key_auth_bindings"__table_args__ = (@@ -65,8 +77,8 @@ class DataSourceApiKeyAuthBinding(TypeBase):)disabled: Mapped[bool] = mapped_column(sa.Boolean, nullable=True, server_default=sa.text("false"), default=False)- def to_dict(self):- return {+ def to_dict(self) -> DataSourceApiKeyAuthBindingDict:+ result: DataSourceApiKeyAuthBindingDict = {"id": self.id,"tenant_id": self.tenant_id,"category": self.category,@@ -76,3 +88,4 @@ class DataSourceApiKeyAuthBinding(TypeBase):"updated_at": self.updated_at.timestamp(),"disabled": self.disabled,}+ return result