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 DatasourceInvokeMeta.to_dict with TypedDict (#34940)
YBoye0d69204cdc4
diff --git a/api/core/datasource/entities/datasource_entities.py b/api/core/datasource/entities/datasource_entities.pyindex f20bab53f04..01f87b67f8a 100644--- a/api/core/datasource/entities/datasource_entities.py+++ b/api/core/datasource/entities/datasource_entities.py@@ -2,7 +2,7 @@ from __future__ import annotationsimport enumfrom enum import StrEnum-from typing import Any+from typing import Any, TypedDictfrom pydantic import BaseModel, Field, ValidationInfo, field_validatorfrom yarl import URL@@ -179,6 +179,12 @@ class DatasourceProviderEntityWithPlugin(DatasourceProviderEntity):datasources: list[DatasourceEntity] = Field(default_factory=list)+class DatasourceInvokeMetaDict(TypedDict):+ time_cost: float+ error: str | None+ tool_config: dict[str, Any] | None++class DatasourceInvokeMeta(BaseModel):"""Datasource invoke meta@@ -202,12 +208,13 @@ class DatasourceInvokeMeta(BaseModel):"""return cls(time_cost=0.0, error=error, tool_config={})- def to_dict(self) -> dict:- return {+ def to_dict(self) -> DatasourceInvokeMetaDict:+ result: DatasourceInvokeMetaDict = {"time_cost": self.time_cost,"error": self.error,"tool_config": self.tool_config,}+ return resultclass DatasourceLabel(BaseModel):