diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 872f055b..572d8311 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: f801f4232e52128b7111557fa57d74b5 + docChecksum: d316e70cf866121b6113db353ecbb91c docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.54 - configChecksum: 00d313ba18dc981810cce55a2880d555 + releaseVersion: 1.3.55 + configChecksum: e39d06d55346e2a31e2cf52ec011c465 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: defe980f-7620-40e8-b3ce-989ccb235d58 - pristine_commit_hash: c0852c28237f34d5322a4857ed118f373cd0a42c - pristine_tree_hash: 85e23e2d3ce5ccb139dca246812b231e581d3a45 + generation_id: 56378936-8e8c-40a4-b837-950c52c7089a + pristine_commit_hash: 5ff5c1ca17faab0314021bc38590852efa4b6803 + pristine_tree_hash: c4349e551d597229bdd70cbc6dfa4bfe5e4f0946 features: python: acceptHeaders: 3.0.0 @@ -328,8 +328,8 @@ trackedFiles: pristine_git_object: a349dfd1f9dbd073892e08bf1fec641b131e2b72 docs/components/answers.mdx: id: 82e99c991e20 - last_write_checksum: sha1:66dd9e45903fcdb94b3303437662e481c0106c5b - pristine_git_object: b065c94fd50b108b90c0cfe16ae4359337002376 + last_write_checksum: sha1:5ef9a00452ff852a462ae1d311c98c677f84b160 + pristine_git_object: 43893fe77c341f9deeed76ad83ebb2800807c7ba docs/components/anthropicadvisormessageusageiteration.mdx: id: ca0effff715e last_write_checksum: sha1:66558840a0330602b3e022e9686b3f2f8529b959 @@ -1650,6 +1650,10 @@ trackedFiles: id: 9fde49928d3a last_write_checksum: sha1:6746044145b81e2480e6f2757db714a467f0d1f8 pristine_git_object: 9c583fdf315b6ac8ad38f254d932aaadde8c7ded + docs/components/box.mdx: + id: 3d683799f3f6 + last_write_checksum: sha1:94468857693ea5a155b714cb69b5e824ecf0b3a2 + pristine_git_object: f0a3ef77d013ac1240a223e9e5d0bc3cef932a24 docs/components/bulkaddworkspacemembersrequest.mdx: id: 92f44877345a last_write_checksum: sha1:98e0c96a7ea1e43172ef8d71527de4c5368daa42 @@ -2746,6 +2750,26 @@ trackedFiles: id: 2cbde2112b18 last_write_checksum: sha1:90f7268b80fdabbdf4f5c78aac765d6442539348 pristine_git_object: d68a93a6e4f6d372e9be4554174339d4dbd86f67 + docs/components/decisionsboxanswer.mdx: + id: feb90d039e07 + last_write_checksum: sha1:be2c2e580a2142d9afebe9b38bb20fc6966c6c55 + pristine_git_object: 41ff334cdc04471e07796c11665cd96b28eb1dc4 + docs/components/decisionsboxanswertype.mdx: + id: 01a44eb95136 + last_write_checksum: sha1:19ceb57f4b609bd8bd1f340976823da8e16a3fb1 + pristine_git_object: f8ee5fe37dd3f38add083239af2ad81d55b72609 + docs/components/decisionsboxquestion.mdx: + id: 9f587817bba9 + last_write_checksum: sha1:33c0d2ed70c82e9ef11e313db6bbc8093ecb51cb + pristine_git_object: 3a4637a56e7215f202a9daa8db937c158495e898 + docs/components/decisionsboxquestioninstructions.mdx: + id: 0bcad7c550b9 + last_write_checksum: sha1:4e5d7bafce0a322a279b3c00d11c02429ef37fee + pristine_git_object: 378399c6c5316c2e35d1519476b74a155080ad01 + docs/components/decisionsboxquestiontype.mdx: + id: d298c864bb79 + last_write_checksum: sha1:cdbcc2a7397404f51a7a9cbf25f2029db19bd2fd + pristine_git_object: bb87797fecc8f3b4dfb0a2fb5e1494c357d086a2 docs/components/decisionschoiceanswer.mdx: id: 8453afbdc1aa last_write_checksum: sha1:6c917d892506ab1257cf46468e58a0fb6f130f8b @@ -6408,8 +6432,8 @@ trackedFiles: pristine_git_object: 80f51dc8e90b6642365ab8d409b6f100f07ccab0 docs/components/questions.mdx: id: 75aa4ba39e9c - last_write_checksum: sha1:5239cbe0ce5d970b958a9f00551067e5cdd88c20 - pristine_git_object: 15be03f7c7723c3a2512cfe35d8f35083a21ebbb + last_write_checksum: sha1:04887ce687bea3d2f6afea689e39952a7256f8ff + pristine_git_object: f6c2d80b0e12882e559031e0244b3c348814bc12 docs/components/rangecapability.mdx: id: 8c2d6524bd62 last_write_checksum: sha1:e583c16a52c5811d882ddbe20cee0a7006035356 @@ -10288,8 +10312,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:86cbe7493a02b92000f3f7c4cdf79b72828a3ed1 - pristine_git_object: 1b0c571a8a31e326918aeb82851c57a85fe1e91e + last_write_checksum: sha1:708c0a6ee5849e59aa9267d8985724adcefe0baf + pristine_git_object: da47717cca5b6271b68c09432434be50cef94a60 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10316,8 +10340,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:b0d4346fe4f5e5d3afe0f46e5b3f1b2ba53018b6 - pristine_git_object: ac9989f813165143912560931173c387bd9f2535 + last_write_checksum: sha1:5493aa6a7764382c8ea44be8135d59d9a55fbfbb + pristine_git_object: 92d007f074d17cd79fadc9db59d6dddf7f6a565e src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10364,8 +10388,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:4ebf0abc8f838113bc4a1ef520e3fc6b5914e7b0 - pristine_git_object: e858066a694593b119b38a2b9fc1d20cd622433b + last_write_checksum: sha1:73b40ea8cba3db5ffe532a8e5c3fcc26bac02fe2 + pristine_git_object: 070351da60f54a6439f2d5b982183b2d5fd7bf7c src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11542,6 +11566,14 @@ trackedFiles: id: 5ecad6212326 last_write_checksum: sha1:53ae856232196a956d66c6363cdaedc9f8abfe3a pristine_git_object: 07e98d54e6a63a4f1e0908b73ce5f8d7e16234f0 + src/openrouter/components/decisionsboxanswer.py: + id: 59a9ef1c30b7 + last_write_checksum: sha1:301ee5be0345940b0f210f797e19e537e0f8126e + pristine_git_object: 033cb3533e3fc0f1dfdd5ec25ac9fc50f811a0df + src/openrouter/components/decisionsboxquestion.py: + id: 1fa3ffdda918 + last_write_checksum: sha1:ada2c9d8a20f8e0177aa00639c18922766171ad0 + pristine_git_object: d667828ec2477ea91730faeab47c38d88f1d4ed4 src/openrouter/components/decisionschoiceanswer.py: id: 53a9e8cdf870 last_write_checksum: sha1:16380c24282a8d275d96bed268bf5d6410b56f43 @@ -11560,12 +11592,12 @@ trackedFiles: pristine_git_object: d6b2551a31bc9c7d8e2ed96913c097dc127c8311 src/openrouter/components/decisionsrequest.py: id: 5df43fede21b - last_write_checksum: sha1:671d51ba36a099390f2ed53230d7363f0644f02e - pristine_git_object: 3f40fcff3f6beaaa879d3f23e11d35e091ad4ede + last_write_checksum: sha1:f83153119a2cc4e4a86d7474f13a919d7e0698dd + pristine_git_object: 16559575401633709561c93be6d69ea1b7c05c8f src/openrouter/components/decisionsresponse.py: id: b91b81c2cf95 - last_write_checksum: sha1:db05bebf1bd1d7cee86819ad649531f46574f294 - pristine_git_object: 534bf4bf7478e4c2c3f14e26243264169d381905 + last_write_checksum: sha1:525f6ff5bd402e9d848fe5e15c32bd0eee14d236 + pristine_git_object: 687789c6ab7c35f36394e0c3028376b24b670044 src/openrouter/components/decisionsscoreanswer.py: id: af8597465725 last_write_checksum: sha1:e12a52051ccd6f841e0238d789b816a05156d299 @@ -18746,7 +18778,4 @@ examples: "500": application/json: {"error": {"code": 404, "message": "Intern not found"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.guardrails.list_key_assignments()`: `error` **Changed** - * `open_router.guardrails.list_member_assignments()`: `error` **Changed** +releaseNotes: "## Python SDK Changes:\n* `open_router.alpha.decisions.create()`: \n * `request.questions.Map.union(box)` **Added**\n * `response.answers.Map.union(box)` **Added**\n* `open_router.system_one.create()`: \n * `request.questions.Map.union(box)` **Added**\n * `response.answers.Map.union(box)` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8dd0e656..59508000 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.54 + version: 1.3.55 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c9168606..acc392ef 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10725,6 +10725,57 @@ components: - 'debug' - 'sequence_number' type: 'object' + DecisionsBoxAnswer: + properties: + box: + properties: + bottom: + format: 'double' + type: 'number' + left: + format: 'double' + type: 'number' + right: + format: 'double' + type: 'number' + top: + format: 'double' + type: 'number' + required: + - 'top' + - 'bottom' + - 'left' + - 'right' + type: 'object' + confidence: + format: 'double' + type: 'number' + type: + enum: + - 'box' + type: 'string' + required: + - 'type' + - 'box' + type: 'object' + DecisionsBoxQuestion: + properties: + instructions: + anyOf: + - type: 'string' + - additionalProperties: {} + type: 'object' + - items: {} + type: 'array' + description: 'A plain string, or a JSON object or array of structured guidance.' + type: + enum: + - 'box' + type: 'string' + required: + - 'type' + - 'instructions' + type: 'object' DecisionsChoiceAnswer: properties: choice: @@ -10838,9 +10889,10 @@ components: - description: 'Provider routing preferences for the request.' questions: additionalProperties: - description: 'A Decisions question using a boolean, choice, or ordered score evaluation.' + description: 'A Decisions question using a boolean, choice, ordered score, or image bounding-box evaluation.' discriminator: mapping: + box: '#/components/schemas/DecisionsBoxQuestion' choice: '#/components/schemas/DecisionsChoiceQuestion' noul: '#/components/schemas/DecisionsNoulQuestion' score: '#/components/schemas/DecisionsScoreQuestion' @@ -10849,6 +10901,7 @@ components: - $ref: '#/components/schemas/DecisionsNoulQuestion' - $ref: '#/components/schemas/DecisionsChoiceQuestion' - $ref: '#/components/schemas/DecisionsScoreQuestion' + - $ref: '#/components/schemas/DecisionsBoxQuestion' type: 'object' session_id: description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' @@ -10877,9 +10930,10 @@ components: properties: answers: additionalProperties: - description: 'A Decisions answer using a boolean, choice, or score evaluation.' + description: 'A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.' discriminator: mapping: + box: '#/components/schemas/DecisionsBoxAnswer' choice: '#/components/schemas/DecisionsChoiceAnswer' noul: '#/components/schemas/DecisionsNoulAnswer' score: '#/components/schemas/DecisionsScoreAnswer' @@ -10888,6 +10942,7 @@ components: - $ref: '#/components/schemas/DecisionsNoulAnswer' - $ref: '#/components/schemas/DecisionsChoiceAnswer' - $ref: '#/components/schemas/DecisionsScoreAnswer' + - $ref: '#/components/schemas/DecisionsBoxAnswer' type: 'object' id: type: 'string' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1ed230d6..7bc94015 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:eb5e9d2ccf05815bcb4fdd8abd8b0ecde72e723e91eed3cce85a3a61a3748883 - sourceBlobDigest: sha256:7df2244c6c4e11befed94c7004a0197585fae4f2409e1dd3b0ea2cb7b17a7319 + sourceRevisionDigest: sha256:f04fc6adb1ffb3cb92613bd5b15d839ee8c34c467a16d28755411f9011387d17 + sourceBlobDigest: sha256:7ecbf1daffd1d4c53d5eca064949aebd860954223df98c35d7dd48cc6be415ff tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:eb5e9d2ccf05815bcb4fdd8abd8b0ecde72e723e91eed3cce85a3a61a3748883 - sourceBlobDigest: sha256:7df2244c6c4e11befed94c7004a0197585fae4f2409e1dd3b0ea2cb7b17a7319 + sourceRevisionDigest: sha256:f04fc6adb1ffb3cb92613bd5b15d839ee8c34c467a16d28755411f9011387d17 + sourceBlobDigest: sha256:7ecbf1daffd1d4c53d5eca064949aebd860954223df98c35d7dd48cc6be415ff codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:a0aa237795df3f526a013aeed2dbf725150e77a18eb9c9bde5ddf56798949ec8 + codeSamplesRevisionDigest: sha256:1ceaf1e4796bd8991ed88bde9c0f6e7f2e9ba6972e16257b60b23092130e169a workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 67b02228..fb731ccc 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3309,4 +3309,14 @@ Based on: ### Generated - [python v1.3.54] . ### Releases -- [PyPI v1.3.54] https://pypi.org/project/openrouter/1.3.54 - . \ No newline at end of file +- [PyPI v1.3.54] https://pypi.org/project/openrouter/1.3.54 - . + +## 2026-10-14 23:41:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.55] . +### Releases +- [PyPI v1.3.55] https://pypi.org/project/openrouter/1.3.55 - . \ No newline at end of file diff --git a/docs/components/answers.mdx b/docs/components/answers.mdx index b065c94f..43893fe7 100644 --- a/docs/components/answers.mdx +++ b/docs/components/answers.mdx @@ -2,11 +2,17 @@ title: "Answers" --- -A Decisions answer using a boolean, choice, or score evaluation. +A Decisions answer using a boolean, choice, score, or image bounding-box evaluation. ## Supported Types +### `components.DecisionsBoxAnswer` + +```python +value: components.DecisionsBoxAnswer = /* values here */ +``` + ### `components.DecisionsChoiceAnswer` ```python diff --git a/docs/components/box.mdx b/docs/components/box.mdx new file mode 100644 index 00000000..1f38cb26 --- /dev/null +++ b/docs/components/box.mdx @@ -0,0 +1,12 @@ +--- +title: "Box" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bottom` | *float* | ✅ | N/A | +| `left` | *float* | ✅ | N/A | +| `right` | *float* | ✅ | N/A | +| `top` | *float* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/decisionsboxanswer.mdx b/docs/components/decisionsboxanswer.mdx new file mode 100644 index 00000000..78ecae50 --- /dev/null +++ b/docs/components/decisionsboxanswer.mdx @@ -0,0 +1,11 @@ +--- +title: "DecisionsBoxAnswer" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `box` | [components.Box](../components/box.mdx) | ✅ | N/A | +| `confidence` | *Optional[float]* | ➖ | N/A | +| `type` | [components.DecisionsBoxAnswerType](../components/decisionsboxanswertype.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/decisionsboxanswertype.mdx b/docs/components/decisionsboxanswertype.mdx new file mode 100644 index 00000000..f8ee5fe3 --- /dev/null +++ b/docs/components/decisionsboxanswertype.mdx @@ -0,0 +1,15 @@ +--- +title: "DecisionsBoxAnswerType" +--- + +## Example Usage + +```python +from openrouter.components import DecisionsBoxAnswerType +value: DecisionsBoxAnswerType = "box" +``` + + +## Values + +- `"box"` diff --git a/docs/components/decisionsboxquestion.mdx b/docs/components/decisionsboxquestion.mdx new file mode 100644 index 00000000..28364ed2 --- /dev/null +++ b/docs/components/decisionsboxquestion.mdx @@ -0,0 +1,10 @@ +--- +title: "DecisionsBoxQuestion" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `instructions` | [components.DecisionsBoxQuestionInstructions](../components/decisionsboxquestioninstructions.mdx) | ✅ | A plain string, or a JSON object or array of structured guidance. | +| `type` | [components.DecisionsBoxQuestionType](../components/decisionsboxquestiontype.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/decisionsboxquestioninstructions.mdx b/docs/components/decisionsboxquestioninstructions.mdx new file mode 100644 index 00000000..378399c6 --- /dev/null +++ b/docs/components/decisionsboxquestioninstructions.mdx @@ -0,0 +1,27 @@ +--- +title: "DecisionsBoxQuestionInstructions" +--- + +A plain string, or a JSON object or array of structured guidance. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `Dict[str, Any]` + +```python +value: Dict[str, Any] = /* values here */ +``` + +### `List[Any]` + +```python +value: List[Any] = /* values here */ +``` + diff --git a/docs/components/decisionsboxquestiontype.mdx b/docs/components/decisionsboxquestiontype.mdx new file mode 100644 index 00000000..bb87797f --- /dev/null +++ b/docs/components/decisionsboxquestiontype.mdx @@ -0,0 +1,15 @@ +--- +title: "DecisionsBoxQuestionType" +--- + +## Example Usage + +```python +from openrouter.components import DecisionsBoxQuestionType +value: DecisionsBoxQuestionType = "box" +``` + + +## Values + +- `"box"` diff --git a/docs/components/questions.mdx b/docs/components/questions.mdx index 15be03f7..f6c2d80b 100644 --- a/docs/components/questions.mdx +++ b/docs/components/questions.mdx @@ -2,11 +2,17 @@ title: "Questions" --- -A Decisions question using a boolean, choice, or ordered score evaluation. +A Decisions question using a boolean, choice, ordered score, or image bounding-box evaluation. ## Supported Types +### `components.DecisionsBoxQuestion` + +```python +value: components.DecisionsBoxQuestion = /* values here */ +``` + ### `components.DecisionsChoiceQuestion` ```python diff --git a/pyproject.toml b/pyproject.toml index 1b0c571a..da47717c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.54" +version = "1.3.55" 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 ac9989f8..92d007f0 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.54" +__version__: str = "1.3.55" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.54 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.55 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 e858066a..070351da 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1582,6 +1582,20 @@ DebugEventType, DebugEventTypedDict, ) + from .decisionsboxanswer import ( + Box, + BoxTypedDict, + DecisionsBoxAnswer, + DecisionsBoxAnswerType, + DecisionsBoxAnswerTypedDict, + ) + from .decisionsboxquestion import ( + DecisionsBoxQuestion, + DecisionsBoxQuestionInstructions, + DecisionsBoxQuestionInstructionsTypedDict, + DecisionsBoxQuestionType, + DecisionsBoxQuestionTypedDict, + ) from .decisionschoiceanswer import ( DecisionsChoiceAnswer, DecisionsChoiceAnswerType, @@ -5098,6 +5112,8 @@ "BooleanCapability", "BooleanCapabilityType", "BooleanCapabilityTypedDict", + "Box", + "BoxTypedDict", "BulkAddWorkspaceMembersRequest", "BulkAddWorkspaceMembersRequestTypedDict", "BulkAddWorkspaceMembersResponse", @@ -5543,6 +5559,14 @@ "DebugEventType", "DebugEventTypedDict", "Decisions", + "DecisionsBoxAnswer", + "DecisionsBoxAnswerType", + "DecisionsBoxAnswerTypedDict", + "DecisionsBoxQuestion", + "DecisionsBoxQuestionInstructions", + "DecisionsBoxQuestionInstructionsTypedDict", + "DecisionsBoxQuestionType", + "DecisionsBoxQuestionTypedDict", "DecisionsChoiceAnswer", "DecisionsChoiceAnswerType", "DecisionsChoiceAnswerTypedDict", @@ -8858,6 +8882,16 @@ "DebugEventTimingsTypedDict": ".debugevent", "DebugEventType": ".debugevent", "DebugEventTypedDict": ".debugevent", + "Box": ".decisionsboxanswer", + "BoxTypedDict": ".decisionsboxanswer", + "DecisionsBoxAnswer": ".decisionsboxanswer", + "DecisionsBoxAnswerType": ".decisionsboxanswer", + "DecisionsBoxAnswerTypedDict": ".decisionsboxanswer", + "DecisionsBoxQuestion": ".decisionsboxquestion", + "DecisionsBoxQuestionInstructions": ".decisionsboxquestion", + "DecisionsBoxQuestionInstructionsTypedDict": ".decisionsboxquestion", + "DecisionsBoxQuestionType": ".decisionsboxquestion", + "DecisionsBoxQuestionTypedDict": ".decisionsboxquestion", "DecisionsChoiceAnswer": ".decisionschoiceanswer", "DecisionsChoiceAnswerType": ".decisionschoiceanswer", "DecisionsChoiceAnswerTypedDict": ".decisionschoiceanswer", diff --git a/src/openrouter/components/decisionsboxanswer.py b/src/openrouter/components/decisionsboxanswer.py new file mode 100644 index 00000000..033cb353 --- /dev/null +++ b/src/openrouter/components/decisionsboxanswer.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +class BoxTypedDict(TypedDict): + bottom: float + left: float + right: float + top: float + + +class Box(BaseModel): + bottom: float + + left: float + + right: float + + top: float + + +DecisionsBoxAnswerType = Literal["box",] + + +class DecisionsBoxAnswerTypedDict(TypedDict): + box: BoxTypedDict + type: DecisionsBoxAnswerType + confidence: NotRequired[float] + + +class DecisionsBoxAnswer(BaseModel): + box: Box + + type: DecisionsBoxAnswerType + + confidence: Optional[float] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["confidence"]) + 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/src/openrouter/components/decisionsboxquestion.py b/src/openrouter/components/decisionsboxquestion.py new file mode 100644 index 00000000..d667828e --- /dev/null +++ b/src/openrouter/components/decisionsboxquestion.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Any, Dict, List, Literal, Union +from typing_extensions import TypeAliasType, TypedDict + + +DecisionsBoxQuestionInstructionsTypedDict = TypeAliasType( + "DecisionsBoxQuestionInstructionsTypedDict", Union[str, Dict[str, Any], List[Any]] +) +r"""A plain string, or a JSON object or array of structured guidance.""" + + +DecisionsBoxQuestionInstructions = TypeAliasType( + "DecisionsBoxQuestionInstructions", Union[str, Dict[str, Any], List[Any]] +) +r"""A plain string, or a JSON object or array of structured guidance.""" + + +DecisionsBoxQuestionType = Literal["box",] + + +class DecisionsBoxQuestionTypedDict(TypedDict): + instructions: DecisionsBoxQuestionInstructionsTypedDict + r"""A plain string, or a JSON object or array of structured guidance.""" + type: DecisionsBoxQuestionType + + +class DecisionsBoxQuestion(BaseModel): + instructions: DecisionsBoxQuestionInstructions + r"""A plain string, or a JSON object or array of structured guidance.""" + + type: DecisionsBoxQuestionType diff --git a/src/openrouter/components/decisionsrequest.py b/src/openrouter/components/decisionsrequest.py index 3f40fcff..16559575 100644 --- a/src/openrouter/components/decisionsrequest.py +++ b/src/openrouter/components/decisionsrequest.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .decisionsboxquestion import DecisionsBoxQuestion, DecisionsBoxQuestionTypedDict from .decisionschoicequestion import ( DecisionsChoiceQuestion, DecisionsChoiceQuestionTypedDict, @@ -28,23 +29,25 @@ QuestionsTypedDict = TypeAliasType( "QuestionsTypedDict", Union[ + DecisionsBoxQuestionTypedDict, DecisionsNoulQuestionTypedDict, DecisionsChoiceQuestionTypedDict, DecisionsScoreQuestionTypedDict, ], ) -r"""A Decisions question using a boolean, choice, or ordered score evaluation.""" +r"""A Decisions question using a boolean, choice, ordered score, or image bounding-box evaluation.""" Questions = Annotated[ Union[ + Annotated[DecisionsBoxQuestion, Tag("box")], Annotated[DecisionsChoiceQuestion, Tag("choice")], Annotated[DecisionsNoulQuestion, Tag("noul")], Annotated[DecisionsScoreQuestion, Tag("score")], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] -r"""A Decisions question using a boolean, choice, or ordered score evaluation.""" +r"""A Decisions question using a boolean, choice, ordered score, or image bounding-box evaluation.""" StateTypedDict = TypeAliasType("StateTypedDict", Union[str, Dict[str, Any], List[Any]]) diff --git a/src/openrouter/components/decisionsresponse.py b/src/openrouter/components/decisionsresponse.py index 534bf4bf..687789c6 100644 --- a/src/openrouter/components/decisionsresponse.py +++ b/src/openrouter/components/decisionsresponse.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .decisionsboxanswer import DecisionsBoxAnswer, DecisionsBoxAnswerTypedDict from .decisionschoiceanswer import DecisionsChoiceAnswer, DecisionsChoiceAnswerTypedDict from .decisionsnoulanswer import DecisionsNoulAnswer, DecisionsNoulAnswerTypedDict from .decisionsscoreanswer import DecisionsScoreAnswer, DecisionsScoreAnswerTypedDict @@ -17,11 +18,12 @@ "AnswersTypedDict", Union[ DecisionsNoulAnswerTypedDict, + DecisionsBoxAnswerTypedDict, DecisionsChoiceAnswerTypedDict, DecisionsScoreAnswerTypedDict, ], ) -r"""A Decisions answer using a boolean, choice, or score evaluation.""" +r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.""" class UnknownAnswers(BaseModel): @@ -35,6 +37,7 @@ class UnknownAnswers(BaseModel): _ANSWERS_VARIANTS: dict[str, Any] = { + "box": DecisionsBoxAnswer, "choice": DecisionsChoiceAnswer, "noul": DecisionsNoulAnswer, "score": DecisionsScoreAnswer, @@ -43,7 +46,11 @@ class UnknownAnswers(BaseModel): Answers = Annotated[ Union[ - DecisionsChoiceAnswer, DecisionsNoulAnswer, DecisionsScoreAnswer, UnknownAnswers + DecisionsBoxAnswer, + DecisionsChoiceAnswer, + DecisionsNoulAnswer, + DecisionsScoreAnswer, + UnknownAnswers, ], BeforeValidator( partial( @@ -55,7 +62,7 @@ class UnknownAnswers(BaseModel): ) ), ] -r"""A Decisions answer using a boolean, choice, or score evaluation.""" +r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.""" class DecisionsResponseUsageTypedDict(TypedDict): diff --git a/uv.lock b/uv.lock index c8d5a562..9c44a579 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.54" +version = "1.3.55" source = { editable = "." } dependencies = [ { name = "httpcore" },