Project import generated by Copybara.

GitOrigin-RevId: 2592bdc8b4b7c695a3d689390aedc9a42914acc8
This commit is contained in:
OpenRouter Team
2026-01-22 01:26:28 +00:00
parent 5832c0495b
commit 5f2c0ee2ea
130 changed files with 16948 additions and 1127 deletions
+7 -1
View File
@@ -50,6 +50,8 @@ class ModelTypedDict(TypedDict):
r"""Hugging Face model identifier, if applicable"""
description: NotRequired[str]
r"""Description of the model"""
expiration_date: NotRequired[Nullable[str]]
r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
class Model(BaseModel):
@@ -96,14 +98,18 @@ class Model(BaseModel):
description: Optional[str] = None
r"""Description of the model"""
expiration_date: OptionalNullable[str] = UNSET
r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["hugging_face_id", "description"]
optional_fields = ["hugging_face_id", "description", "expiration_date"]
nullable_fields = [
"hugging_face_id",
"context_length",
"per_request_limits",
"default_parameters",
"expiration_date",
]
null_default_fields = []