diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1d719f29..3286f42e 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: fed338adcb556fa937435793d80ba94a + docChecksum: 1e2c7bd771afbed597a3fe7ca5edde65 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.31 - configChecksum: 738c44a70d4bc0a581eb475d9e00b44a + releaseVersion: 1.3.32 + configChecksum: afe161db7afe8f8492778f099074d78b repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: e4486bab-3f14-41b9-950a-4706ee83390e - pristine_commit_hash: a257bb9e4d3c0171cd432677627c33a729c341e3 - pristine_tree_hash: d6c495cff3d2ebdeb6878413200337e07c0758be + generation_id: ed66f8f4-0c57-4953-a2bb-a93ff5a00fc0 + pristine_commit_hash: 91af034be0e5150ade4eb81419dd7c4009a89668 + pristine_tree_hash: 555ed61fb71a03ef7124ea73079b65d08b40b458 features: python: acceptHeaders: 3.0.0 @@ -5584,8 +5584,8 @@ trackedFiles: pristine_git_object: 510bb66605a709aea0c2025829cd1b1d1a46e673 docs/components/outputitems.mdx: id: 876e956be23e - last_write_checksum: sha1:12794ca2c665bfee086e9117a84eed62f7e13eeb - pristine_git_object: a0d4eb80a23a0d89e9f37c10e13f40c9086ed7e6 + last_write_checksum: sha1:e788d832c06006861c55efaa16cee423a608e16b + pristine_git_object: ab5138435c7b18390111af9150d23316dc69d83f docs/components/outputitemwebsearchcall.mdx: id: 5a7fc683da6e last_write_checksum: sha1:7de83721d0a296832de2fe1357e0992fadc67352 @@ -5834,6 +5834,18 @@ trackedFiles: id: 5a130ca4fc23 last_write_checksum: sha1:c1b5e6a8dc5a416b85c05ebf4ebb0dc5937ae03b pristine_git_object: 9c9b6d5923e87acc8d5abcd3ab587324fcda9cdc + docs/components/outputtoolsearchcallitem.mdx: + id: 84f468366130 + last_write_checksum: sha1:d4186f2ec2744bf39a49f923790601665ee0b0ff + pristine_git_object: c12730c02ed195d57a7c7990bcaba3035daf441e + docs/components/outputtoolsearchcallitemexecution.mdx: + id: 2a220ef3ec3f + last_write_checksum: sha1:cdccb829e59810f4bd4a502268f3dd83f05a0d6e + pristine_git_object: e6177ab00e8d163cbeeedf37a50c7b429e71d8ab + docs/components/outputtoolsearchcallitemtype.mdx: + id: e399ca2e156c + last_write_checksum: sha1:72c4bfbf8aa490befc47312ed8b5e16a78f3b5e6 + pristine_git_object: d68bd61421859df1e00c0ec15f5a6946ed52dfd1 docs/components/outputtoolsearchservertoolitem.mdx: id: 7106fbb89729 last_write_checksum: sha1:ca50deb8179a0e3c28352bdb1c558b32d209bb4a @@ -10056,8 +10068,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:f0cd2fa4f851f4411afb3f6ae9c07ad2b43eae10 - pristine_git_object: ac6f28ff1f0e6ca9f41f16c1ab3d9557fda88c3a + last_write_checksum: sha1:2195e43e13a58488b3d9d8d221850e3c4c4934d7 + pristine_git_object: 3f7f85f061dc8970a0acec53f61f74a5929eccfc scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10084,8 +10096,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:aec5bd12e62f41511f30881ea1e3297fb992da2a - pristine_git_object: 156c6eb6c4130181de9fc4d55df6ba1bcd570fe4 + last_write_checksum: sha1:3a55ecf08814769e1ed8f30f174e43d396ed72a9 + pristine_git_object: 19e295e38e86f408aac633826643dbbe1c9156eb src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10132,8 +10144,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:650a38893185b857e33b7beff6d6aec857b9d56c - pristine_git_object: 87358e71caed4071ac708ef914b7c35878f89e75 + last_write_checksum: sha1:60668776ec2dc42407cb36292a6c99ce51dc2aea + pristine_git_object: d2ec3b38b68753e9bdf2d3d3bdbd67b8ae9f508c src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -12456,8 +12468,8 @@ trackedFiles: pristine_git_object: 616b0f5112e106777b4c096aeea6fef58ff32020 src/openrouter/components/outputitems.py: id: 90f107de3116 - last_write_checksum: sha1:d76bcccc67a6e35b740ffa6be3d33c7de00c15b3 - pristine_git_object: 17c17357d85bff6a3cd783e66ef4d3f368b0eae2 + last_write_checksum: sha1:4e830d98d101a1af2105caa8b5ae52d1f0e7f29f + pristine_git_object: 1b9113713b190526cfcdf504f0f408db0d9ecf11 src/openrouter/components/outputitemwebsearchcall.py: id: bac8732aecb9 last_write_checksum: sha1:00d5b67226d6ff2c6a5497e6e01c764aeede496e @@ -12514,6 +12526,10 @@ trackedFiles: id: 2a5dc9318fe6 last_write_checksum: sha1:fc1bf715ac0084d7390eb75152f0f27994654fab pristine_git_object: bec8c97af1334b3cfe4631b5bf725e801720bcb1 + src/openrouter/components/outputtoolsearchcallitem.py: + id: 9a666566a958 + last_write_checksum: sha1:82621ec8199139992f0e09ef480609726d8d2f97 + pristine_git_object: d5a5c820aff0971a68a725af296d68d8d3891992 src/openrouter/components/outputtoolsearchservertoolitem.py: id: fb4ec737039d last_write_checksum: sha1:2c5103df28975ab65e9d3fca97bee7039cf85c90 @@ -18418,5 +18434,7 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.interns.sign_intern_daemon_access_request()`: **Added** - * `open_router.interns.sign_intern_daemon_request()`: **Added** + * `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(tool_search_call)` **Added** + * `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[].union(tool_search_call)` **Added** + * `open_router.responses.send()`: `response` **Changed** + * `open_router.beta.responses.send()`: `response` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 328ecddf..789b3219 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.31 + version: 1.3.32 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index d891e8b1..c1dce256 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -23795,6 +23795,7 @@ components: reasoning: '#/components/schemas/OutputReasoningItem' shell_call: '#/components/schemas/OutputShellCallItem' shell_call_output: '#/components/schemas/OutputShellCallOutputItem' + tool_search_call: '#/components/schemas/OutputToolSearchCallItem' web_search_call: '#/components/schemas/OutputWebSearchCallItem' propertyName: 'type' example: @@ -23837,6 +23838,7 @@ components: - $ref: '#/components/schemas/OutputSubagentServerToolItem' - $ref: '#/components/schemas/OutputFilesServerToolItem' - $ref: '#/components/schemas/OutputCustomToolCallItem' + - $ref: '#/components/schemas/OutputToolSearchCallItem' OutputItemWebSearchCall: additionalProperties: {} example: @@ -24410,6 +24412,38 @@ components: - 'status' - 'type' type: 'object' + OutputToolSearchCallItem: + description: 'A call the model made to a `tool_search` tool declared with `"execution": "client"`. The client runs the search and replays this item with a `tool_search_output` item.' + example: + arguments: + query: 'weather' + call_id: 'call-abc123' + execution: 'client' + id: 'tsc-abc123' + status: 'completed' + type: 'tool_search_call' + properties: + arguments: {} + call_id: + type: 'string' + execution: + enum: + - 'client' + type: 'string' + id: + type: 'string' + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - 'tool_search_call' + type: 'string' + required: + - 'type' + - 'execution' + - 'call_id' + - 'status' + type: 'object' OutputToolSearchServerToolItem: description: 'An openrouter:tool_search server tool output item' example: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 9fdbfad1..68e39aba 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:76890df717c5d864669ff4732632fe4145cabb3ed31617eccaf999341049a3f3 - sourceBlobDigest: sha256:7577bdc8b53accc00faa0214440c09a0fb4b5b4ba6600380c963a853c700b801 + sourceRevisionDigest: sha256:b0338d6777e7aef8794536ab2b01600c532f442eaf31abdb76bfe6f5a111de2f + sourceBlobDigest: sha256:9291ce4fdd172d767eb0753e3661380f632e79978f8b865aff59fa11e07763d9 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:76890df717c5d864669ff4732632fe4145cabb3ed31617eccaf999341049a3f3 - sourceBlobDigest: sha256:7577bdc8b53accc00faa0214440c09a0fb4b5b4ba6600380c963a853c700b801 + sourceRevisionDigest: sha256:b0338d6777e7aef8794536ab2b01600c532f442eaf31abdb76bfe6f5a111de2f + sourceBlobDigest: sha256:9291ce4fdd172d767eb0753e3661380f632e79978f8b865aff59fa11e07763d9 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:f0e4ca5a5b5b0a21317aeb706e04fee0cc360a6ef52eb30b1e8fc81dea1cc3d6 + codeSamplesRevisionDigest: sha256:3dd6f9a9f90f62ef046378a633f9c56002be05c3cc969eddf3d4a938656c4404 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index eb98b31e..25685872 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3079,4 +3079,14 @@ Based on: ### Generated - [python v1.3.31] . ### Releases -- [PyPI v1.3.31] https://pypi.org/project/openrouter/1.3.31 - . \ No newline at end of file +- [PyPI v1.3.31] https://pypi.org/project/openrouter/1.3.31 - . + +## 2026-10-07 15:37:16 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.32] . +### Releases +- [PyPI v1.3.32] https://pypi.org/project/openrouter/1.3.32 - . \ No newline at end of file diff --git a/docs/components/outputitems.mdx b/docs/components/outputitems.mdx index a0d4eb80..ab513843 100644 --- a/docs/components/outputitems.mdx +++ b/docs/components/outputitems.mdx @@ -187,6 +187,12 @@ value: components.OutputShellCallItem = /* values here */ value: components.OutputShellCallOutputItem = /* values here */ ``` +### `components.OutputToolSearchCallItem` + +```python +value: components.OutputToolSearchCallItem = /* values here */ +``` + ### `components.OutputWebSearchCallItem` ```python diff --git a/docs/components/outputtoolsearchcallitem.mdx b/docs/components/outputtoolsearchcallitem.mdx new file mode 100644 index 00000000..ac0b9bb9 --- /dev/null +++ b/docs/components/outputtoolsearchcallitem.mdx @@ -0,0 +1,17 @@ +--- +title: "OutputToolSearchCallItem" +--- + +A call the model made to a `tool_search` tool declared with `"execution": "client"`. The client runs the search and replays this item with a `tool_search_output` item. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `arguments` | *Optional[Any]* | ➖ | N/A | | +| `call_id` | *str* | ✅ | N/A | | +| `execution` | [components.OutputToolSearchCallItemExecution](../components/outputtoolsearchcallitemexecution.mdx) | ✅ | N/A | | +| `id` | *Optional[str]* | ➖ | N/A | | +| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | +| `type` | [components.OutputToolSearchCallItemType](../components/outputtoolsearchcallitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputtoolsearchcallitemexecution.mdx b/docs/components/outputtoolsearchcallitemexecution.mdx new file mode 100644 index 00000000..e6177ab0 --- /dev/null +++ b/docs/components/outputtoolsearchcallitemexecution.mdx @@ -0,0 +1,15 @@ +--- +title: "OutputToolSearchCallItemExecution" +--- + +## Example Usage + +```python +from openrouter.components import OutputToolSearchCallItemExecution +value: OutputToolSearchCallItemExecution = "client" +``` + + +## Values + +- `"client"` diff --git a/docs/components/outputtoolsearchcallitemtype.mdx b/docs/components/outputtoolsearchcallitemtype.mdx new file mode 100644 index 00000000..d68bd614 --- /dev/null +++ b/docs/components/outputtoolsearchcallitemtype.mdx @@ -0,0 +1,15 @@ +--- +title: "OutputToolSearchCallItemType" +--- + +## Example Usage + +```python +from openrouter.components import OutputToolSearchCallItemType +value: OutputToolSearchCallItemType = "tool_search_call" +``` + + +## Values + +- `"tool_search_call"` diff --git a/pyproject.toml b/pyproject.toml index ac6f28ff..3f7f85f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.31" +version = "1.3.32" 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 156c6eb6..19e295e3 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.31" +__version__: str = "1.3.32" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.31 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.32 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 87358e71..d2ec3b38 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -3329,6 +3329,12 @@ OutputTextEditorServerToolItemType, OutputTextEditorServerToolItemTypedDict, ) + from .outputtoolsearchcallitem import ( + OutputToolSearchCallItem, + OutputToolSearchCallItemExecution, + OutputToolSearchCallItemType, + OutputToolSearchCallItemTypedDict, + ) from .outputtoolsearchservertoolitem import ( OutputToolSearchServerToolItem, OutputToolSearchServerToolItemType, @@ -6650,6 +6656,10 @@ "OutputTextEditorServerToolItemTypedDict", "OutputTokensDetails", "OutputTokensDetailsTypedDict", + "OutputToolSearchCallItem", + "OutputToolSearchCallItemExecution", + "OutputToolSearchCallItemType", + "OutputToolSearchCallItemTypedDict", "OutputToolSearchServerToolItem", "OutputToolSearchServerToolItemType", "OutputToolSearchServerToolItemTypedDict", @@ -9982,6 +9992,10 @@ "OutputTextEditorServerToolItem": ".outputtexteditorservertoolitem", "OutputTextEditorServerToolItemType": ".outputtexteditorservertoolitem", "OutputTextEditorServerToolItemTypedDict": ".outputtexteditorservertoolitem", + "OutputToolSearchCallItem": ".outputtoolsearchcallitem", + "OutputToolSearchCallItemExecution": ".outputtoolsearchcallitem", + "OutputToolSearchCallItemType": ".outputtoolsearchcallitem", + "OutputToolSearchCallItemTypedDict": ".outputtoolsearchcallitem", "OutputToolSearchServerToolItem": ".outputtoolsearchservertoolitem", "OutputToolSearchServerToolItemType": ".outputtoolsearchservertoolitem", "OutputToolSearchServerToolItemTypedDict": ".outputtoolsearchservertoolitem", diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py index 17c17357..1b911371 100644 --- a/src/openrouter/components/outputitems.py +++ b/src/openrouter/components/outputitems.py @@ -97,6 +97,10 @@ OutputTextEditorServerToolItem, OutputTextEditorServerToolItemTypedDict, ) +from .outputtoolsearchcallitem import ( + OutputToolSearchCallItem, + OutputToolSearchCallItemTypedDict, +) from .outputtoolsearchservertoolitem import ( OutputToolSearchServerToolItem, OutputToolSearchServerToolItemTypedDict, @@ -125,23 +129,24 @@ OutputItemsTypedDict = TypeAliasType( "OutputItemsTypedDict", Union[ - OutputFileSearchCallItemTypedDict, OutputFileSearchServerToolItemTypedDict, + OutputFileSearchCallItemTypedDict, + OutputMcpServerToolItemTypedDict, OutputToolSearchServerToolItemTypedDict, OutputWebSearchCallItemTypedDict, - OutputMcpServerToolItemTypedDict, OutputImageGenerationCallItemTypedDict, OutputApplyPatchCallItemTypedDict, OutputTextEditorServerToolItemTypedDict, OutputBrowserUseServerToolItemTypedDict, OutputWebSearchServerToolItemTypedDict, - OutputShellCallItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, - OutputMemoryServerToolItemTypedDict, OutputDatetimeItemTypedDict, + OutputMemoryServerToolItemTypedDict, + OutputToolSearchCallItemTypedDict, OutputMessageItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, OutputComputerCallItemTypedDict, OutputApplyPatchServerToolItemTypedDict, + OutputShellCallItemTypedDict, OutputCodeInterpreterCallItemTypedDict, OutputWebFetchServerToolItemTypedDict, OutputCodeInterpreterServerToolItemTypedDict, @@ -149,8 +154,8 @@ OutputAdvisorServerToolItemTypedDict, OutputCustomToolCallItemTypedDict, OutputShellCallOutputItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, OutputFusionServerToolItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, OutputShellServerToolItemTypedDict, OutputFunctionCallItemTypedDict, OutputFilesServerToolItemTypedDict, @@ -202,6 +207,7 @@ class UnknownOutputItems(BaseModel): "reasoning": OutputReasoningItem, "shell_call": OutputShellCallItem, "shell_call_output": OutputShellCallOutputItem, + "tool_search_call": OutputToolSearchCallItem, "web_search_call": OutputWebSearchCallItem, } @@ -238,6 +244,7 @@ class UnknownOutputItems(BaseModel): OutputReasoningItem, OutputShellCallItem, OutputShellCallOutputItem, + OutputToolSearchCallItem, OutputWebSearchCallItem, UnknownOutputItems, ], diff --git a/src/openrouter/components/outputtoolsearchcallitem.py b/src/openrouter/components/outputtoolsearchcallitem.py new file mode 100644 index 00000000..d5a5c820 --- /dev/null +++ b/src/openrouter/components/outputtoolsearchcallitem.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolcallstatus import ToolCallStatus +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +OutputToolSearchCallItemExecution = Literal["client",] + + +OutputToolSearchCallItemType = Literal["tool_search_call",] + + +class OutputToolSearchCallItemTypedDict(TypedDict): + r"""A call the model made to a `tool_search` tool declared with `\"execution\": \"client\"`. The client runs the search and replays this item with a `tool_search_output` item.""" + + call_id: str + execution: OutputToolSearchCallItemExecution + status: ToolCallStatus + type: OutputToolSearchCallItemType + arguments: NotRequired[Any] + id: NotRequired[str] + + +class OutputToolSearchCallItem(BaseModel): + r"""A call the model made to a `tool_search` tool declared with `\"execution\": \"client\"`. The client runs the search and replays this item with a `tool_search_output` item.""" + + call_id: str + + execution: OutputToolSearchCallItemExecution + + status: ToolCallStatus + + type: OutputToolSearchCallItemType + + arguments: Optional[Any] = None + + id: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["arguments", "id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/uv.lock b/uv.lock index 83df5cf9..66e13d96 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.31" +version = "1.3.32" source = { editable = "." } dependencies = [ { name = "httpcore" },