mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
Commits included in this export:
- ac457b8a8dad98fdf5ddcae8dd4711361cea3084 - ea825199f4c59dd68fec01cf8d18a582963c9f25 - 4d48e4f6bb936e785787314a965298da6b78fea0 - 718729a573ee98893a4408d5a52ab4686661fe54 - b867adcde6b64f3f2a11c4626254b39098e4b0b4 - 21912c097b4066d109766c6b4492826595cd57c5 - bc1ed85adc976a4634ca8a41b82e4fc2c39a864f - d145c89c941937a312ed1357590d2bfda9a3603d - 12f05b5dee397ead47cfcd545a7a2e3c7ff57524 - dd28f75a19a015809797c7abf3f8758f7c37262e - c96e569781e07ab44172d9c69940ec17bafd81f4 - c9d5a90e3c2b5077a2bdd49773f1a46d1a5a79c7 - 58b08f87116ceab9076de2fdc0a4c74c919b44c4 GitOrigin-RevId: ac457b8a8dad98fdf5ddcae8dd4711361cea3084
This commit is contained in:
@@ -562,22 +562,22 @@ class Reasoning(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatPythonTypedDict(TypedDict):
|
||||
class ResponseFormatPythonTypedDict(TypedDict):
|
||||
type: Literal["python"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatPython(BaseModel):
|
||||
class ResponseFormatPython(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["python"], AfterValidator(validate_const("python"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "python"
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatJSONObjectTypedDict(TypedDict):
|
||||
class ResponseFormatJSONObjectTypedDict(TypedDict):
|
||||
type: Literal["json_object"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatJSONObject(BaseModel):
|
||||
class ResponseFormatJSONObject(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[
|
||||
Literal["json_object"], AfterValidator(validate_const("json_object"))
|
||||
@@ -586,49 +586,45 @@ class ChatGenerationParamsResponseFormatJSONObject(BaseModel):
|
||||
] = "json_object"
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatTextTypedDict(TypedDict):
|
||||
class ResponseFormatTextTypedDict(TypedDict):
|
||||
type: Literal["text"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatText(BaseModel):
|
||||
class ResponseFormatText(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["text"], AfterValidator(validate_const("text"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "text"
|
||||
|
||||
|
||||
ChatGenerationParamsResponseFormatUnionTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsResponseFormatUnionTypedDict",
|
||||
ResponseFormatTypedDict = TypeAliasType(
|
||||
"ResponseFormatTypedDict",
|
||||
Union[
|
||||
ChatGenerationParamsResponseFormatTextTypedDict,
|
||||
ChatGenerationParamsResponseFormatJSONObjectTypedDict,
|
||||
ChatGenerationParamsResponseFormatPythonTypedDict,
|
||||
ResponseFormatTextTypedDict,
|
||||
ResponseFormatJSONObjectTypedDict,
|
||||
ResponseFormatPythonTypedDict,
|
||||
ResponseFormatJSONSchemaTypedDict,
|
||||
ResponseFormatTextGrammarTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsResponseFormatUnion = Annotated[
|
||||
ResponseFormat = Annotated[
|
||||
Union[
|
||||
Annotated[ChatGenerationParamsResponseFormatText, Tag("text")],
|
||||
Annotated[ChatGenerationParamsResponseFormatJSONObject, Tag("json_object")],
|
||||
Annotated[ResponseFormatText, Tag("text")],
|
||||
Annotated[ResponseFormatJSONObject, Tag("json_object")],
|
||||
Annotated[ResponseFormatJSONSchema, Tag("json_schema")],
|
||||
Annotated[ResponseFormatTextGrammar, Tag("grammar")],
|
||||
Annotated[ChatGenerationParamsResponseFormatPython, Tag("python")],
|
||||
Annotated[ResponseFormatPython, Tag("python")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
|
||||
|
||||
ChatGenerationParamsStopTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsStopTypedDict", Union[str, List[str]]
|
||||
)
|
||||
StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]])
|
||||
|
||||
|
||||
ChatGenerationParamsStop = TypeAliasType(
|
||||
"ChatGenerationParamsStop", Union[str, List[str]]
|
||||
)
|
||||
Stop = TypeAliasType("Stop", Union[str, List[str]])
|
||||
|
||||
|
||||
class DebugTypedDict(TypedDict):
|
||||
@@ -679,9 +675,9 @@ class ChatGenerationParamsTypedDict(TypedDict):
|
||||
metadata: NotRequired[Dict[str, str]]
|
||||
presence_penalty: NotRequired[Nullable[float]]
|
||||
reasoning: NotRequired[ReasoningTypedDict]
|
||||
response_format: NotRequired[ChatGenerationParamsResponseFormatUnionTypedDict]
|
||||
response_format: NotRequired[ResponseFormatTypedDict]
|
||||
seed: NotRequired[Nullable[int]]
|
||||
stop: NotRequired[Nullable[ChatGenerationParamsStopTypedDict]]
|
||||
stop: NotRequired[Nullable[StopTypedDict]]
|
||||
stream: NotRequired[bool]
|
||||
stream_options: NotRequired[Nullable[ChatStreamOptionsTypedDict]]
|
||||
temperature: NotRequired[Nullable[float]]
|
||||
@@ -733,11 +729,11 @@ class ChatGenerationParams(BaseModel):
|
||||
|
||||
reasoning: Optional[Reasoning] = None
|
||||
|
||||
response_format: Optional[ChatGenerationParamsResponseFormatUnion] = None
|
||||
response_format: Optional[ResponseFormat] = None
|
||||
|
||||
seed: OptionalNullable[int] = UNSET
|
||||
|
||||
stop: OptionalNullable[ChatGenerationParamsStop] = UNSET
|
||||
stop: OptionalNullable[Stop] = UNSET
|
||||
|
||||
stream: Optional[bool] = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user