diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1ed025d8..9f95c48f 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: 008831fad14f3f8944c471d04ded3043 + docChecksum: 52e6fdf4210e93487c3774e6ec33dbcf docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.212 - configChecksum: dc9fb28166e948365f42ce4b943fe57f + releaseVersion: 1.3.213 + configChecksum: 2e6d1442dfccfbbcb558ac1f94c48d3f repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 5310aeb0-becc-4782-ac43-0459edbe840b - pristine_commit_hash: f1f7d600bca15c3ae4cd34ce6b137d6d0457d543 - pristine_tree_hash: 35b582cd969731a5bb5dab954059a20e99fbca1a + generation_id: f10649c5-fc8b-4a72-a0ed-b412b3c29290 + pristine_commit_hash: 4ab74749d9b83c6ae1502007c7cf8a93ff0d6e36 + pristine_tree_hash: 0ab90787bd4ee9eeeeadd9e5f50574115663e863 features: python: acceptHeaders: 3.0.0 @@ -272,8 +272,8 @@ trackedFiles: pristine_git_object: 28ee7a5691f7254183a33644a1d72cdc4202e23b docs/components/alignmentresponsesrejected.mdx: id: eea4008474f0 - last_write_checksum: sha1:44453b64e436f4e6771dbcae670a4eb7cafb65d3 - pristine_git_object: b0c408ff3e7f8ed385ff29d1cae8803e4ab7e1a8 + last_write_checksum: sha1:e4a3f90fe876233bce47f448cd341e8910e7af30 + pristine_git_object: 6a729b0aa6beea1ecd9f95d7fb28822f8eb46abf docs/components/alignmentrule.mdx: id: ce3e91b088a0 last_write_checksum: sha1:86898783d585075925509829c460b5547271af9a @@ -6826,6 +6826,22 @@ trackedFiles: id: 876e956be23e last_write_checksum: sha1:709e4571a6dcef4b6bf5fd577674c8ef1c5f7bc5 pristine_git_object: 7b09b45f7e7f7637df45e795529e28ab73c3cc21 + docs/components/outputitemtoolsearchcall.mdx: + id: a4b724d8dbac + last_write_checksum: sha1:c2145eaae9bada389c149682ec18ee64f9851b02 + pristine_git_object: 2f6ad6f81320ec23b967505c5b574edfe625a1ff + docs/components/outputitemtoolsearchcallexecution.mdx: + id: eb490e65e0b8 + last_write_checksum: sha1:9d80a7b96ef8e25e308afd5b6a438a076cec887d + pristine_git_object: 7a5de7d566bd0eaf9a2307d9c1ee6d847fbc5d00 + docs/components/outputitemtoolsearchcallstatus.mdx: + id: d64036b61b42 + last_write_checksum: sha1:a481b1f2b64ba5060fe391d86c2b2ebc581c0617 + pristine_git_object: 6d87390b33bb70d5eaa4c94dd3e3679d24376375 + docs/components/outputitemtoolsearchcalltype.mdx: + id: 3ba568645f1c + last_write_checksum: sha1:f694ebb8b77dd9b23ffe29f45661be514837f51c + pristine_git_object: 09a51da3ad2ca9768239310910aedfbc3d657217 docs/components/outputitemwebsearchcall.mdx: id: 5a7fc683da6e last_write_checksum: sha1:147e2d8107125a6eeddd5b81e4a80fae22030cb3 @@ -11896,8 +11912,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:f61f7d027cce394a48dba6ac227973bc2a335952 - pristine_git_object: cf1ec5a34d662ae46248567a6ab9e76d4b46bf78 + last_write_checksum: sha1:3c16fd3e8fd333e1ebddb9a194c303bea6183979 + pristine_git_object: b45fa349cb5830faf062951e48ffa239051bb235 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11924,8 +11940,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:35b8b1e3af9b1003b85eeddd8275af7a1e69dd4d - pristine_git_object: 59b82f600ff9ec94c7498cef214cea94199c716f + last_write_checksum: sha1:8b0a5753f5cdf224362aa738e73a60a18b890c19 + pristine_git_object: 6521f450b2867a860e0837785970a1b1e3050eb6 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -11972,8 +11988,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:b0804e61e1cdda20a75ac294b31b2245030d2bf4 - pristine_git_object: 56bef4aeeed119ac0b25ea913903d725d44db6e0 + last_write_checksum: sha1:8f1ba82a54201f48d03eea3f4483a69f3c595fef + pristine_git_object: 085716e02c2361b5200234471bde441fc9569e63 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:08125e1d60df82793e11e8aed6e3c9fdb7512ebb @@ -12060,8 +12076,8 @@ trackedFiles: pristine_git_object: b2fa33dbe51cef3ebba3298492fea70c1112dc95 src/openrouter/components/alignmentresponsesrejected.py: id: f95a8a915824 - last_write_checksum: sha1:a6f46460e89e377f9392dac7a0874617ce2e25a7 - pristine_git_object: 870d6f53572b156f99769818a5637b6c6b655c78 + last_write_checksum: sha1:816ac126e1deeca874447c90b36392fdc5dc414e + pristine_git_object: 887ee3823877774aea8cde83f82eefa6d87676fd src/openrouter/components/alignmentrule.py: id: 54982e2c3889 last_write_checksum: sha1:b244b847343e4f1e3c1c3c458e6cf44a5e8a6c34 @@ -14714,6 +14730,10 @@ trackedFiles: id: 90f107de3116 last_write_checksum: sha1:d7dafe97dc6bf6a0de62084afa54ff14d74b5b94 pristine_git_object: 909f7601f58c6d208b37e7a5e7665eedbbda4b5c + src/openrouter/components/outputitemtoolsearchcall.py: + id: 745440da2bc3 + last_write_checksum: sha1:30856f53e47f0384072bc1459b82ed0bf6f57b3f + pristine_git_object: 0cefa7585ccbc1300af59ee4faabaded7122dd80 src/openrouter/components/outputitemwebsearchcall.py: id: bac8732aecb9 last_write_checksum: sha1:00d5b67226d6ff2c6a5497e6e01c764aeede496e @@ -22097,4 +22117,8 @@ examples: "500": application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.batch.get_results()`: **Added**\n* `open_router.tts.create_speech()`: \n * `request.response_format.enum(wav)` **Added**\n* `open_router.batch.delete()`: `error.status[503]` **Added**\n* `open_router.guardrails.list()`: `response.data[].allow_safety_retention_openai` **Added**\n* `open_router.guardrails.create()`: \n * `request.allow_safety_retention_openai` **Added**\n * `response.data.allow_safety_retention_openai` **Added**\n* `open_router.guardrails.get()`: `response.data.allow_safety_retention_openai` **Added**\n* `open_router.guardrails.update()`: \n * `request.allow_safety_retention_openai` **Added**\n * `response.data.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.list_account_policies()`: `response.data[].union(model_availability).config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.create_account_policy()`: \n * `request.account_guardrail_policy_request.union(model_availability).config.allow_safety_retention_openai` **Added**\n * `response.data.union(model_availability).config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.update_account_policy()`: \n * `request.account_guardrail_policy_request.union(model_availability).config.allow_safety_retention_openai` **Added**\n * `response.data.union(model_availability).config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.list_model_availability_policies()`: `response.data[].config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.create_model_availability_policy()`: \n * `request.config.allow_safety_retention_openai` **Added**\n * `response.data.config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.get_model_availability_policy()`: `response.data.config.allow_safety_retention_openai` **Added**\n* `open_router.guardrail_policies.update_model_availability_policy()`: \n * `request.config.allow_safety_retention_openai` **Added**\n * `response.data.config.allow_safety_retention_openai` **Added**\n* `open_router.api_keys.list()`: \n * `request.creator_user_id` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** + * `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** + * `open_router.batch.get_results()`: `response.data[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ba76609a..8a9ac030 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.212 + version: 1.3.213 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index b12318ae..c2213e8b 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -804,6 +804,7 @@ components: mcp_list_tools: '#/components/schemas/OutputItemMcpListTools' message: '#/components/schemas/OutputMessage' reasoning: '#/components/schemas/OutputItemReasoning' + tool_search_call: '#/components/schemas/OutputItemToolSearchCall' web_search_call: '#/components/schemas/OutputItemWebSearchCall' propertyName: 'type' oneOf: @@ -820,6 +821,7 @@ components: - $ref: '#/components/schemas/OutputItemMcpListTools' - $ref: '#/components/schemas/OutputItemMcpCall' - $ref: '#/components/schemas/OutputItemMcpApprovalRequest' + - $ref: '#/components/schemas/OutputItemToolSearchCall' type: 'array' AlignmentRule: additionalProperties: false @@ -5009,6 +5011,7 @@ components: mcp_list_tools: '#/components/schemas/OutputItemMcpListTools' message: '#/components/schemas/OutputMessage' reasoning: '#/components/schemas/OutputItemReasoning' + tool_search_call: '#/components/schemas/OutputItemToolSearchCall' web_search_call: '#/components/schemas/OutputItemWebSearchCall' propertyName: 'type' oneOf: @@ -5025,6 +5028,7 @@ components: - $ref: '#/components/schemas/OutputItemMcpListTools' - $ref: '#/components/schemas/OutputItemMcpCall' - $ref: '#/components/schemas/OutputItemMcpApprovalRequest' + - $ref: '#/components/schemas/OutputItemToolSearchCall' type: 'array' output_text: type: 'string' @@ -28249,6 +28253,7 @@ components: mcp_list_tools: '#/components/schemas/OutputItemMcpListTools' message: '#/components/schemas/OutputMessage' reasoning: '#/components/schemas/OutputItemReasoning' + tool_search_call: '#/components/schemas/OutputItemToolSearchCall' web_search_call: '#/components/schemas/OutputItemWebSearchCall' propertyName: 'type' oneOf: @@ -28265,6 +28270,7 @@ components: - $ref: '#/components/schemas/OutputItemMcpListTools' - $ref: '#/components/schemas/OutputItemMcpCall' - $ref: '#/components/schemas/OutputItemMcpApprovalRequest' + - $ref: '#/components/schemas/OutputItemToolSearchCall' output_index: type: 'integer' sequence_number: @@ -28469,6 +28475,7 @@ components: mcp_list_tools: '#/components/schemas/OutputItemMcpListTools' message: '#/components/schemas/OutputMessage' reasoning: '#/components/schemas/OutputItemReasoning' + tool_search_call: '#/components/schemas/OutputItemToolSearchCall' web_search_call: '#/components/schemas/OutputItemWebSearchCall' propertyName: 'type' oneOf: @@ -28485,6 +28492,7 @@ components: - $ref: '#/components/schemas/OutputItemMcpListTools' - $ref: '#/components/schemas/OutputItemMcpCall' - $ref: '#/components/schemas/OutputItemMcpApprovalRequest' + - $ref: '#/components/schemas/OutputItemToolSearchCall' output_index: type: 'integer' sequence_number: @@ -28861,6 +28869,42 @@ components: - $ref: '#/components/schemas/OutputCustomToolCallItem' - $ref: '#/components/schemas/OutputToolSearchCallItem' - $ref: '#/components/schemas/OutputArmorBlockedItem' + OutputItemToolSearchCall: + description: 'A native client-executed tool_search_call item returned by OpenAI Responses' + example: + arguments: + query: 'weather' + call_id: 'call_search_1' + execution: 'client' + status: 'completed' + type: 'tool_search_call' + properties: + arguments: {} + call_id: + type: 'string' + execution: + default: 'client' + enum: + - 'client' + type: 'string' + id: + type: 'string' + status: + default: 'completed' + enum: + - 'in_progress' + - 'completed' + - 'incomplete' + type: 'string' + x-speakeasy-unknown-values: allow + type: + enum: + - 'tool_search_call' + type: 'string' + required: + - 'type' + - 'call_id' + type: 'object' OutputItemWebSearchCall: additionalProperties: {} example: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 293bd975..8efc80b3 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:7969cc34c0838eab9463be5d4e81c64866732b3cbc8f144c5bab6542835236c7 - sourceBlobDigest: sha256:090f7d8f36fef54c65c562e285818219e14a1f2c368c1073e7f75c8c39501be1 + sourceRevisionDigest: sha256:c38fba950c92790fb387ad91e97bfdc7203c77c4b6b6b33ead216e478c0235b2 + sourceBlobDigest: sha256:0fde833d5c39625cd69de36899aa9faf93ed757a45496c4bce66a0fcc31384db tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:7969cc34c0838eab9463be5d4e81c64866732b3cbc8f144c5bab6542835236c7 - sourceBlobDigest: sha256:090f7d8f36fef54c65c562e285818219e14a1f2c368c1073e7f75c8c39501be1 + sourceRevisionDigest: sha256:c38fba950c92790fb387ad91e97bfdc7203c77c4b6b6b33ead216e478c0235b2 + sourceBlobDigest: sha256:0fde833d5c39625cd69de36899aa9faf93ed757a45496c4bce66a0fcc31384db codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:620974df16d7bca2b429f6d77670ae3de55fa55cc9de4687e0b25bff380cb3f3 + codeSamplesRevisionDigest: sha256:595305a918a9351fde2ed01fdf22875d09885431eaa004007d2b51a76a8c3e1f workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 1bfab0a0..cd0212e8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4889,4 +4889,14 @@ Based on: ### Generated - [python v1.3.212] . ### Releases -- [PyPI v1.3.212] https://pypi.org/project/openrouter/1.3.212 - . \ No newline at end of file +- [PyPI v1.3.212] https://pypi.org/project/openrouter/1.3.212 - . + +## 2026-11-29 04:09:35 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.213] . +### Releases +- [PyPI v1.3.213] https://pypi.org/project/openrouter/1.3.213 - . \ No newline at end of file diff --git a/docs/components/alignmentresponsesrejected.mdx b/docs/components/alignmentresponsesrejected.mdx index b0c408ff..6a729b0a 100644 --- a/docs/components/alignmentresponsesrejected.mdx +++ b/docs/components/alignmentresponsesrejected.mdx @@ -76,6 +76,12 @@ value: components.OutputMessage = /* values here */ value: components.OutputItemReasoning = /* values here */ ``` +### `components.OutputItemToolSearchCall` + +```python +value: components.OutputItemToolSearchCall = /* values here */ +``` + ### `components.OutputItemWebSearchCall` ```python diff --git a/docs/components/outputitemtoolsearchcall.mdx b/docs/components/outputitemtoolsearchcall.mdx new file mode 100644 index 00000000..2f6ad6f8 --- /dev/null +++ b/docs/components/outputitemtoolsearchcall.mdx @@ -0,0 +1,17 @@ +--- +title: "OutputItemToolSearchCall" +--- + +A native client-executed tool_search_call item returned by OpenAI Responses + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `arguments` | *Optional[Any]* | ➖ | N/A | +| `call_id` | *str* | ✔️ | N/A | +| `execution` | [Optional[components.OutputItemToolSearchCallExecution]](../components/outputitemtoolsearchcallexecution.mdx) | ➖ | N/A | +| `id` | *Optional[str]* | ➖ | N/A | +| `status` | [Optional[components.OutputItemToolSearchCallStatus]](../components/outputitemtoolsearchcallstatus.mdx) | ➖ | N/A | +| `type` | [components.OutputItemToolSearchCallType](../components/outputitemtoolsearchcalltype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/outputitemtoolsearchcallexecution.mdx b/docs/components/outputitemtoolsearchcallexecution.mdx new file mode 100644 index 00000000..7a5de7d5 --- /dev/null +++ b/docs/components/outputitemtoolsearchcallexecution.mdx @@ -0,0 +1,15 @@ +--- +title: "OutputItemToolSearchCallExecution" +--- + +## Example Usage + +```python +from openrouter.components import OutputItemToolSearchCallExecution +value: OutputItemToolSearchCallExecution = "client" +``` + + +## Values + +- `"client"` diff --git a/docs/components/outputitemtoolsearchcallstatus.mdx b/docs/components/outputitemtoolsearchcallstatus.mdx new file mode 100644 index 00000000..6d87390b --- /dev/null +++ b/docs/components/outputitemtoolsearchcallstatus.mdx @@ -0,0 +1,21 @@ +--- +title: "OutputItemToolSearchCallStatus" +--- + +## Example Usage + +```python +from openrouter.components import OutputItemToolSearchCallStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: OutputItemToolSearchCallStatus = "in_progress" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"in_progress"` +- `"completed"` +- `"incomplete"` diff --git a/docs/components/outputitemtoolsearchcalltype.mdx b/docs/components/outputitemtoolsearchcalltype.mdx new file mode 100644 index 00000000..09a51da3 --- /dev/null +++ b/docs/components/outputitemtoolsearchcalltype.mdx @@ -0,0 +1,15 @@ +--- +title: "OutputItemToolSearchCallType" +--- + +## Example Usage + +```python +from openrouter.components import OutputItemToolSearchCallType +value: OutputItemToolSearchCallType = "tool_search_call" +``` + + +## Values + +- `"tool_search_call"` diff --git a/pyproject.toml b/pyproject.toml index cf1ec5a3..b45fa349 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.212" +version = "1.3.213" 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 59b82f60..6521f450 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.212" +__version__: str = "1.3.213" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.212 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.213 2.950.13 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 56bef4ae..085716e0 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -3893,6 +3893,13 @@ OutputItemReasoningTypedDict, ) from .outputitems import OutputItems, OutputItemsTypedDict, UnknownOutputItems + from .outputitemtoolsearchcall import ( + OutputItemToolSearchCall, + OutputItemToolSearchCallExecution, + OutputItemToolSearchCallStatus, + OutputItemToolSearchCallType, + OutputItemToolSearchCallTypedDict, + ) from .outputitemwebsearchcall import ( OutputItemWebSearchCall, OutputItemWebSearchCallActionFindInPage, @@ -7922,6 +7929,11 @@ "OutputItemReasoningStatusUnionTypedDict", "OutputItemReasoningType", "OutputItemReasoningTypedDict", + "OutputItemToolSearchCall", + "OutputItemToolSearchCallExecution", + "OutputItemToolSearchCallStatus", + "OutputItemToolSearchCallType", + "OutputItemToolSearchCallTypedDict", "OutputItemWebSearchCall", "OutputItemWebSearchCallActionFindInPage", "OutputItemWebSearchCallActionFindInPageTypedDict", @@ -11899,6 +11911,11 @@ "OutputItems": ".outputitems", "OutputItemsTypedDict": ".outputitems", "UnknownOutputItems": ".outputitems", + "OutputItemToolSearchCall": ".outputitemtoolsearchcall", + "OutputItemToolSearchCallExecution": ".outputitemtoolsearchcall", + "OutputItemToolSearchCallStatus": ".outputitemtoolsearchcall", + "OutputItemToolSearchCallType": ".outputitemtoolsearchcall", + "OutputItemToolSearchCallTypedDict": ".outputitemtoolsearchcall", "OutputItemWebSearchCall": ".outputitemwebsearchcall", "OutputItemWebSearchCallActionFindInPage": ".outputitemwebsearchcall", "OutputItemWebSearchCallActionFindInPageTypedDict": ".outputitemwebsearchcall", diff --git a/src/openrouter/components/alignmentresponsesrejected.py b/src/openrouter/components/alignmentresponsesrejected.py index 870d6f53..887ee382 100644 --- a/src/openrouter/components/alignmentresponsesrejected.py +++ b/src/openrouter/components/alignmentresponsesrejected.py @@ -36,6 +36,10 @@ OutputItemMcpListToolsTypedDict, ) from .outputitemreasoning import OutputItemReasoning, OutputItemReasoningTypedDict +from .outputitemtoolsearchcall import ( + OutputItemToolSearchCall, + OutputItemToolSearchCallTypedDict, +) from .outputitemwebsearchcall import ( OutputItemWebSearchCall, OutputItemWebSearchCallTypedDict, @@ -56,15 +60,16 @@ OutputItemCompactionTypedDict, OutputItemFileSearchCallTypedDict, OutputItemImageGenerationCallTypedDict, + OutputItemMcpApprovalRequestTypedDict, OutputItemWebSearchCallTypedDict, OutputItemMcpListToolsTypedDict, - OutputItemMcpApprovalRequestTypedDict, OutputItemReasoningTypedDict, - OutputItemApplyPatchCallTypedDict, OutputMessageTypedDict, + OutputItemApplyPatchCallTypedDict, + OutputItemToolSearchCallTypedDict, OutputItemCodeInterpreterCallTypedDict, - OutputItemFunctionCallTypedDict, OutputItemCustomToolCallTypedDict, + OutputItemFunctionCallTypedDict, OutputItemMcpCallTypedDict, ], ) @@ -93,6 +98,7 @@ class UnknownAlignmentResponsesRejected(BaseModel): "mcp_list_tools": OutputItemMcpListTools, "message": OutputMessage, "reasoning": OutputItemReasoning, + "tool_search_call": OutputItemToolSearchCall, "web_search_call": OutputItemWebSearchCall, } @@ -111,6 +117,7 @@ class UnknownAlignmentResponsesRejected(BaseModel): OutputItemMcpListTools, OutputMessage, OutputItemReasoning, + OutputItemToolSearchCall, OutputItemWebSearchCall, UnknownAlignmentResponsesRejected, ], diff --git a/src/openrouter/components/outputitemtoolsearchcall.py b/src/openrouter/components/outputitemtoolsearchcall.py new file mode 100644 index 00000000..0cefa758 --- /dev/null +++ b/src/openrouter/components/outputitemtoolsearchcall.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Any, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +OutputItemToolSearchCallExecution = Literal["client",] + + +OutputItemToolSearchCallStatus = Union[ + Literal[ + "in_progress", + "completed", + "incomplete", + ], + UnrecognizedStr, +] + + +OutputItemToolSearchCallType = Literal["tool_search_call",] + + +class OutputItemToolSearchCallTypedDict(TypedDict): + r"""A native client-executed tool_search_call item returned by OpenAI Responses""" + + call_id: str + type: OutputItemToolSearchCallType + arguments: NotRequired[Any] + execution: NotRequired[OutputItemToolSearchCallExecution] + id: NotRequired[str] + status: NotRequired[OutputItemToolSearchCallStatus] + + +class OutputItemToolSearchCall(BaseModel): + r"""A native client-executed tool_search_call item returned by OpenAI Responses""" + + call_id: str + + type: OutputItemToolSearchCallType + + arguments: Optional[Any] = None + + execution: Optional[OutputItemToolSearchCallExecution] = "client" + + id: Optional[str] = None + + status: Optional[OutputItemToolSearchCallStatus] = "completed" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["arguments", "execution", "id", "status"]) + 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 e79a8abd..38e9c9ca 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.212" +version = "1.3.213" source = { editable = "." } dependencies = [ { name = "httpcore" },