From 17e3fa10ef2fb991a072f6521e68279db3832063 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Thu, 15 Jan 2026 14:37:31 +0100 Subject: [PATCH] fix(sdk): define tracing response types locally instead of importing from Fern client - Define AgentaNodeDto and AgentaNodesResponse locally in SDK - Remove dependency on Fern-generated types that may not exist in future SDK generations These types are SDK-internal models used for inline trace responses. They were previously imported from Fern-generated client types, but those types aren't actually exposed by the API (they're internal API models). Defining them locally makes the SDK self-contained and independent of Fern generation quirks. --- sdk/agenta/sdk/types.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sdk/agenta/sdk/types.py b/sdk/agenta/sdk/types.py index b3e634c57..d39ae4be4 100644 --- a/sdk/agenta/sdk/types.py +++ b/sdk/agenta/sdk/types.py @@ -9,7 +9,31 @@ from agenta.sdk.assets import supported_llm_models, model_metadata -from agenta.client.backend.types import AgentaNodesResponse, AgentaNodeDto + + +# SDK-internal types for inline trace responses. +# These were previously imported from Fern-generated client types, but are now +# defined locally since they are SDK-internal models not exposed by the API. + + +class AgentaNodeDto(BaseModel): + """SDK-internal type for inline trace node representation. + + This type accepts arbitrary fields via extra="allow" since it's + constructed from span dictionaries with dynamic keys. + """ + + model_config = ConfigDict(extra="allow") + + +class AgentaNodesResponse(BaseModel): + """SDK-internal type for inline trace response.""" + + version: str + nodes: List[AgentaNodeDto] = [] + count: Optional[int] = None + + model_config = ConfigDict(extra="allow") @dataclass