mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
fix: add overlay to remove nullable from pagination offset params (#121)
This commit is contained in:
@@ -15,46 +15,46 @@ from typing_extensions import NotRequired, TypedDict
|
||||
class DefaultParametersTypedDict(TypedDict):
|
||||
r"""Default parameters for this model"""
|
||||
|
||||
temperature: NotRequired[Nullable[float]]
|
||||
top_p: NotRequired[Nullable[float]]
|
||||
top_k: NotRequired[Nullable[int]]
|
||||
frequency_penalty: NotRequired[Nullable[float]]
|
||||
presence_penalty: NotRequired[Nullable[float]]
|
||||
repetition_penalty: NotRequired[Nullable[float]]
|
||||
temperature: NotRequired[Nullable[float]]
|
||||
top_k: NotRequired[Nullable[int]]
|
||||
top_p: NotRequired[Nullable[float]]
|
||||
|
||||
|
||||
class DefaultParameters(BaseModel):
|
||||
r"""Default parameters for this model"""
|
||||
|
||||
temperature: OptionalNullable[float] = UNSET
|
||||
|
||||
top_p: OptionalNullable[float] = UNSET
|
||||
|
||||
top_k: OptionalNullable[int] = UNSET
|
||||
|
||||
frequency_penalty: OptionalNullable[float] = UNSET
|
||||
|
||||
presence_penalty: OptionalNullable[float] = UNSET
|
||||
|
||||
repetition_penalty: OptionalNullable[float] = UNSET
|
||||
|
||||
temperature: OptionalNullable[float] = UNSET
|
||||
|
||||
top_k: OptionalNullable[int] = UNSET
|
||||
|
||||
top_p: OptionalNullable[float] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"temperature",
|
||||
"top_p",
|
||||
"top_k",
|
||||
"frequency_penalty",
|
||||
"presence_penalty",
|
||||
"repetition_penalty",
|
||||
"temperature",
|
||||
"top_k",
|
||||
"top_p",
|
||||
]
|
||||
nullable_fields = [
|
||||
"temperature",
|
||||
"top_p",
|
||||
"top_k",
|
||||
"frequency_penalty",
|
||||
"presence_penalty",
|
||||
"repetition_penalty",
|
||||
"temperature",
|
||||
"top_k",
|
||||
"top_p",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user