Fix mypy type error in fireworks_ai transformation

Cast message to dict before calling pop() to satisfy mypy's type checker.
The message is typed as a Union of TypedDicts which don't have the
'provider_specific_fields' key, but the runtime check already confirms
it's a dict with this key.
This commit is contained in:
Shin 2026-02-04 04:45:11 +00:00
parent 7b8e3c7736
commit 7a144a76de

View file

@ -239,7 +239,7 @@ class FireworksAIConfig(OpenAIGPTConfig):
# Remove fields not permitted by FireworksAI that may cause:
# "Not permitted, field: 'messages[n].provider_specific_fields'"
if isinstance(message, dict) and "provider_specific_fields" in message:
message.pop("provider_specific_fields", None)
cast(dict, message).pop("provider_specific_fields", None)
return messages