chore: 🐝 Update SDK - Generate (spec change merged) 0.11.19 (#426)

Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-07-10 15:45:53 +00:00
committed by GitHub
co-authored by speakeasybot speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent 83c16a17c6
commit 8d8b3557fd
26 changed files with 802 additions and 95 deletions
+73 -21
View File
@@ -1,19 +1,19 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: c48cf606-fb42-4a45-9c23-8f0555307828 id: c48cf606-fb42-4a45-9c23-8f0555307828
management: management:
docChecksum: 16502ba1d37c69afff28bddd6d7626fa docChecksum: 5e32c54953ba574d9ee698feec69132b
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.787.0 speakeasyVersion: 1.787.0
generationVersion: 2.914.0 generationVersion: 2.914.0
releaseVersion: 0.11.18 releaseVersion: 0.11.19
configChecksum: a2b5416af2f6e419e890e700ebff85b2 configChecksum: 68995e9d0f9c16d2db0f9967edfb3af3
repoURL: https://github.com/OpenRouterTeam/python-sdk.git repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true published: true
persistentEdits: persistentEdits:
generation_id: 43c7e9de-e01c-454f-963f-fffefb852389 generation_id: 1d141ee6-3f2d-4871-9848-c0b44ce3fc81
pristine_commit_hash: 507fe1d22cb798a9ec68eac499ec65af7c93a995 pristine_commit_hash: 5d90a57f4c2fe856a5bdf25892ac7645ace722dc
pristine_tree_hash: e7dc383135ed75f29c946b77f2965d61ec238f63 pristine_tree_hash: 79eec5b9a9eebb656a47a973193134b0f2f61d67
features: features:
python: python:
acceptHeaders: 3.0.0 acceptHeaders: 3.0.0
@@ -156,6 +156,30 @@ trackedFiles:
id: 037d49b1a02c id: 037d49b1a02c
last_write_checksum: sha1:1ef65dad1b6f74dad67829f8b67d65da6144922b last_write_checksum: sha1:1ef65dad1b6f74dad67829f8b67d65da6144922b
pristine_git_object: 95bf97c81f4b519b1abf0b8ef96d5344140ac182 pristine_git_object: 95bf97c81f4b519b1abf0b8ef96d5344140ac182
docs/components/agent.mdx:
id: a9ece83c3330
last_write_checksum: sha1:6aa5ec348e98fe755fa241b09b94e9316f130a5a
pristine_git_object: d0300461c7036764ce02b5ad12748485406a018f
docs/components/agentmessageitem.mdx:
id: 207b0f2bd32f
last_write_checksum: sha1:11acb80bcbb86196a5fa991843bce2ffa8ce1f88
pristine_git_object: f50b6f364c0b9deddd755f43d68af8f032bc8298
docs/components/agentmessageitemcontentinputimage.mdx:
id: a491c3154b29
last_write_checksum: sha1:ae00600fdb044ef6055b821ea9e1c6ed1984059e
pristine_git_object: 67e9a2411f1fb7ed3dd9d20900ea39cca3c90536
docs/components/agentmessageitemcontentunion.mdx:
id: 1059ca11299e
last_write_checksum: sha1:772f5e3f8bd01d99bddc12160bf5e3b448bbf8a6
pristine_git_object: 0ffa1e9e09f27fe2e3fa668316ee29271a6ce46c
docs/components/agentmessageitemdetail.mdx:
id: fe0d57b4e1d7
last_write_checksum: sha1:3c38eb440eb62672a2543017bb57d2f9277ddbbc
pristine_git_object: 1e49ee6a692735eeaab980d66640a8212fb24152
docs/components/agentmessageitemtypeinputimage.mdx:
id: d16eed88b27f
last_write_checksum: sha1:f1b71145d88842c0b61651b24f1b7245ece6620d
pristine_git_object: 4acb9c2305ede0ba0e6596e3c2b8d261ff24e12d
docs/components/allowedtools.mdx: docs/components/allowedtools.mdx:
id: bc9b06183311 id: bc9b06183311
last_write_checksum: sha1:9b19ddb249037404d76b5c8f7cd8b40e20cf598d last_write_checksum: sha1:9b19ddb249037404d76b5c8f7cd8b40e20cf598d
@@ -1146,8 +1170,8 @@ trackedFiles:
pristine_git_object: 8a2adc33e4a201f48cc802d12dd0154dfa674aa9 pristine_git_object: 8a2adc33e4a201f48cc802d12dd0154dfa674aa9
docs/components/compactionitem.mdx: docs/components/compactionitem.mdx:
id: 26c52557072b id: 26c52557072b
last_write_checksum: sha1:5d5e9a7ece815c6cc9aea6cb3b484e8d3a7e0321 last_write_checksum: sha1:f8c0deb4eb10c507ec77d2be7669a96bb81c2a1b
pristine_git_object: 7fb1a632309091019e4f2622225c07f926e42b1b pristine_git_object: 52161ac34082b508dbc5da7e8ec8a380ab813c99
docs/components/compactionitemtype.mdx: docs/components/compactionitemtype.mdx:
id: 688981b39855 id: 688981b39855
last_write_checksum: sha1:70bb56c5e1b6352f709a63c98103e99c379fc86c last_write_checksum: sha1:70bb56c5e1b6352f709a63c98103e99c379fc86c
@@ -1208,6 +1232,10 @@ trackedFiles:
id: 1923f9db3cff id: 1923f9db3cff
last_write_checksum: sha1:59526732df9d4b5a69f3a79d1210493dff8d8898 last_write_checksum: sha1:59526732df9d4b5a69f3a79d1210493dff8d8898
pristine_git_object: 39acf3a7dc4de67d2eb07a4e21e33e6cfdd2091f pristine_git_object: 39acf3a7dc4de67d2eb07a4e21e33e6cfdd2091f
docs/components/contentencryptedcontent.mdx:
id: 0dc55809c394
last_write_checksum: sha1:97675b67fb3cdb6c892bbe01d2cd9e6bab5e4dec
pristine_git_object: f6d3a51c9fa32b15dd589583fd07b835f76f0ecc
docs/components/contentfilteraction.mdx: docs/components/contentfilteraction.mdx:
id: 11728ebb9679 id: 11728ebb9679
last_write_checksum: sha1:c2e70a8136e1af5a9a0e2abd930e5cd3bdb880a1 last_write_checksum: sha1:c2e70a8136e1af5a9a0e2abd930e5cd3bdb880a1
@@ -1340,6 +1368,14 @@ trackedFiles:
id: e53d83e87e2b id: e53d83e87e2b
last_write_checksum: sha1:22dd4ec3f699feb7d8f22abff79623b427292e35 last_write_checksum: sha1:22dd4ec3f699feb7d8f22abff79623b427292e35
pristine_git_object: c944724a99b7f7d4a9b5de4dc478f1e15643e20a pristine_git_object: c944724a99b7f7d4a9b5de4dc478f1e15643e20a
docs/components/contextcompactionitem.mdx:
id: 4e12480f54d6
last_write_checksum: sha1:b3491d872cda856a3c9e338cf9121af0e68f1be0
pristine_git_object: 4410f499ce362b79b38a3ea450e03913cfafc984
docs/components/contextcompactionitemtype.mdx:
id: 393257938ed7
last_write_checksum: sha1:28b03a5e14d3ab558cd6379fa25a4481e05e3016
pristine_git_object: a8256a82a3cc87a83ac240f2bd3971b29af436cf
docs/components/contextcompressionengine.mdx: docs/components/contextcompressionengine.mdx:
id: 684ea7e73a30 id: 684ea7e73a30
last_write_checksum: sha1:b093510814e6d7a1911104a6a5911e789b689759 last_write_checksum: sha1:b093510814e6d7a1911104a6a5911e789b689759
@@ -2434,8 +2470,8 @@ trackedFiles:
pristine_git_object: 33aee92c61bf7ab9beded4e193f50a2c08462378 pristine_git_object: 33aee92c61bf7ab9beded4e193f50a2c08462378
docs/components/inputsunion1.mdx: docs/components/inputsunion1.mdx:
id: c216609d21ce id: c216609d21ce
last_write_checksum: sha1:be2b2255aaaa200ee37b27ad64e428592f8065cd last_write_checksum: sha1:38d513739703efb245bb9c09606aacc35651ad92
pristine_git_object: be6efd1c3a0a797e8f00600fb2fb47fa00b4ddf4 pristine_git_object: 2e56403330ecae1d43fd2e4d23976dfe5330c38d
docs/components/inputtext.mdx: docs/components/inputtext.mdx:
id: c8a97322a50a id: c8a97322a50a
last_write_checksum: sha1:58653e40ea0a33629dda40d2a11c8d21a75b0467 last_write_checksum: sha1:58653e40ea0a33629dda40d2a11c8d21a75b0467
@@ -4704,6 +4740,10 @@ trackedFiles:
id: 6b8fbaf1abe6 id: 6b8fbaf1abe6
last_write_checksum: sha1:a8d7df683cc00996868f4a8f16d43f5171f9786c last_write_checksum: sha1:a8d7df683cc00996868f4a8f16d43f5171f9786c
pristine_git_object: 92220371000c3ec2476ecbeaccc4f095d25a997e pristine_git_object: 92220371000c3ec2476ecbeaccc4f095d25a997e
docs/components/typeagentmessage.mdx:
id: 806319bb3eee
last_write_checksum: sha1:486521730ba37bb9393665797e1f1cc775766874
pristine_git_object: b03f1ab2115442904e357d6aee81e6656a6b6f15
docs/components/typeany.mdx: docs/components/typeany.mdx:
id: b3bd6b0de96e id: b3bd6b0de96e
last_write_checksum: sha1:7d4c65b6740216e057d36ea498509249d9c97354 last_write_checksum: sha1:7d4c65b6740216e057d36ea498509249d9c97354
@@ -4744,6 +4784,10 @@ trackedFiles:
id: 2107f66972cb id: 2107f66972cb
last_write_checksum: sha1:47c1d819d31519b3d19a87f3389786d5c23206d4 last_write_checksum: sha1:47c1d819d31519b3d19a87f3389786d5c23206d4
pristine_git_object: 52ed7b166a48116cbd5a6f950a50f3f180c62a84 pristine_git_object: 52ed7b166a48116cbd5a6f950a50f3f180c62a84
docs/components/typeencryptedcontent.mdx:
id: 7e29de8a1874
last_write_checksum: sha1:19b66fd2808ce791e8ec41203dd91bf1eeb9a996
pristine_git_object: 62d36e211de192914adac3fd60dc58b52956f57a
docs/components/typeexec.mdx: docs/components/typeexec.mdx:
id: bdffae9225e9 id: bdffae9225e9
last_write_checksum: sha1:adcee4778c3a095280c7e3541c1bfec21eba0139 last_write_checksum: sha1:adcee4778c3a095280c7e3541c1bfec21eba0139
@@ -6534,8 +6578,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml: pyproject.toml:
id: 5d07e7d72637 id: 5d07e7d72637
last_write_checksum: sha1:bb8d05c87d2fce01ba7ea9fe811425844624c6d6 last_write_checksum: sha1:cbe4db46712b81214486e0f26d72f9384a264b7e
pristine_git_object: b9fecdcfb5971da6721e949608d09ca07d77307c pristine_git_object: 9c5d4bfdf21ef61dcb7441889ce4f49cbdba7881
scripts/prepare_readme.py: scripts/prepare_readme.py:
id: e0c5957a6035 id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -6562,8 +6606,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py: src/openrouter/_version.py:
id: d8d15ad6c586 id: d8d15ad6c586
last_write_checksum: sha1:109693a9a2f8aaa8302f4a8c79ca80d9f736ed4f last_write_checksum: sha1:fac5e109f7e32666cc375872e0a411749b13533e
pristine_git_object: 040c27279c9bd92aa793b82352d5b0b986c6faf9 pristine_git_object: 085782e387bd5ce779b4220e2c549eb621a203f3
src/openrouter/analytics.py: src/openrouter/analytics.py:
id: cb406b5aaabb id: cb406b5aaabb
last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841
@@ -6602,8 +6646,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py: src/openrouter/components/__init__.py:
id: 81754e97b3f4 id: 81754e97b3f4
last_write_checksum: sha1:db6939dcf34a388b4111cb127e372fd434a437c0 last_write_checksum: sha1:7da528c3b443bbc59febd9ba816c068802b8f5dd
pristine_git_object: 2b758c9d3531925e091e70d3aeb1559ecfef10a2 pristine_git_object: 0aa62516217cf61492f33d953c54956fbfeb4124
src/openrouter/components/aabenchmarkentry.py: src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82 id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -6636,6 +6680,10 @@ trackedFiles:
id: 683887bb9db3 id: 683887bb9db3
last_write_checksum: sha1:3a801b02cc92e02a00f0e26f377fb93a6893641a last_write_checksum: sha1:3a801b02cc92e02a00f0e26f377fb93a6893641a
pristine_git_object: d92e19f8e9bec36933cd3e5d7ccc1690f14b168f pristine_git_object: d92e19f8e9bec36933cd3e5d7ccc1690f14b168f
src/openrouter/components/agentmessageitem.py:
id: 6dbe0c8e2c79
last_write_checksum: sha1:cdc92eac94cf3a35a412c95f894345c7a362afeb
pristine_git_object: 612d33983cd731ce83f33949fb2e9ab05b89f43b
src/openrouter/components/annotationaddedevent.py: src/openrouter/components/annotationaddedevent.py:
id: dc032c9ad744 id: dc032c9ad744
last_write_checksum: sha1:8e5d49d2b57114df7f4559b611d40769e65f9f78 last_write_checksum: sha1:8e5d49d2b57114df7f4559b611d40769e65f9f78
@@ -7122,8 +7170,8 @@ trackedFiles:
pristine_git_object: ea86f79f7e10d7584621fb804ac56e7bb79578ba pristine_git_object: ea86f79f7e10d7584621fb804ac56e7bb79578ba
src/openrouter/components/compactionitem.py: src/openrouter/components/compactionitem.py:
id: f1535c3a68c3 id: f1535c3a68c3
last_write_checksum: sha1:c344678bd27fea9bae0da60dae93aff484483a20 last_write_checksum: sha1:877b1856696c67229c1f0bc9c39e98d79c11120f
pristine_git_object: 0c6d74912168fc04a0d756e9fac3b914e0ca6106 pristine_git_object: fd2fa67f5ed2630c005e33123ec291065ee5b6ff
src/openrouter/components/compoundfilter.py: src/openrouter/components/compoundfilter.py:
id: 0cab72c7a3bc id: 0cab72c7a3bc
last_write_checksum: sha1:7bc0251dcf6c06f0fd00c9cadee2fa6a1e88ea82 last_write_checksum: sha1:7bc0251dcf6c06f0fd00c9cadee2fa6a1e88ea82
@@ -7200,6 +7248,10 @@ trackedFiles:
id: 2dbef15bd5df id: 2dbef15bd5df
last_write_checksum: sha1:34ee6609ef4171a4d54b52e41b781970edcf8fa8 last_write_checksum: sha1:34ee6609ef4171a4d54b52e41b781970edcf8fa8
pristine_git_object: 50bdff02f1430696b08d5bb5dc38ba67704dad61 pristine_git_object: 50bdff02f1430696b08d5bb5dc38ba67704dad61
src/openrouter/components/contextcompactionitem.py:
id: 0212b34610c0
last_write_checksum: sha1:e4f65d722d166d4818afffe5a4d2e2756b810dba
pristine_git_object: 591e51c49354f87abbaaa20e6b7d9bdb10a2be69
src/openrouter/components/contextcompressionengine.py: src/openrouter/components/contextcompressionengine.py:
id: a3965275d07f id: a3965275d07f
last_write_checksum: sha1:8aeacab427a9277db44ef731fd7a38a58752a64f last_write_checksum: sha1:8aeacab427a9277db44ef731fd7a38a58752a64f
@@ -7642,8 +7694,8 @@ trackedFiles:
pristine_git_object: a3d84a96f4553a320f5eee5d63f6bc5c244ab446 pristine_git_object: a3d84a96f4553a320f5eee5d63f6bc5c244ab446
src/openrouter/components/inputs_union.py: src/openrouter/components/inputs_union.py:
id: 17d6239cb6a7 id: 17d6239cb6a7
last_write_checksum: sha1:56b54bc88ad27ba75866fa7f548fa405650d689a last_write_checksum: sha1:8f82753fd340ed60d3314a63e913500c3281d686
pristine_git_object: 138ccb8156df5fe2baa8b2b4b60dce353fd3cf7a pristine_git_object: 39681f4c16af7831a14dcccf7447e742c8a2b43b
src/openrouter/components/inputtext.py: src/openrouter/components/inputtext.py:
id: a995ae96be99 id: a995ae96be99
last_write_checksum: sha1:f78a6a35792b704f18ee6e1312c24f78f38cca36 last_write_checksum: sha1:f78a6a35792b704f18ee6e1312c24f78f38cca36
@@ -10909,4 +10961,4 @@ examples:
"500": "500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}} application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2 examplesVersion: 1.0.2
releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[].union(AdditionalToolsItem)` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(AdditionalToolsItem)` **Added**\n" releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed**\n"
+1 -1
View File
@@ -36,7 +36,7 @@ generation:
documentation: mintlify documentation: mintlify
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.11.18 version: 0.11.19
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+91
View File
@@ -364,6 +364,72 @@ components:
$ref: '#/components/schemas/AdvisorNestedTool' $ref: '#/components/schemas/AdvisorNestedTool'
type: array type: array
type: object type: object
AgentMessageItem:
additionalProperties:
nullable: true
description: A message routed between agents in a multi-agent session
example:
author: /root/worker
content:
- text: Task complete.
type: input_text
recipient: /root
type: agent_message
properties:
agent:
additionalProperties:
nullable: true
nullable: true
properties:
agent_name:
type: string
required:
- agent_name
type: object
author:
type: string
content:
items:
oneOf:
- $ref: '#/components/schemas/InputText'
- allOf:
- $ref: '#/components/schemas/InputImage'
- properties: {}
type: object
description: Image input content item
example:
detail: auto
image_url: https://example.com/image.jpg
type: input_image
- additionalProperties:
nullable: true
properties:
encrypted_content:
type: string
type:
enum:
- encrypted_content
type: string
required:
- type
- encrypted_content
type: object
type: array
id:
nullable: true
type: string
recipient:
type: string
type:
enum:
- agent_message
type: string
required:
- type
- author
- recipient
- content
type: object
AnnotationAddedEvent: AnnotationAddedEvent:
allOf: allOf:
- $ref: '#/components/schemas/BaseAnnotationAddedEvent' - $ref: '#/components/schemas/BaseAnnotationAddedEvent'
@@ -5854,6 +5920,8 @@ components:
- type - type
type: object type: object
CompactionItem: CompactionItem:
additionalProperties:
nullable: true
description: A context compaction marker with encrypted summary description: A context compaction marker with encrypted summary
example: example:
encrypted_content: enc_abc123... encrypted_content: enc_abc123...
@@ -6302,6 +6370,27 @@ components:
- type - type
- video_url - video_url
type: object type: object
ContextCompactionItem:
additionalProperties:
nullable: true
description: A context compaction marker with an optional encrypted summary
example:
encrypted_content: enc_abc123...
type: context_compaction
properties:
encrypted_content:
nullable: true
type: string
id:
nullable: true
type: string
type:
enum:
- context_compaction
type: string
required:
- type
type: object
ContextCompressionEngine: ContextCompressionEngine:
description: The compression engine to use. Defaults to "middle-out". description: The compression engine to use. Defaults to "middle-out".
enum: enum:
@@ -10434,8 +10523,10 @@ components:
- $ref: '#/components/schemas/CustomToolCallItem' - $ref: '#/components/schemas/CustomToolCallItem'
- $ref: '#/components/schemas/CustomToolCallOutputItem' - $ref: '#/components/schemas/CustomToolCallOutputItem'
- $ref: '#/components/schemas/CompactionItem' - $ref: '#/components/schemas/CompactionItem'
- $ref: '#/components/schemas/ContextCompactionItem'
- $ref: '#/components/schemas/ItemReferenceItem' - $ref: '#/components/schemas/ItemReferenceItem'
- $ref: '#/components/schemas/AdditionalToolsItem' - $ref: '#/components/schemas/AdditionalToolsItem'
- $ref: '#/components/schemas/AgentMessageItem'
type: array type: array
description: Input for a response request - can be a string or array of items description: Input for a response request - can be a string or array of items
example: example:
+5 -5
View File
@@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0
sources: sources:
OpenRouter API: OpenRouter API:
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:5d92f9e16b58b6867b6333b47544046d8179ed6ee1ce9b9d289a5f5fc9ac13bf sourceRevisionDigest: sha256:046e876891ba57af72f3f26e8394a517ea258cecf8c2d8f885357e7796516f2d
sourceBlobDigest: sha256:59fc773016c0c02fc04da6c9785ff6cf5b572b30f5d22095b14564f1c4ff958b sourceBlobDigest: sha256:a38421ec1aa0fb81cf260b96096fb44a9f31543b4b49d700280b2b58460671d1
tags: tags:
- latest - latest
- 1.0.0 - 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router: open-router:
source: OpenRouter API source: OpenRouter API
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:5d92f9e16b58b6867b6333b47544046d8179ed6ee1ce9b9d289a5f5fc9ac13bf sourceRevisionDigest: sha256:046e876891ba57af72f3f26e8394a517ea258cecf8c2d8f885357e7796516f2d
sourceBlobDigest: sha256:59fc773016c0c02fc04da6c9785ff6cf5b572b30f5d22095b14564f1c4ff958b sourceBlobDigest: sha256:a38421ec1aa0fb81cf260b96096fb44a9f31543b4b49d700280b2b58460671d1
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:3770bb81a5566b8937f2c434e761c2a63e5c7f0507d7b3439ec0d1a87d53c673 codeSamplesRevisionDigest: sha256:0eccbc2f8f6e176d5a67e24ec42aee8a70ef63fdf3da3c2a2fbb8b78587bfd8b
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.787.0 speakeasyVersion: 1.787.0
+11 -1
View File
@@ -288,4 +288,14 @@ Based on:
### Generated ### Generated
- [python v0.11.18] . - [python v0.11.18] .
### Releases ### Releases
- [PyPI v0.11.18] https://pypi.org/project/openrouter/0.11.18 - . - [PyPI v0.11.18] https://pypi.org/project/openrouter/0.11.18 - .
## 2026-07-10 15:41:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.19] .
### Releases
- [PyPI v0.11.19] https://pypi.org/project/openrouter/0.11.19 - .
+10
View File
@@ -0,0 +1,10 @@
---
title: "Agent"
---
## Fields
| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `agent_name` | *str* | :heavy_check_mark: | N/A |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
+18
View File
@@ -0,0 +1,18 @@
---
title: "AgentMessageItem"
---
A message routed between agents in a multi-agent session
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `agent` | [OptionalNullable[components.Agent]](../components/agent.mdx) | :heavy_minus_sign: | N/A | |
| `author` | *str* | :heavy_check_mark: | N/A | |
| `content` | List[[components.AgentMessageItemContentUnion](../components/agentmessageitemcontentunion.mdx)] | :heavy_check_mark: | N/A | |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `recipient` | *str* | :heavy_check_mark: | N/A | |
| `type` | [components.TypeAgentMessage](../components/typeagentmessage.mdx) | :heavy_check_mark: | N/A | |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{<br/>"author": "/root/worker",<br/>"content": [<br/>\{<br/>"text": "Task complete.",<br/>"type": "input_text"<br/>}<br/>],<br/>"recipient": "/root",<br/>"type": "agent_message"<br/>} |
@@ -0,0 +1,14 @@
---
title: "AgentMessageItemContentInputImage"
---
Image input content item
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `detail` | [components.AgentMessageItemDetail](../components/agentmessageitemdetail.mdx) | :heavy_check_mark: | N/A |
| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `type` | [components.AgentMessageItemTypeInputImage](../components/agentmessageitemtypeinputimage.mdx) | :heavy_check_mark: | N/A |
@@ -0,0 +1,24 @@
---
title: "AgentMessageItemContentUnion"
---
## Supported Types
### `components.InputText`
```python
value: components.InputText = /* values here */
```
### `components.AgentMessageItemContentInputImage`
```python
value: components.AgentMessageItemContentInputImage = /* values here */
```
### `components.ContentEncryptedContent`
```python
value: components.ContentEncryptedContent = /* values here */
```
@@ -0,0 +1,22 @@
---
title: "AgentMessageItemDetail"
---
## Example Usage
```python
from openrouter.components import AgentMessageItemDetail
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AgentMessageItemDetail = "auto"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"auto"`
- `"high"`
- `"low"`
- `"original"`
@@ -0,0 +1,15 @@
---
title: "AgentMessageItemTypeInputImage"
---
## Example Usage
```python
from openrouter.components import AgentMessageItemTypeInputImage
value: AgentMessageItemTypeInputImage = "input_image"
```
## Values
- `"input_image"`
+6 -5
View File
@@ -7,8 +7,9 @@ A context compaction marker with encrypted summary
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `encrypted_content` | *str* | :heavy_check_mark: | N/A | | `encrypted_content` | *str* | :heavy_check_mark: | N/A | |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `type` | [components.CompactionItemType](../components/compactionitemtype.mdx) | :heavy_check_mark: | N/A | | `type` | [components.CompactionItemType](../components/compactionitemtype.mdx) | :heavy_check_mark: | N/A | |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{<br/>"encrypted_content": "enc_abc123...",<br/>"type": "compaction"<br/>} |
@@ -0,0 +1,11 @@
---
title: "ContentEncryptedContent"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `encrypted_content` | *str* | :heavy_check_mark: | N/A |
| `type` | [components.TypeEncryptedContent](../components/typeencryptedcontent.mdx) | :heavy_check_mark: | N/A |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
+15
View File
@@ -0,0 +1,15 @@
---
title: "ContextCompactionItem"
---
A context compaction marker with an optional encrypted summary
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `type` | [components.ContextCompactionItemType](../components/contextcompactionitemtype.mdx) | :heavy_check_mark: | N/A | |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{<br/>"encrypted_content": "enc_abc123...",<br/>"type": "context_compaction"<br/>} |
@@ -0,0 +1,15 @@
---
title: "ContextCompactionItemType"
---
## Example Usage
```python
from openrouter.components import ContextCompactionItemType
value: ContextCompactionItemType = "context_compaction"
```
## Values
- `"context_compaction"`
+12
View File
@@ -274,6 +274,12 @@ value: components.CustomToolCallOutputItem = /* values here */
value: components.CompactionItem = /* values here */ value: components.CompactionItem = /* values here */
``` ```
### `components.ContextCompactionItem`
```python
value: components.ContextCompactionItem = /* values here */
```
### `components.ItemReferenceItem` ### `components.ItemReferenceItem`
```python ```python
@@ -286,3 +292,9 @@ value: components.ItemReferenceItem = /* values here */
value: components.AdditionalToolsItem = /* values here */ value: components.AdditionalToolsItem = /* values here */
``` ```
### `components.AgentMessageItem`
```python
value: components.AgentMessageItem = /* values here */
```
+15
View File
@@ -0,0 +1,15 @@
---
title: "TypeAgentMessage"
---
## Example Usage
```python
from openrouter.components import TypeAgentMessage
value: TypeAgentMessage = "agent_message"
```
## Values
- `"agent_message"`
+15
View File
@@ -0,0 +1,15 @@
---
title: "TypeEncryptedContent"
---
## Example Usage
```python
from openrouter.components import TypeEncryptedContent
value: TypeEncryptedContent = "encrypted_content"
```
## Values
- `"encrypted_content"`
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.11.18" version = "0.11.19"
description = "Official Python Client SDK for OpenRouter." description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },] authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md" readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata import importlib.metadata
__title__: str = "openrouter" __title__: str = "openrouter"
__version__: str = "0.11.18" __version__: str = "0.11.19"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0" __gen_version__: str = "2.914.0"
__user_agent__: str = "speakeasy-sdk/python 0.11.18 2.914.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.11.19 2.914.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
+55
View File
@@ -36,6 +36,22 @@ if TYPE_CHECKING:
AdvisorServerToolConfig, AdvisorServerToolConfig,
AdvisorServerToolConfigTypedDict, AdvisorServerToolConfigTypedDict,
) )
from .agentmessageitem import (
Agent,
AgentMessageItem,
AgentMessageItemContentInputImage,
AgentMessageItemContentInputImageTypedDict,
AgentMessageItemContentUnion,
AgentMessageItemContentUnionTypedDict,
AgentMessageItemDetail,
AgentMessageItemTypeInputImage,
AgentMessageItemTypedDict,
AgentTypedDict,
ContentEncryptedContent,
ContentEncryptedContentTypedDict,
TypeAgentMessage,
TypeEncryptedContent,
)
from .annotationaddedevent import ( from .annotationaddedevent import (
AnnotationAddedEvent, AnnotationAddedEvent,
AnnotationAddedEventType, AnnotationAddedEventType,
@@ -711,6 +727,11 @@ if TYPE_CHECKING:
VideoURL, VideoURL,
VideoURLTypedDict, VideoURLTypedDict,
) )
from .contextcompactionitem import (
ContextCompactionItem,
ContextCompactionItemType,
ContextCompactionItemTypedDict,
)
from .contextcompressionengine import ContextCompressionEngine from .contextcompressionengine import ContextCompressionEngine
from .contextcompressionplugin import ( from .contextcompressionplugin import (
ContextCompressionPlugin, ContextCompressionPlugin,
@@ -2802,6 +2823,16 @@ __all__ = [
"AdvisorServerToolOpenRouter", "AdvisorServerToolOpenRouter",
"AdvisorServerToolOpenRouterType", "AdvisorServerToolOpenRouterType",
"AdvisorServerToolOpenRouterTypedDict", "AdvisorServerToolOpenRouterTypedDict",
"Agent",
"AgentMessageItem",
"AgentMessageItemContentInputImage",
"AgentMessageItemContentInputImageTypedDict",
"AgentMessageItemContentUnion",
"AgentMessageItemContentUnionTypedDict",
"AgentMessageItemDetail",
"AgentMessageItemTypeInputImage",
"AgentMessageItemTypedDict",
"AgentTypedDict",
"AllowedTools", "AllowedTools",
"AllowedToolsTypedDict", "AllowedToolsTypedDict",
"AllowedToolsUnion", "AllowedToolsUnion",
@@ -3221,6 +3252,8 @@ __all__ = [
"ContainerTypedDict", "ContainerTypedDict",
"ContentCompaction", "ContentCompaction",
"ContentCompactionTypedDict", "ContentCompactionTypedDict",
"ContentEncryptedContent",
"ContentEncryptedContentTypedDict",
"ContentFilterAction", "ContentFilterAction",
"ContentFilterBuiltinAction", "ContentFilterBuiltinAction",
"ContentFilterBuiltinEntry", "ContentFilterBuiltinEntry",
@@ -3276,6 +3309,9 @@ __all__ = [
"ContentWebSearchToolResultError", "ContentWebSearchToolResultError",
"ContentWebSearchToolResultErrorTypedDict", "ContentWebSearchToolResultErrorTypedDict",
"ContentWebSearchToolResultTypedDict", "ContentWebSearchToolResultTypedDict",
"ContextCompactionItem",
"ContextCompactionItemType",
"ContextCompactionItemTypedDict",
"ContextCompressionEngine", "ContextCompressionEngine",
"ContextCompressionPlugin", "ContextCompressionPlugin",
"ContextCompressionPluginID", "ContextCompressionPluginID",
@@ -4611,6 +4647,7 @@ __all__ = [
"TypeAdaptive", "TypeAdaptive",
"TypeAdditionalTools", "TypeAdditionalTools",
"TypeAdvisor20260301", "TypeAdvisor20260301",
"TypeAgentMessage",
"TypeAny", "TypeAny",
"TypeBash20250124", "TypeBash20250124",
"TypeClearThinking20251015", "TypeClearThinking20251015",
@@ -4621,6 +4658,7 @@ __all__ = [
"TypeDisabled", "TypeDisabled",
"TypeDocument", "TypeDocument",
"TypeEnabled", "TypeEnabled",
"TypeEncryptedContent",
"TypeExec", "TypeExec",
"TypeExit", "TypeExit",
"TypeFileSearch", "TypeFileSearch",
@@ -4827,6 +4865,20 @@ _dynamic_imports: dict[str, str] = {
"AdvisorServerToolOpenRouterTypedDict": ".advisorservertool_openrouter", "AdvisorServerToolOpenRouterTypedDict": ".advisorservertool_openrouter",
"AdvisorServerToolConfig": ".advisorservertoolconfig", "AdvisorServerToolConfig": ".advisorservertoolconfig",
"AdvisorServerToolConfigTypedDict": ".advisorservertoolconfig", "AdvisorServerToolConfigTypedDict": ".advisorservertoolconfig",
"Agent": ".agentmessageitem",
"AgentMessageItem": ".agentmessageitem",
"AgentMessageItemContentInputImage": ".agentmessageitem",
"AgentMessageItemContentInputImageTypedDict": ".agentmessageitem",
"AgentMessageItemContentUnion": ".agentmessageitem",
"AgentMessageItemContentUnionTypedDict": ".agentmessageitem",
"AgentMessageItemDetail": ".agentmessageitem",
"AgentMessageItemTypeInputImage": ".agentmessageitem",
"AgentMessageItemTypedDict": ".agentmessageitem",
"AgentTypedDict": ".agentmessageitem",
"ContentEncryptedContent": ".agentmessageitem",
"ContentEncryptedContentTypedDict": ".agentmessageitem",
"TypeAgentMessage": ".agentmessageitem",
"TypeEncryptedContent": ".agentmessageitem",
"AnnotationAddedEvent": ".annotationaddedevent", "AnnotationAddedEvent": ".annotationaddedevent",
"AnnotationAddedEventType": ".annotationaddedevent", "AnnotationAddedEventType": ".annotationaddedevent",
"AnnotationAddedEventTypedDict": ".annotationaddedevent", "AnnotationAddedEventTypedDict": ".annotationaddedevent",
@@ -5290,6 +5342,9 @@ _dynamic_imports: dict[str, str] = {
"ContentPartVideoTypedDict": ".contentpartvideo", "ContentPartVideoTypedDict": ".contentpartvideo",
"VideoURL": ".contentpartvideo", "VideoURL": ".contentpartvideo",
"VideoURLTypedDict": ".contentpartvideo", "VideoURLTypedDict": ".contentpartvideo",
"ContextCompactionItem": ".contextcompactionitem",
"ContextCompactionItemType": ".contextcompactionitem",
"ContextCompactionItemTypedDict": ".contextcompactionitem",
"ContextCompressionEngine": ".contextcompressionengine", "ContextCompressionEngine": ".contextcompressionengine",
"ContextCompressionPlugin": ".contextcompressionplugin", "ContextCompressionPlugin": ".contextcompressionplugin",
"ContextCompressionPluginID": ".contextcompressionplugin", "ContextCompressionPluginID": ".contextcompressionplugin",
@@ -0,0 +1,213 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .inputtext import InputText, InputTextTypedDict
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import get_discriminator
import pydantic
from pydantic import ConfigDict, Discriminator, Tag, model_serializer
from typing import Any, Dict, List, Literal, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
class AgentTypedDict(TypedDict):
agent_name: str
class Agent(BaseModel):
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
agent_name: str
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
TypeEncryptedContent = Literal["encrypted_content",]
class ContentEncryptedContentTypedDict(TypedDict):
encrypted_content: str
type: TypeEncryptedContent
class ContentEncryptedContent(BaseModel):
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
encrypted_content: str
type: TypeEncryptedContent
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
AgentMessageItemDetail = Union[
Literal[
"auto",
"high",
"low",
"original",
],
UnrecognizedStr,
]
AgentMessageItemTypeInputImage = Literal["input_image",]
class AgentMessageItemContentInputImageTypedDict(TypedDict):
r"""Image input content item"""
detail: AgentMessageItemDetail
type: AgentMessageItemTypeInputImage
image_url: NotRequired[Nullable[str]]
class AgentMessageItemContentInputImage(BaseModel):
r"""Image input content item"""
detail: AgentMessageItemDetail
type: AgentMessageItemTypeInputImage
image_url: OptionalNullable[str] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["image_url"])
nullable_fields = set(["image_url"])
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))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
return m
AgentMessageItemContentUnionTypedDict = TypeAliasType(
"AgentMessageItemContentUnionTypedDict",
Union[
InputTextTypedDict,
AgentMessageItemContentInputImageTypedDict,
ContentEncryptedContentTypedDict,
],
)
AgentMessageItemContentUnion = Annotated[
Union[
Annotated[InputText, Tag("input_text")],
Annotated[AgentMessageItemContentInputImage, Tag("input_image")],
Annotated[ContentEncryptedContent, Tag("encrypted_content")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
TypeAgentMessage = Literal["agent_message",]
class AgentMessageItemTypedDict(TypedDict):
r"""A message routed between agents in a multi-agent session"""
author: str
content: List[AgentMessageItemContentUnionTypedDict]
recipient: str
type: TypeAgentMessage
agent: NotRequired[Nullable[AgentTypedDict]]
id: NotRequired[Nullable[str]]
class AgentMessageItem(BaseModel):
r"""A message routed between agents in a multi-agent session"""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
author: str
content: List[AgentMessageItemContentUnion]
recipient: str
type: TypeAgentMessage
agent: OptionalNullable[Agent] = UNSET
id: OptionalNullable[str] = UNSET
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["agent", "id"])
nullable_fields = set(["agent", "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))
serialized.pop(k, serialized.pop(n, None))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
for k, v in serialized.items():
m[k] = v
return m
+19 -2
View File
@@ -8,8 +8,9 @@ from openrouter.types import (
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
) )
from pydantic import model_serializer import pydantic
from typing import Literal from pydantic import ConfigDict, model_serializer
from typing import Any, Dict, Literal
from typing_extensions import NotRequired, TypedDict from typing_extensions import NotRequired, TypedDict
@@ -27,12 +28,25 @@ class CompactionItemTypedDict(TypedDict):
class CompactionItem(BaseModel): class CompactionItem(BaseModel):
r"""A context compaction marker with encrypted summary""" r"""A context compaction marker with encrypted summary"""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
encrypted_content: str encrypted_content: str
type: CompactionItemType type: CompactionItemType
id: OptionalNullable[str] = UNSET id: OptionalNullable[str] = UNSET
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = set(["id"]) optional_fields = set(["id"])
@@ -43,6 +57,7 @@ class CompactionItem(BaseModel):
for n, f in type(self).model_fields.items(): for n, f in type(self).model_fields.items():
k = f.alias or n k = f.alias or n
val = serialized.get(k, serialized.get(n)) val = serialized.get(k, serialized.get(n))
serialized.pop(k, serialized.pop(n, None))
is_nullable_and_explicitly_set = ( is_nullable_and_explicitly_set = (
k in nullable_fields k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
@@ -55,5 +70,7 @@ class CompactionItem(BaseModel):
or is_nullable_and_explicitly_set or is_nullable_and_explicitly_set
): ):
m[k] = val m[k] = val
for k, v in serialized.items():
m[k] = v
return m return m
@@ -0,0 +1,76 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
import pydantic
from pydantic import ConfigDict, model_serializer
from typing import Any, Dict, Literal
from typing_extensions import NotRequired, TypedDict
ContextCompactionItemType = Literal["context_compaction",]
class ContextCompactionItemTypedDict(TypedDict):
r"""A context compaction marker with an optional encrypted summary"""
type: ContextCompactionItemType
encrypted_content: NotRequired[Nullable[str]]
id: NotRequired[Nullable[str]]
class ContextCompactionItem(BaseModel):
r"""A context compaction marker with an optional encrypted summary"""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
type: ContextCompactionItemType
encrypted_content: OptionalNullable[str] = UNSET
id: OptionalNullable[str] = UNSET
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["encrypted_content", "id"])
nullable_fields = set(["encrypted_content", "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))
serialized.pop(k, serialized.pop(n, None))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
for k, v in serialized.items():
m[k] = v
return m
+62 -56
View File
@@ -2,12 +2,14 @@
from __future__ import annotations from __future__ import annotations
from .additionaltoolsitem import AdditionalToolsItem, AdditionalToolsItemTypedDict from .additionaltoolsitem import AdditionalToolsItem, AdditionalToolsItemTypedDict
from .agentmessageitem import AgentMessageItem, AgentMessageItemTypedDict
from .applypatchcallitem import ApplyPatchCallItem, ApplyPatchCallItemTypedDict from .applypatchcallitem import ApplyPatchCallItem, ApplyPatchCallItemTypedDict
from .applypatchcalloutputitem import ( from .applypatchcalloutputitem import (
ApplyPatchCallOutputItem, ApplyPatchCallOutputItem,
ApplyPatchCallOutputItemTypedDict, ApplyPatchCallOutputItemTypedDict,
) )
from .compactionitem import CompactionItem, CompactionItemTypedDict from .compactionitem import CompactionItem, CompactionItemTypedDict
from .contextcompactionitem import ContextCompactionItem, ContextCompactionItemTypedDict
from .customtoolcallitem import CustomToolCallItem, CustomToolCallItemTypedDict from .customtoolcallitem import CustomToolCallItem, CustomToolCallItemTypedDict
from .customtoolcalloutputitem import ( from .customtoolcalloutputitem import (
CustomToolCallOutputItem, CustomToolCallOutputItem,
@@ -376,50 +378,52 @@ InputsUnion1TypedDict = TypeAliasType(
Union[ Union[
ItemReferenceItemTypedDict, ItemReferenceItemTypedDict,
CompactionItemTypedDict, CompactionItemTypedDict,
InputMessageItemTypedDict,
AdditionalToolsItemTypedDict, AdditionalToolsItemTypedDict,
OutputImageGenerationCallItemTypedDict, EasyInputMessageTypedDict,
ContextCompactionItemTypedDict,
OutputWebSearchServerToolItemTypedDict,
CustomToolCallOutputItemTypedDict,
LocalShellCallOutputItemTypedDict, LocalShellCallOutputItemTypedDict,
OutputToolSearchServerToolItemTypedDict, OutputToolSearchServerToolItemTypedDict,
OutputFileSearchServerToolItemTypedDict, OutputFileSearchServerToolItemTypedDict,
CustomToolCallOutputItemTypedDict,
InputMessageItemTypedDict,
EasyInputMessageTypedDict,
OutputWebSearchServerToolItemTypedDict,
OutputWebSearchCallItemTypedDict, OutputWebSearchCallItemTypedDict,
OutputFileSearchCallItemTypedDict, OutputFileSearchCallItemTypedDict,
OutputDatetimeItemTypedDict, OutputImageGenerationCallItemTypedDict,
OutputApplyPatchServerToolItemTypedDict, OutputApplyPatchServerToolItemTypedDict,
FunctionCallOutputItemTypedDict,
LocalShellCallItemTypedDict,
McpListToolsItemTypedDict,
OutputSearchModelsServerToolItemTypedDict,
ApplyPatchCallOutputItemTypedDict,
OutputMcpServerToolItemTypedDict,
OutputBrowserUseServerToolItemTypedDict,
McpApprovalResponseItemTypedDict,
OutputTextEditorServerToolItemTypedDict,
ApplyPatchCallItemTypedDict,
McpApprovalRequestItemTypedDict, McpApprovalRequestItemTypedDict,
OutputCodeInterpreterCallItemTypedDict, OutputDatetimeItemTypedDict,
OutputMemoryServerToolItemTypedDict, FunctionCallOutputItemTypedDict,
ApplyPatchCallItemTypedDict,
ApplyPatchCallOutputItemTypedDict,
McpApprovalResponseItemTypedDict,
OutputBrowserUseServerToolItemTypedDict,
McpListToolsItemTypedDict,
OutputTextEditorServerToolItemTypedDict,
LocalShellCallItemTypedDict,
OutputSearchModelsServerToolItemTypedDict,
OutputMcpServerToolItemTypedDict,
CustomToolCallItemTypedDict, CustomToolCallItemTypedDict,
InputsMessageTypedDict,
OutputCustomToolCallItemTypedDict,
ShellCallOutputItemTypedDict,
ShellCallItemTypedDict,
OutputComputerCallItemTypedDict, OutputComputerCallItemTypedDict,
OutputCodeInterpreterCallItemTypedDict,
OutputCustomToolCallItemTypedDict,
InputsMessageTypedDict,
OutputMemoryServerToolItemTypedDict,
ShellCallItemTypedDict,
ShellCallOutputItemTypedDict,
OutputBashServerToolItemTypedDict, OutputBashServerToolItemTypedDict,
McpCallItemTypedDict, McpCallItemTypedDict,
OutputImageGenerationServerToolItemTypedDict,
OutputFunctionCallItemTypedDict, OutputFunctionCallItemTypedDict,
AgentMessageItemTypedDict,
FunctionCallItemTypedDict, FunctionCallItemTypedDict,
OutputFilesServerToolItemTypedDict, OutputImageGenerationServerToolItemTypedDict,
OutputSubagentServerToolItemTypedDict, OutputSubagentServerToolItemTypedDict,
OutputAdvisorServerToolItemTypedDict,
OutputWebFetchServerToolItemTypedDict,
ReasoningItemTypedDict,
OutputCodeInterpreterServerToolItemTypedDict,
InputsReasoningTypedDict, InputsReasoningTypedDict,
OutputAdvisorServerToolItemTypedDict,
OutputCodeInterpreterServerToolItemTypedDict,
OutputWebFetchServerToolItemTypedDict,
OutputFilesServerToolItemTypedDict,
ReasoningItemTypedDict,
OutputFusionServerToolItemTypedDict, OutputFusionServerToolItemTypedDict,
], ],
) )
@@ -430,50 +434,52 @@ InputsUnion1 = TypeAliasType(
Union[ Union[
ItemReferenceItem, ItemReferenceItem,
CompactionItem, CompactionItem,
InputMessageItem,
AdditionalToolsItem, AdditionalToolsItem,
OutputImageGenerationCallItem, EasyInputMessage,
ContextCompactionItem,
OutputWebSearchServerToolItem,
CustomToolCallOutputItem,
LocalShellCallOutputItem, LocalShellCallOutputItem,
OutputToolSearchServerToolItem, OutputToolSearchServerToolItem,
OutputFileSearchServerToolItem, OutputFileSearchServerToolItem,
CustomToolCallOutputItem,
InputMessageItem,
EasyInputMessage,
OutputWebSearchServerToolItem,
OutputWebSearchCallItem, OutputWebSearchCallItem,
OutputFileSearchCallItem, OutputFileSearchCallItem,
OutputDatetimeItem, OutputImageGenerationCallItem,
OutputApplyPatchServerToolItem, OutputApplyPatchServerToolItem,
FunctionCallOutputItem,
LocalShellCallItem,
McpListToolsItem,
OutputSearchModelsServerToolItem,
ApplyPatchCallOutputItem,
OutputMcpServerToolItem,
OutputBrowserUseServerToolItem,
McpApprovalResponseItem,
OutputTextEditorServerToolItem,
ApplyPatchCallItem,
McpApprovalRequestItem, McpApprovalRequestItem,
OutputCodeInterpreterCallItem, OutputDatetimeItem,
OutputMemoryServerToolItem, FunctionCallOutputItem,
ApplyPatchCallItem,
ApplyPatchCallOutputItem,
McpApprovalResponseItem,
OutputBrowserUseServerToolItem,
McpListToolsItem,
OutputTextEditorServerToolItem,
LocalShellCallItem,
OutputSearchModelsServerToolItem,
OutputMcpServerToolItem,
CustomToolCallItem, CustomToolCallItem,
InputsMessage,
OutputCustomToolCallItem,
ShellCallOutputItem,
ShellCallItem,
OutputComputerCallItem, OutputComputerCallItem,
OutputCodeInterpreterCallItem,
OutputCustomToolCallItem,
InputsMessage,
OutputMemoryServerToolItem,
ShellCallItem,
ShellCallOutputItem,
OutputBashServerToolItem, OutputBashServerToolItem,
McpCallItem, McpCallItem,
OutputImageGenerationServerToolItem,
OutputFunctionCallItem, OutputFunctionCallItem,
AgentMessageItem,
FunctionCallItem, FunctionCallItem,
OutputFilesServerToolItem, OutputImageGenerationServerToolItem,
OutputSubagentServerToolItem, OutputSubagentServerToolItem,
OutputAdvisorServerToolItem,
OutputWebFetchServerToolItem,
ReasoningItem,
OutputCodeInterpreterServerToolItem,
InputsReasoning, InputsReasoning,
OutputAdvisorServerToolItem,
OutputCodeInterpreterServerToolItem,
OutputWebFetchServerToolItem,
OutputFilesServerToolItem,
ReasoningItem,
OutputFusionServerToolItem, OutputFusionServerToolItem,
], ],
) )
Generated
+1 -1
View File
@@ -213,7 +213,7 @@ wheels = [
[[package]] [[package]]
name = "openrouter" name = "openrouter"
version = "0.11.18" version = "0.11.19"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "httpcore" }, { name = "httpcore" },