fix(api): Use list[Any] for strengths to preserve V2 fields
Pydantic was coercing V2 StrengthToProtect dicts to the partial ReportStrengthResponse type, dropping fields like `percentage` and `top_quotes`. Changed to list[Any] to pass through raw data. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -373,7 +373,8 @@ class SynthesisResponse(BaseModel):
|
|||||||
|
|
||||||
# The Strengths (can be v1 or v2 format depending on report_version)
|
# The Strengths (can be v1 or v2 format depending on report_version)
|
||||||
# V1: list[ReportStrengthResponse], V2: list[StrengthToProtect dict]
|
# V1: list[ReportStrengthResponse], V2: list[StrengthToProtect dict]
|
||||||
strengths: list[ReportStrengthResponse] | list[dict] = Field(default_factory=list, description="Key strengths to protect")
|
# Using list[Any] to prevent Pydantic from coercing/dropping fields
|
||||||
|
strengths: list[Any] = Field(default_factory=list, description="Key strengths to protect")
|
||||||
|
|
||||||
# Momentum
|
# Momentum
|
||||||
momentum: str = Field("stable", description="improving/declining/stable")
|
momentum: str = Field("stable", description="improving/declining/stable")
|
||||||
|
|||||||
Reference in New Issue
Block a user