From 18f6cbcf28e226c3eeb4349926f7a85b8c627ceb Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 12 Nov 2026 17:10:50 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(openrouter:tool_search).catalog_index_note` **Added** * `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(openrouter:tool_search).catalog_index_note` **Added** * `open_router.observability.list()`: `response.data[].union(otel-collector).config` **Changed** * `open_router.observability.create()`: `response.data.union(otel-collector).config` **Changed** * `open_router.observability.get()`: `response.data.union(otel-collector).config` **Changed** * `open_router.observability.update()`: `response.data.union(otel-collector).config` **Changed** * `open_router.presets.create_presets_responses()`: * `request.input.union(Array<>)[].union(OutputToolSearchServerToolItem).catalog_index_note` **Added** --- .speakeasy/gen.lock | 38 +++++++++---------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 11 ++++++ .speakeasy/workflow.lock | 10 ++--- RELEASES.md | 12 +++++- ...vabilityotelcollectordestinationconfig.mdx | 4 +- .../outputtoolsearchservertoolitem.mdx | 33 ++++++++-------- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- .../observabilityotelcollectordestination.py | 25 +++++++++++- .../outputtoolsearchservertoolitem.py | 6 +++ uv.lock | 2 +- 12 files changed, 100 insertions(+), 49 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d940b29f7..57e7f7038 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: 10184fdaac0580ac4aac9e157313eb40 + docChecksum: 7b326991ba70a8a48c576cf6bf36dc6c docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.169 - configChecksum: 9240c091eb5c515165dacfff34cf3213 + releaseVersion: 1.3.170 + configChecksum: 990eaedd546b685ababbd0717166ab92 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 637340c2-787b-4252-b9ef-52c1c6595368 - pristine_commit_hash: d3226951ab1da91872621869a07abc236c1f5b72 - pristine_tree_hash: 3f13a3b2dfe98f36d6dd595d5018d4164cdc3c53 + generation_id: 69e6761f-bc28-4415-b052-482fbb106c90 + pristine_commit_hash: 741529e4b9021d7ccde61b0ea7ba94f09f9fc7fe + pristine_tree_hash: 84ce71d677f19c37587e79ad54585c3db06883ac features: python: acceptHeaders: 3.0.0 @@ -5864,8 +5864,8 @@ trackedFiles: pristine_git_object: 089a4e220d6582b277db90fab35b2723490cc621 docs/components/observabilityotelcollectordestinationconfig.mdx: id: 204fa4b1365b - last_write_checksum: sha1:6d478aca958d26c74545819c36452c67a211f0cb - pristine_git_object: 8dd8c3883b518df3163a062bda8c4564441e701c + last_write_checksum: sha1:fe291178f44e7aac800dfd1bb1a0d106bd7cb218 + pristine_git_object: ef238b1525d591865702dd4bfb8f1ab5a707a101 docs/components/observabilityotelcollectordestinationtype.mdx: id: 130ee89d27f9 last_write_checksum: sha1:bd099fbb43d7f0170267758de0467d4593194bbb @@ -6972,8 +6972,8 @@ trackedFiles: pristine_git_object: d68bd61421859df1e00c0ec15f5a6946ed52dfd1 docs/components/outputtoolsearchservertoolitem.mdx: id: 7106fbb89729 - last_write_checksum: sha1:17fe788112ef3866b9c4d6ee32d0b6a6d076fb11 - pristine_git_object: 433141ae099de822c9cec8eda2c718b356503de4 + last_write_checksum: sha1:cd30906a1411db0058111577f8c0dc7b1883ecf2 + pristine_git_object: 201f1b8a22046f6f770e4dea3863c6f21c611843 docs/components/outputtoolsearchservertoolitemformat.mdx: id: 717072e9e3e8 last_write_checksum: sha1:04cf65dbe63614cfee6df054640472e679b4faac @@ -11620,8 +11620,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:1aaa82944c6bb30732d9d428ce44cfcaa30198ff - pristine_git_object: d804c0cbf03075954f0381f1a38558e368d33ce3 + last_write_checksum: sha1:6fd972a2de80493fb50b225b4b2a3c3dd40644cd + pristine_git_object: ca7074d884098d18f06262f84d9ffad6715ea33d scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11648,8 +11648,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:7679b06745e9a8448f76e9a04851caf342cd3fdd - pristine_git_object: 24df38070338b49d7f148d56856e25fd8a8c6e16 + last_write_checksum: sha1:c1b7078545826eb3dfe078120fe142ed30e97ea1 + pristine_git_object: 5931b7f6361978af77c74b151ac4d6bb3d4dbbf2 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -14076,8 +14076,8 @@ trackedFiles: pristine_git_object: a7d2a453235cec62fc57f78c6e07b3cbd5824061 src/openrouter/components/observabilityotelcollectordestination.py: id: dc77f211456a - last_write_checksum: sha1:4fafd63d0a1dc1120e37871c46b9a1438ac05eda - pristine_git_object: e94b83f5ebce437e54ace0a5079149190940eff1 + last_write_checksum: sha1:67e451d48e15f0e9013553cc91e35f1e9c76bb5b + pristine_git_object: 26154ee5c99e652710414a83969fd80622ab6100 src/openrouter/components/observabilityposthogdestination.py: id: 3a9f4942fcf9 last_write_checksum: sha1:eb26037b36426da6a3c8a734946accd78045e0b2 @@ -14420,8 +14420,8 @@ trackedFiles: pristine_git_object: d5a5c820aff0971a68a725af296d68d8d3891992 src/openrouter/components/outputtoolsearchservertoolitem.py: id: fb4ec737039d - last_write_checksum: sha1:ee1d3c15f23c0577932609ac3b9f5d0c486318fc - pristine_git_object: 90fe6d70aab60697f5fe69d3b0dc6044c69fb999 + last_write_checksum: sha1:7322e8736317e73dc9e63758ae6d3fb0907417a9 + pristine_git_object: cbecff6e9cdfa7834bcbb232dc71ef36398fa993 src/openrouter/components/outputwebfetchservertoolitem.py: id: 2b12eb287cdf last_write_checksum: sha1:60ec6ef59d691699c092120ea7dffed824197872 @@ -21609,4 +21609,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.presets.create_presets_responses()`: \n * `request.include[]` **Changed**\n" +releaseNotes: "## Python SDK Changes:\n* `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(openrouter:tool_search).catalog_index_note` **Added**\n* `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(openrouter:tool_search).catalog_index_note` **Added**\n* `open_router.observability.list()`: `response.data[].union(otel-collector).config` **Changed**\n* `open_router.observability.create()`: `response.data.union(otel-collector).config` **Changed**\n* `open_router.observability.get()`: `response.data.union(otel-collector).config` **Changed**\n* `open_router.observability.update()`: `response.data.union(otel-collector).config` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(OutputToolSearchServerToolItem).catalog_index_note` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ba793865f..ba3869ab8 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.169 + version: 1.3.170 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index ab93aeb3a..7a814e6df 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -24331,6 +24331,13 @@ components: type: 'string' description: 'Custom HTTP headers as a JSON object. For Axiom, use {"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"}' type: 'object' + metricsEndpoint: + description: 'OTLP/HTTP metrics URL. Required when `shouldSendMetrics` (Send OTLP metrics) is true; ignored otherwise.' + type: 'string' + shouldSendMetrics: + default: false + description: 'Also send OTLP metrics for each delivered generation to the metrics endpoint, with the same headers.' + type: 'boolean' required: - 'endpoint' type: 'object' @@ -28885,6 +28892,10 @@ components: description: 'The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.' example: "Deferred tools, found with tool_search and called with tool_exec:\nSources: mcp__sentry (12)." type: 'string' + catalog_index_note: + description: 'Whether the model read, after the catalog index, that the listed sources are those connected so far. Replaying the item shows that note only when this is true. Its wording follows the replaying request: it names `WaitForMcpServers` only while that request carries the tool.' + example: true + type: 'boolean' error: description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' example: 'Tool execution failed' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8c6402a6a..4c527cc6a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:66de2079f8a1b4a3ed4c3a4b71e57d171ed99bfbda6d0e9d59ece06614e79094 - sourceBlobDigest: sha256:dcc70de34e085acee2705cdc7faf83cbf4c21b769109663d09d3d8a0dc7aee1c + sourceRevisionDigest: sha256:6885d2855f3ae66c49062c150518080abc52f39a1b03c89930fc7f79b6c4aa25 + sourceBlobDigest: sha256:6334d0f3405226eda109b1d7df7ba961b55581a54363615c714c150e67fa8a4a tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:66de2079f8a1b4a3ed4c3a4b71e57d171ed99bfbda6d0e9d59ece06614e79094 - sourceBlobDigest: sha256:dcc70de34e085acee2705cdc7faf83cbf4c21b769109663d09d3d8a0dc7aee1c + sourceRevisionDigest: sha256:6885d2855f3ae66c49062c150518080abc52f39a1b03c89930fc7f79b6c4aa25 + sourceBlobDigest: sha256:6334d0f3405226eda109b1d7df7ba961b55581a54363615c714c150e67fa8a4a codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:17d98f9758f91de2501ece429f60cb7120117851c60d7bf7a55ab34d1c627fb6 + codeSamplesRevisionDigest: sha256:7b2a6716f9d8b9e6e43e0007aaeb98c1d7a5dd014fcc896f367d6e475d5669a2 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index c9a543338..e1ea47fa6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4459,4 +4459,14 @@ Based on: ### Generated - [python v1.3.169] . ### Releases -- [PyPI v1.3.169] https://pypi.org/project/openrouter/1.3.169 - . \ No newline at end of file +- [PyPI v1.3.169] https://pypi.org/project/openrouter/1.3.169 - . + +## 2026-11-12 17:07:44 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.170] . +### Releases +- [PyPI v1.3.170] https://pypi.org/project/openrouter/1.3.170 - . \ No newline at end of file diff --git a/docs/components/observabilityotelcollectordestinationconfig.mdx b/docs/components/observabilityotelcollectordestinationconfig.mdx index 8dd8c3883..ef238b152 100644 --- a/docs/components/observabilityotelcollectordestinationconfig.mdx +++ b/docs/components/observabilityotelcollectordestinationconfig.mdx @@ -7,4 +7,6 @@ title: "ObservabilityOtelCollectorDestinationConfig" | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | `endpoint` | *str* | ✔️ | N/A | -| `headers` | Dict[str, *str*] | ➖ | Custom HTTP headers as a JSON object. For Axiom, use \{"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"} | \ No newline at end of file +| `headers` | Dict[str, *str*] | ➖ | Custom HTTP headers as a JSON object. For Axiom, use \{"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"} | +| `metrics_endpoint` | *Optional[str]* | ➖ | OTLP/HTTP metrics URL. Required when `shouldSendMetrics` (Send OTLP metrics) is true; ignored otherwise. | +| `should_send_metrics` | *Optional[bool]* | ➖ | Also send OTLP metrics for each delivered generation to the metrics endpoint, with the same headers. | \ No newline at end of file diff --git a/docs/components/outputtoolsearchservertoolitem.mdx b/docs/components/outputtoolsearchservertoolitem.mdx index 433141ae0..201f1b8a2 100644 --- a/docs/components/outputtoolsearchservertoolitem.mdx +++ b/docs/components/outputtoolsearchservertoolitem.mdx @@ -7,19 +7,20 @@ An openrouter:tool_search server tool output item ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `arguments` | *Optional[str]* | ➖ | The JSON arguments of the model call, verbatim. Replaying the item reuses them. | \{"query":"weather tools"} | -| `call_id` | *Optional[str]* | ➖ | The ID of the model call that ran the search. Replaying the item reuses it. | call_search_1 | -| `catalog_changes` | *Optional[str]* | ➖ | What the announced index added and removed since the previous one, when the request opted into `announce_catalog_changes` and the catalog changed between model turns. Replaying the item shows the same lines. | Added since the previous index: mcp__okta (113). | -| `catalog_index` | *Optional[str]* | ➖ | The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index. | Deferred tools, found with tool_search and called with tool_exec:
Sources: mcp__sentry (12). | -| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | -| `format_` | [Optional[components.OutputToolSearchServerToolItemFormat]](../components/outputtoolsearchservertoolitemformat.mdx) | ➖ | How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result. | compact | -| `hint` | *Optional[str]* | ➖ | The guidance the model got when the search matched no tools. | No tools matched. Search again with other keywords, or load tools by exact name with "select:Name1,Name2". | -| `id` | *Optional[str]* | ➖ | N/A | | -| `matches` | List[[components.Match](../components/match.mdx)] | ➖ | N/A | | -| `query` | *Optional[str]* | ➖ | N/A | | -| `sources` | Dict[str, List[*str*]] | ➖ | The other deferred tools of each source a match came from, by name, when the search listed siblings. Replaying the item shows the same names. | \{
"mcp__tavily": [
"mcp__tavily__tavily_extract",
"mcp__tavily__tavily_crawl"
]
} | -| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✔️ | N/A | completed | -| `turn_call_ids` | List[*str*] | ➖ | The IDs of every tool call in the model response that ran the search, in order. Replaying the item keeps those calls in one turn. | [
"call_search_1",
"call_exec_1"
] | -| `type` | [components.OutputToolSearchServerToolItemType](../components/outputtoolsearchservertoolitemtype.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `arguments` | *Optional[str]* | ➖ | The JSON arguments of the model call, verbatim. Replaying the item reuses them. | \{"query":"weather tools"} | +| `call_id` | *Optional[str]* | ➖ | The ID of the model call that ran the search. Replaying the item reuses it. | call_search_1 | +| `catalog_changes` | *Optional[str]* | ➖ | What the announced index added and removed since the previous one, when the request opted into `announce_catalog_changes` and the catalog changed between model turns. Replaying the item shows the same lines. | Added since the previous index: mcp__okta (113). | +| `catalog_index` | *Optional[str]* | ➖ | The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index. | Deferred tools, found with tool_search and called with tool_exec:
Sources: mcp__sentry (12). | +| `catalog_index_note` | *Optional[bool]* | ➖ | Whether the model read, after the catalog index, that the listed sources are those connected so far. Replaying the item shows that note only when this is true. Its wording follows the replaying request: it names `WaitForMcpServers` only while that request carries the tool. | true | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `format_` | [Optional[components.OutputToolSearchServerToolItemFormat]](../components/outputtoolsearchservertoolitemformat.mdx) | ➖ | How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result. | compact | +| `hint` | *Optional[str]* | ➖ | The guidance the model got when the search matched no tools. | No tools matched. Search again with other keywords, or load tools by exact name with "select:Name1,Name2". | +| `id` | *Optional[str]* | ➖ | N/A | | +| `matches` | List[[components.Match](../components/match.mdx)] | ➖ | N/A | | +| `query` | *Optional[str]* | ➖ | N/A | | +| `sources` | Dict[str, List[*str*]] | ➖ | The other deferred tools of each source a match came from, by name, when the search listed siblings. Replaying the item shows the same names. | \{
"mcp__tavily": [
"mcp__tavily__tavily_extract",
"mcp__tavily__tavily_crawl"
]
} | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✔️ | N/A | completed | +| `turn_call_ids` | List[*str*] | ➖ | The IDs of every tool call in the model response that ran the search, in order. Replaying the item keeps those calls in one turn. | [
"call_search_1",
"call_exec_1"
] | +| `type` | [components.OutputToolSearchServerToolItemType](../components/outputtoolsearchservertoolitemtype.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d804c0cbf..ca7074d88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.169" +version = "1.3.170" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 24df38070..5931b7f63 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.169" +__version__: str = "1.3.170" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.169 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.170 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/observabilityotelcollectordestination.py b/src/openrouter/components/observabilityotelcollectordestination.py index e94b83f5e..26154ee5c 100644 --- a/src/openrouter/components/observabilityotelcollectordestination.py +++ b/src/openrouter/components/observabilityotelcollectordestination.py @@ -7,15 +7,20 @@ ObservabilityFilterRulesConfigTypedDict, ) from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +import pydantic from pydantic import model_serializer from typing import Dict, List, Literal, Optional -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class ObservabilityOtelCollectorDestinationConfigTypedDict(TypedDict): endpoint: str headers: NotRequired[Dict[str, str]] r"""Custom HTTP headers as a JSON object. For Axiom, use {\"Authorization\": \"Bearer xaat-xxx\", \"X-Axiom-Dataset\": \"your-dataset\"}""" + metrics_endpoint: NotRequired[str] + r"""OTLP/HTTP metrics URL. Required when `shouldSendMetrics` (Send OTLP metrics) is true; ignored otherwise.""" + should_send_metrics: NotRequired[bool] + r"""Also send OTLP metrics for each delivered generation to the metrics endpoint, with the same headers.""" class ObservabilityOtelCollectorDestinationConfig(BaseModel): @@ -24,9 +29,19 @@ class ObservabilityOtelCollectorDestinationConfig(BaseModel): headers: Optional[Dict[str, str]] = None r"""Custom HTTP headers as a JSON object. For Axiom, use {\"Authorization\": \"Bearer xaat-xxx\", \"X-Axiom-Dataset\": \"your-dataset\"}""" + metrics_endpoint: Annotated[ + Optional[str], pydantic.Field(alias="metricsEndpoint") + ] = None + r"""OTLP/HTTP metrics URL. Required when `shouldSendMetrics` (Send OTLP metrics) is true; ignored otherwise.""" + + should_send_metrics: Annotated[ + Optional[bool], pydantic.Field(alias="shouldSendMetrics") + ] = False + r"""Also send OTLP metrics for each delivered generation to the metrics endpoint, with the same headers.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["headers"]) + optional_fields = set(["headers", "metricsEndpoint", "shouldSendMetrics"]) serialized = handler(self) m = {} @@ -142,3 +157,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + ObservabilityOtelCollectorDestinationConfig.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/outputtoolsearchservertoolitem.py b/src/openrouter/components/outputtoolsearchservertoolitem.py index 90fe6d70a..cbecff6e9 100644 --- a/src/openrouter/components/outputtoolsearchservertoolitem.py +++ b/src/openrouter/components/outputtoolsearchservertoolitem.py @@ -43,6 +43,8 @@ class OutputToolSearchServerToolItemTypedDict(TypedDict): r"""What the announced index added and removed since the previous one, when the request opted into `announce_catalog_changes` and the catalog changed between model turns. Replaying the item shows the same lines.""" catalog_index: NotRequired[str] r"""The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.""" + catalog_index_note: NotRequired[bool] + r"""Whether the model read, after the catalog index, that the listed sources are those connected so far. Replaying the item shows that note only when this is true. Its wording follows the replaying request: it names `WaitForMcpServers` only while that request carries the tool.""" error: NotRequired[str] r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" format_: NotRequired[OutputToolSearchServerToolItemFormat] @@ -77,6 +79,9 @@ class OutputToolSearchServerToolItem(BaseModel): catalog_index: Optional[str] = None r"""The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.""" + catalog_index_note: Optional[bool] = None + r"""Whether the model read, after the catalog index, that the listed sources are those connected so far. Replaying the item shows that note only when this is true. Its wording follows the replaying request: it names `WaitForMcpServers` only while that request carries the tool.""" + error: Optional[str] = None r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" @@ -108,6 +113,7 @@ def serialize_model(self, handler): "call_id", "catalog_changes", "catalog_index", + "catalog_index_note", "error", "format", "hint", diff --git a/uv.lock b/uv.lock index 8d4d7939d..caf5715fb 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.169" +version = "1.3.170" source = { editable = "." } dependencies = [ { name = "httpcore" }, From b4a6f4b3c9d7a912313fe992dd91052637cc9acb Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:10:58 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow