You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AggregatedMetricsItemInfo.key is a string but location.key is an integer (llm_mentions target_metrics) #19
AggregatedMetricsItemInfo.key is typed as a string, but the API returns an integer in aggregated_metrics.location, so parsing the response of ai_optimization/llm_mentions/target_metrics/live raises a ValidationError.
pydantic_core._pydantic_core.ValidationError: 1 validation error for AggregatedMetricsItemInfo
key
Input should be a valid string [type=string_type, input_value=2840, input_type=int]
Effect: every real call to llm_mentions_target_metrics_live fails in the client even though the request succeeds and is billed (about $0.10 per call). The same response is returned normally by the raw-response method (..._without_preload_content), where the integer key is present. Callers that add up the cost only after a successful parse also miss the charge.
Suggestion: type key as Union[StrictStr, StrictInt], or give the location entries their own item model. I have not checked the other llm_mentions endpoints that share this item model (for example the top_mentioned_* ones).
Activity