mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
Co-authored-by: speakeasybot <bot@speakeasyapi.dev> Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
54 lines
1.9 KiB
Python
54 lines
1.9 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from __future__ import annotations
|
|
from .stopservertoolswhenfinishreasonis import (
|
|
StopServerToolsWhenFinishReasonIs,
|
|
StopServerToolsWhenFinishReasonIsTypedDict,
|
|
)
|
|
from .stopservertoolswhenhastoolcall import (
|
|
StopServerToolsWhenHasToolCall,
|
|
StopServerToolsWhenHasToolCallTypedDict,
|
|
)
|
|
from .stopservertoolswhenmaxcost import (
|
|
StopServerToolsWhenMaxCost,
|
|
StopServerToolsWhenMaxCostTypedDict,
|
|
)
|
|
from .stopservertoolswhenmaxtokensused import (
|
|
StopServerToolsWhenMaxTokensUsed,
|
|
StopServerToolsWhenMaxTokensUsedTypedDict,
|
|
)
|
|
from .stopservertoolswhenstepcountis import (
|
|
StopServerToolsWhenStepCountIs,
|
|
StopServerToolsWhenStepCountIsTypedDict,
|
|
)
|
|
from openrouter.utils import get_discriminator
|
|
from pydantic import Discriminator, Tag
|
|
from typing import Union
|
|
from typing_extensions import Annotated, TypeAliasType
|
|
|
|
|
|
StopServerToolsWhenConditionTypedDict = TypeAliasType(
|
|
"StopServerToolsWhenConditionTypedDict",
|
|
Union[
|
|
StopServerToolsWhenStepCountIsTypedDict,
|
|
StopServerToolsWhenHasToolCallTypedDict,
|
|
StopServerToolsWhenMaxTokensUsedTypedDict,
|
|
StopServerToolsWhenMaxCostTypedDict,
|
|
StopServerToolsWhenFinishReasonIsTypedDict,
|
|
],
|
|
)
|
|
r"""A single condition that, when met, halts the server-tool agent loop."""
|
|
|
|
|
|
StopServerToolsWhenCondition = Annotated[
|
|
Union[
|
|
Annotated[StopServerToolsWhenFinishReasonIs, Tag("finish_reason_is")],
|
|
Annotated[StopServerToolsWhenHasToolCall, Tag("has_tool_call")],
|
|
Annotated[StopServerToolsWhenMaxCost, Tag("max_cost")],
|
|
Annotated[StopServerToolsWhenMaxTokensUsed, Tag("max_tokens_used")],
|
|
Annotated[StopServerToolsWhenStepCountIs, Tag("step_count_is")],
|
|
],
|
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
|
]
|
|
r"""A single condition that, when met, halts the server-tool agent loop."""
|