diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 717b3074..ddc02439 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: 891fbcc80cd0cddb9ee1333803b10898 + docChecksum: e34260687cf1b3f913ed466113df763e docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.101 - configChecksum: b28398272824ebb18f86644269dcb6d6 + releaseVersion: 1.3.102 + configChecksum: db3715109a278d0dd4e4d293a2a0d93d repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 3976c670-c417-48d9-98ac-f12e8f0bb0ba - pristine_commit_hash: b53e06395bda0d1287882cb1a23b183f6e65bbf7 - pristine_tree_hash: d92c865e1a92b6260734931c39f7c6f3352eba21 + generation_id: 255ec96f-a9a0-4ce1-8933-b80a42fe7e59 + pristine_commit_hash: 29be898cb1a858dd3482a26a1eea82e986daa994 + pristine_tree_hash: c10e0af243ce9020e375c434b6d600a3b8fdea37 features: python: acceptHeaders: 3.0.0 @@ -3202,14 +3202,26 @@ trackedFiles: id: 1375aa431642 last_write_checksum: sha1:adf88fd707bde0d0d0dff2a708375aedc96289c4 pristine_git_object: 06652bc3b30c292ff98d6a2e8008c995ec6f20ff + docs/components/extractionasset.mdx: + id: 0f75e8e96ebc + last_write_checksum: sha1:9895c6624be471a8ed5ab1be8053a91453ed79ea + pristine_git_object: 6fdc05859adf905c404f1330c3ffcb39c3ab5269 + docs/components/extractionassetformat.mdx: + id: de1e9040bc98 + last_write_checksum: sha1:8ce44e4dd8f76ade3083788f3a4e98b3278f6e0e + pristine_git_object: 3e27b886cd9e854d30172169535674269358ad73 + docs/components/extractionassettype.mdx: + id: 9ee9569937e8 + last_write_checksum: sha1:1caac4b91bd1baa4d9abb4d6030b0c72a0b67a7d + pristine_git_object: db830fbf992780c2425c4673540a3b63a822a249 docs/components/extractiondateanswer.mdx: id: 7976b6922576 - last_write_checksum: sha1:76279bf162344dbde8b120abc01012ac3b742bd5 - pristine_git_object: c79d84d31c6f6f8f6ff4cd1ef502525ea6575dd0 + last_write_checksum: sha1:0c156be0de9fabe757021716db295b53ccd7dea6 + pristine_git_object: dfbba98df6f9b767f1cec96adf0d10b754fe1e32 docs/components/extractiondateanswersource.mdx: id: f2dc9a38b450 - last_write_checksum: sha1:69dfe9a77c71401ec9060094762e0c92d61c1e26 - pristine_git_object: 3efa8603a29cd9b32ac8f7e5ff471d4a1b694541 + last_write_checksum: sha1:4eed847bc485fb73c700db3940cb9838e47434a3 + pristine_git_object: 46c6bbcf7d7f793ac2dee71c1fea9660b6e3f483 docs/components/extractiondateanswertype.mdx: id: abeec0e94885 last_write_checksum: sha1:de756e78c8179ea2843d77f04b3d5e0dd9f1e920 @@ -3224,12 +3236,12 @@ trackedFiles: pristine_git_object: 93062f3dbe496a05750406736b128b2024805d40 docs/components/extractiondatetimeanswer.mdx: id: 2559fb1d6b75 - last_write_checksum: sha1:78deb90c4130c7bde23cf31e52ad9838a9786849 - pristine_git_object: c3a07d0ecbdd66b90e33297cb8a787dfbd1be73f + last_write_checksum: sha1:1c6006ab05929914f599705db4b667690a4f569b + pristine_git_object: fcd2722f68d689418a7b25059a3da486c75f18a9 docs/components/extractiondatetimeanswersource.mdx: id: f99304f92143 - last_write_checksum: sha1:4afa61640a4b87f40831cec68587432f28d98a1a - pristine_git_object: 4de96384d0e018f93d79310419dc3077f94b88ef + last_write_checksum: sha1:2619f10aab9dd809212a0b01ddad0bfa133cddcf + pristine_git_object: ea0d47bd3758cac7402258c60c556fb7dc8d001d docs/components/extractiondatetimeanswertype.mdx: id: a4a06b605800 last_write_checksum: sha1:f2d0b24fa2348e1646a9496482153d30337a169a @@ -3244,12 +3256,12 @@ trackedFiles: pristine_git_object: a8fb1fa450654191a98d7520a41ae6c9a8ef83cf docs/components/extractiondurationanswer.mdx: id: 87764531da90 - last_write_checksum: sha1:727fac67bef295c5ed9899bedfd9d12e7763c58f - pristine_git_object: 9d2fe99cc51f98c982533074d878d4e4a511f153 + last_write_checksum: sha1:5a1102f56642726658c5e6724cbc5facfc36d486 + pristine_git_object: acc4cdcf864b6d92fe13b6c2657ddcc42c1b0089 docs/components/extractiondurationanswersource.mdx: id: 7129cb29eb99 - last_write_checksum: sha1:6ed2c1d9d8339786b931afe04c278a34876d0ade - pristine_git_object: 05bfe9cbaf910c5fd3acbb07dd50aad6e076b487 + last_write_checksum: sha1:af2cea96865caefe0758a72835ffbe19295eb487 + pristine_git_object: 21e7c9d29b190c8b9ca54483ec2500eb2883a33c docs/components/extractiondurationanswertype.mdx: id: f65b90cd2758 last_write_checksum: sha1:25dfe4272d867f6b5d594f830afcb611b7b82441 @@ -3264,8 +3276,8 @@ trackedFiles: pristine_git_object: 53575c65bbe75d45548d77d37e0cdd9033f35643 docs/components/extractionestimateanswer.mdx: id: d008b8a78f78 - last_write_checksum: sha1:b1530aab8091481947dfa9f2f3f2cbdcb7ff5dfd - pristine_git_object: 1c076a0699df60c9e879a82574eb29dd8140a8a1 + last_write_checksum: sha1:185c00ce75e92ba66fdbe01d55aab17efe791153 + pristine_git_object: b5a8ad76a4f71e1642c86570f2610f22cdc7b1dc docs/components/extractionestimateanswerguess.mdx: id: 114df7c91c74 last_write_checksum: sha1:98ce310132c579080c330d767b50d3791b73d545 @@ -3292,8 +3304,8 @@ trackedFiles: pristine_git_object: bbe9e23cf21369dc8422e6356a09cea8c2adc9b4 docs/components/extractionestimateanswersource.mdx: id: 25ad13931218 - last_write_checksum: sha1:7c245dd3e884e70e4b5f62d33d8b5bf2f613372c - pristine_git_object: 146c7bca9497c72873644db5fe6e3bb1e35702f2 + last_write_checksum: sha1:fa3fd5d4abaf649029c6e34c143cd842ad0b7524 + pristine_git_object: beccfcd78c31a5f2ab31683b1cff3bcb21528917 docs/components/extractionestimateanswertype.mdx: id: 57d58d8241d8 last_write_checksum: sha1:c2cb2b3ff108ea7d23dcf564963c18e77ef9972f @@ -3336,8 +3348,8 @@ trackedFiles: pristine_git_object: 752c86c48b4f3c9acad9f547c168a4541980fae3 docs/components/extractionforecastanswer.mdx: id: ae25d129b50f - last_write_checksum: sha1:d4f0cdf6efd7cf9e5dbcbd96411506e7679b7beb - pristine_git_object: c6372d9e9d48abf359aa6cc4b77a3a20c9555849 + last_write_checksum: sha1:9a366dd043b3a77a43a85925847638f6f2106857 + pristine_git_object: 9cc2edf12b716b95c48cd141c0ad06eb9e228fd7 docs/components/extractionforecastanswerguess.mdx: id: ee54bcc9ab3b last_write_checksum: sha1:1a3c83f874d3d69a28c40620362e56e34ba13a1b @@ -3360,8 +3372,8 @@ trackedFiles: pristine_git_object: 35fe4d981c3bb14311eb3d6ec9e74ef0a544ad2c docs/components/extractionforecastanswersource.mdx: id: 5303ce080293 - last_write_checksum: sha1:d2e1fb806e264a567a60ddea46dc28c1a34085fc - pristine_git_object: 8e82e1771d87dcd1ff71c7ed2698802aca3636f1 + last_write_checksum: sha1:c1983b20a219d53d8a959adf02bdeee73ff58e12 + pristine_git_object: e8e36846c0a25fdc9085485b69c1e8b827e56c2f docs/components/extractionforecastanswertype.mdx: id: 1dfae7b75165 last_write_checksum: sha1:8610885da1c70f0098c80785fa1326197324aafc @@ -3432,16 +3444,16 @@ trackedFiles: pristine_git_object: e971ec1fa26c3043eeef4862f105546922e4a7bd docs/components/extractionlistanswer.mdx: id: a2388a5a8321 - last_write_checksum: sha1:eb9733d9eb4ae1b2a2db51f75f4f6583cb3ea695 - pristine_git_object: b6ff7aefb8602417c36c6fb4d5250d63389703f3 + last_write_checksum: sha1:3426d41448b8c053f7736058d40fd1de43eb25aa + pristine_git_object: 3e064b846e9e7b0bfa6b830be13ce9acc8310c2e docs/components/extractionlistanswerguess.mdx: id: 3a1738d5a4b3 last_write_checksum: sha1:67f869f2bdbc3fe19e4c5ba0c48e0f7b0d1b3f91 pristine_git_object: d429b35572a8201202dd6066b1b5c831ca3b0962 docs/components/extractionlistanswersource.mdx: id: 339b9df8e667 - last_write_checksum: sha1:c654822b16d199d273f2e8d5213a7f591f9c63fb - pristine_git_object: 1f178170f6285af32a3b5c047e4e03b80a0a59db + last_write_checksum: sha1:8216e9d7c4285d02206a440d9f4ac9d8d0448d09 + pristine_git_object: dbdee8f7f7ebd8d11961a4164d39540ca08b2fc2 docs/components/extractionlistanswertype.mdx: id: 56ebb6469ae6 last_write_checksum: sha1:af6bcf33a99bb5f3e7baea1cebcbcbdc57625f6b @@ -3460,12 +3472,12 @@ trackedFiles: pristine_git_object: 1c3e50bcb691651feb7ba737ce8f9e5625a6b1bc docs/components/extractionnumberanswer.mdx: id: 9c9ff12897b6 - last_write_checksum: sha1:f3c5920dda252683b577a0b7d1c4db7da43eba94 - pristine_git_object: 910b88e2b888414bfa128f6eef3f3777e22b47b4 + last_write_checksum: sha1:da3f58385de439056a1d1e7c7859c456d9e8a735 + pristine_git_object: f87020791f0d7a908c7a3512511940d93f2e4689 docs/components/extractionnumberanswersource.mdx: id: b410ee01d94a - last_write_checksum: sha1:cd38040c34649937901e8bc0e4be4a377099658e - pristine_git_object: 9bd790768b7486e45891cc713e2161bd76445f2e + last_write_checksum: sha1:c98e6ba67bff15e5fa5fa36a798b0ea0a2473225 + pristine_git_object: b490ba086c27cfe45eee0252086a622608942b5a docs/components/extractionnumberanswertype.mdx: id: 71297fbae75c last_write_checksum: sha1:eb7cb0386bece38284bea47d30ab590cd3f46d17 @@ -3480,8 +3492,8 @@ trackedFiles: pristine_git_object: 0f381107c5f4271335895826cb89b0791a0b80c1 docs/components/extractionsrequest.mdx: id: 8e3359e7a4eb - last_write_checksum: sha1:4b60df894e656bb033bafd1e79efda1cd00bc19e - pristine_git_object: d0d122a3ee63730c7813403ea08ad30127bdce45 + last_write_checksum: sha1:8987945528de0f54ad1733f7017579bd36973ab3 + pristine_git_object: 875659a62760a2e72fabd3ed9aab0743cda726ea docs/components/extractionsresponse.mdx: id: 9b1ac791359b last_write_checksum: sha1:680a79be2427f7e882cd973188c50d1f8fef56c1 @@ -3496,12 +3508,12 @@ trackedFiles: pristine_git_object: 7d335f16309b405175e5225f2b9b8cd66f63fc31 docs/components/extractiontextanswer.mdx: id: 7f03372c93b9 - last_write_checksum: sha1:7b96dbe002ec49e2b6b84c49a3d2ef9a4230c91f - pristine_git_object: b8f0fe6cd2659dd9075fb37cebf07c2cf8f49541 + last_write_checksum: sha1:39092fead11de7076fcb10bb68af1b1f741de6e6 + pristine_git_object: 2e4bf9d37983a68870aa3d6465a13b06a7e44ce7 docs/components/extractiontextanswersource.mdx: id: 769d49d5b121 - last_write_checksum: sha1:b3a4ae20b4824df3b052e824a0e09dd1d6d5a26f - pristine_git_object: 29c1e18622dea31e6f776c7128dc4d58f1a05eca + last_write_checksum: sha1:1c476a0083edf8ac04e164da0a8463997e653de1 + pristine_git_object: b02a8eb9f251f367a4756a1a0a9013b988ed2ffc docs/components/extractiontextanswertype.mdx: id: d0a19b4f52a6 last_write_checksum: sha1:7181b0279cf9fb01695e7360f391292a82924301 @@ -3516,12 +3528,12 @@ trackedFiles: pristine_git_object: d8d4a00ca072f643c2fad4a13ce37e9032e5c0ff docs/components/extractiontimeanswer.mdx: id: 518a28381666 - last_write_checksum: sha1:d01f80e8a2ad8e3c770357529f92e3546b103248 - pristine_git_object: 065ab42c4b2bbed00d74c3e30cc6783b2b86cf6a + last_write_checksum: sha1:65234fbb6d40106454484612f257187ed1e59cf9 + pristine_git_object: 025bdf948ecb0a590f38ecc18a83b4b3b2577016 docs/components/extractiontimeanswersource.mdx: id: ed64b325414c - last_write_checksum: sha1:ac66b2b2f1daf2468cc1a53a958aa27f91aa1afd - pristine_git_object: 068f14a4beb56762a1d7eb9c7a3d9edf8756e81b + last_write_checksum: sha1:f8aeea532db0599f7e3659fedea8fd2057f5cb85 + pristine_git_object: 5379ce4613096fc12b1d60080754af59b0a2ae27 docs/components/extractiontimeanswertype.mdx: id: 5ebcc17e8181 last_write_checksum: sha1:c521cf4a98af256d9ff58a179efa822d6a0a443c @@ -10656,8 +10668,8 @@ trackedFiles: pristine_git_object: 895dba6170d02cbf49dd87e817d260574e17841a docs/sdks/extractions/README.mdx: id: 7b1a30cfc1d9 - last_write_checksum: sha1:eb0f02e6edd22c1087af709d8641b966e4a092c3 - pristine_git_object: d2368a310672c66c7cb9d8ccc5365057a17f604c + last_write_checksum: sha1:d884272149886b686beb590a6b0b791b38f7a024 + pristine_git_object: 8db370b97559a7249d33fa06f0c8ebafe4145707 docs/sdks/files/README.mdx: id: 1a0c257e330c last_write_checksum: sha1:853537439b97cd6606f2d9f12de4b00deda6f912 @@ -10752,8 +10764,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:60a23c9c539a6a5009470745816dc4beaff9fc4b - pristine_git_object: b4b9c12351be58ca1b631223b7fba0c788aa30a8 + last_write_checksum: sha1:1c82ea3ced5489880dbe1ee670416170e1e89650 + pristine_git_object: 468c9965bee65473f439b3dbd8ba3807add73f76 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10780,8 +10792,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:a384c91148fe7af26faf1f4ed7790985b80b7b56 - pristine_git_object: f21312c240f249cd03a1b3d06e17a98f2e2909df + last_write_checksum: sha1:47445f7c3a25c2c521db435dce2e30c07b8ce9bb + pristine_git_object: e0515b499f9b3a0de5a26dae56c6b7faf8b2b66c src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -10828,8 +10840,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:f61b76a14bb861286ff7f67b0a3799435af7646d - pristine_git_object: 79cf89c08859ae44581a90f212caaf369ccb5e33 + last_write_checksum: sha1:56a6747e365c4882056dd693cabb01a7ad9724ff + pristine_git_object: f74ec63ffe931137169b5c7032aa04075a77bff8 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -12162,42 +12174,46 @@ trackedFiles: id: c380cfecd177 last_write_checksum: sha1:06d354a069eb17d3cbd13932e0258dc1d3ea6f9f pristine_git_object: cb4e716656633b8d070646198b4fe0f560ee94d0 + src/openrouter/components/extractionasset.py: + id: 577b5551ee92 + last_write_checksum: sha1:cecf7cbe4f636f2a01a9f749440afd86a475448e + pristine_git_object: 89359890b9167c8e24d5ee5dd86b572d303a3146 src/openrouter/components/extractiondateanswer.py: id: 2606de693996 - last_write_checksum: sha1:cc70acaabff93d67e1ee21f99852100a78411832 - pristine_git_object: 7fca50880986c85db36cc61bc5fc2b6170f201d3 + last_write_checksum: sha1:cf68c795269284afe00c7d12e5f930e30ab2ec27 + pristine_git_object: 5978ebb15e5c7324f34389991236a66e423ff294 src/openrouter/components/extractiondatefield.py: id: d61917ea9968 last_write_checksum: sha1:c288f7fdb316615c0105f3ed0b44d55d9b2514ab pristine_git_object: ecb2d421f5fe3688e40a23add97613488a9f9cfe src/openrouter/components/extractiondatetimeanswer.py: id: 81153f9833e4 - last_write_checksum: sha1:3622c58108370ec500e2aebae03c0f036ee181d5 - pristine_git_object: 6de327cce2051e62db78360090130747623e9cb2 + last_write_checksum: sha1:18ef9569eeb886d5f5d1fb19a8604170e9d44513 + pristine_git_object: 6a6340b742253131e8877c38043f79850682434f src/openrouter/components/extractiondatetimefield.py: id: c19ff7161d38 last_write_checksum: sha1:a1ddc34fbdbd254e443f163bd68e92dbec938d2b pristine_git_object: 7bd5a82d649b994453bb1bcdc9ea31fc88cc5c4f src/openrouter/components/extractiondurationanswer.py: id: 9dee37484997 - last_write_checksum: sha1:4bff9e0426b235103426676aae88cae451179779 - pristine_git_object: da48cb14fabe210dee57eeac3390c07b57f8194a + last_write_checksum: sha1:387bf7ca11245565e61dbb312c76cab8e4d7a7f9 + pristine_git_object: c8a27f37a330e48618148cb445df1418831f10ad src/openrouter/components/extractiondurationfield.py: id: af1aa9d859dd last_write_checksum: sha1:cffdbb364074d650fe2c46e4b0a2f35375c0c2b3 pristine_git_object: 9909d58fb25d505c57dcbbbbb7fd4d1f8f13caf3 src/openrouter/components/extractionestimateanswer.py: id: d224919feae7 - last_write_checksum: sha1:e87c1f692beb24ef6073ae20daff3775b68a97cf - pristine_git_object: 49ba18a0167370ce69fe9958d8941578520c23ae + last_write_checksum: sha1:d5e1baa8ea62e54a6f936a848d755c7e1310fd8a + pristine_git_object: 04e92295f91bebb08084e8e542e5949767100338 src/openrouter/components/extractionestimatefield.py: id: c3eda81242f7 last_write_checksum: sha1:2cb350e3a451d63a3157a27018b0de2c08deb5e5 pristine_git_object: 27a5f24e392ea0da8187188bd3c2ef9d72b9285c src/openrouter/components/extractionforecastanswer.py: id: eb06525c8e62 - last_write_checksum: sha1:0336c7527a29cd0d61322f62a728c8a24a41eef4 - pristine_git_object: 46a911b68f2527d5693f9112b97cf926ac495939 + last_write_checksum: sha1:be057c958b0b5df013bebb19993db1d447d2bdcc + pristine_git_object: e156568a03c3beed23f4985e91e571091153bca5 src/openrouter/components/extractionforecastfield.py: id: 6cc5b70bbdaa last_write_checksum: sha1:b1e7a06ae90aea89f42a176e6b431c7690bf9f95 @@ -12208,44 +12224,44 @@ trackedFiles: pristine_git_object: 47809e77d553ffe84129e51a757ba394c662929b src/openrouter/components/extractionlistanswer.py: id: c7aaa4f5afb4 - last_write_checksum: sha1:9b9771df15e9745f37377c166c8d6d99106c720c - pristine_git_object: 82ad80fe1a214135854207e1cf7526e0a3cbb403 + last_write_checksum: sha1:65ba10aada33f83fadb4ac26ffa65e0595e34b63 + pristine_git_object: b6d3fdd510e30f123b694566e7a3158a44fd5ac5 src/openrouter/components/extractionlistfield.py: id: dab2a75a880d last_write_checksum: sha1:7c25db467c8f01cba924c3885ca3236e0e5cb358 pristine_git_object: 282b863b6a9cc1a53fdb78a36ae6dbec73876784 src/openrouter/components/extractionnumberanswer.py: id: 9a87b682eef5 - last_write_checksum: sha1:cf6b3acf15a73dc16bb3ee81344b359f6a5ffc99 - pristine_git_object: adea072191b14099ab7702c29efbc1c17672f9ea + last_write_checksum: sha1:255ed6948850311f243a1396727e2705c20f9d4f + pristine_git_object: f5efee6748b67fa686624b33f57918811c0f29d6 src/openrouter/components/extractionnumberfield.py: id: 1529d36e4196 last_write_checksum: sha1:0c2cde20943acaa47d3a6aef845cff1c1d6dfeb1 pristine_git_object: 1823b0109214ebfbe1fa1a29581594beb30c4280 src/openrouter/components/extractionsrequest.py: id: afe9f8e432cb - last_write_checksum: sha1:c943666b7398497d17de2490fbb6981fbb96bf5f - pristine_git_object: a75599b1b05639839c777303fb392e0139afd6dc + last_write_checksum: sha1:7ecc86ff4567e55b10a36d9e098147628f126d26 + pristine_git_object: fa92eb67cb40a0da458ae73543131c13e03b1bfc src/openrouter/components/extractionsresponse.py: id: c453ec16798e - last_write_checksum: sha1:5981cad6a37d5ef1947efd6454d0b328e3fd4096 - pristine_git_object: edada0cbb8f95fc9f8bed1e4aa2980f1f70c2809 + last_write_checksum: sha1:038d4b3aab4fbf90d91c5db26d9c9a36dfe0ea30 + pristine_git_object: 4b3434f64dc01156396fed62d0ee4cd7679990a9 src/openrouter/components/extractionsusage.py: id: 4a18cd53e383 last_write_checksum: sha1:8d9f5dd7e6cb58070d4346cdb6143efaf62073e9 pristine_git_object: e42e2df4a4829e4e41fdbc9f12f30697babb0ad4 src/openrouter/components/extractiontextanswer.py: id: 2d6f419e73eb - last_write_checksum: sha1:5d06ab73ceceac08cad2c95f716565bad4fb207a - pristine_git_object: b72f0066eebe6b45af1df620211327f07bd2dbb9 + last_write_checksum: sha1:3a56c075e221cc24daf66bdebbda5e5f0071f860 + pristine_git_object: 7063d27d7ed2a2e051debd7c3be2482be5498179 src/openrouter/components/extractiontextfield.py: id: 5d0da20614ae last_write_checksum: sha1:1754a6adb25664515628f5ad636d52d91d578fd4 pristine_git_object: 4624afa9f690195186ee91309c4c7dad5225eb06 src/openrouter/components/extractiontimeanswer.py: id: d6e27db7d4ad - last_write_checksum: sha1:bc728c14ecfb892c98eb08a708729fe69187fbed - pristine_git_object: 11a35dabcf6427c0cf62213a56edd6e8bd915017 + last_write_checksum: sha1:f70f641ea1d2d45222a361c6aa5eee4a7010b351 + pristine_git_object: de7a992464bb07771e6029afa677325278da665c src/openrouter/components/extractiontimefield.py: id: bb90e69521cd last_write_checksum: sha1:e2ee89e44d983012bfbea96449a2e1d44e6a1eb0 @@ -14472,8 +14488,8 @@ trackedFiles: pristine_git_object: 2b03ccea82b6bb60876b63ef75445a9e2a3760bd src/openrouter/extractions.py: id: 27f1e1fb0fc0 - last_write_checksum: sha1:9da3c6198cb5e5354f400d635cd00e066edd1918 - pristine_git_object: 1def6665b48bef8c2f7a746a50e7f44caec1c968 + last_write_checksum: sha1:d921a2597320915fed9a8f9d66f7ef292e16a956 + pristine_git_object: 7cef3d56705c7a4d8a264b43f722ac1f162888d6 src/openrouter/files.py: id: 7baf7ee1f5b3 last_write_checksum: sha1:a780217e0d86c5893c5df4877b5451385144e876 @@ -19800,8 +19816,4 @@ examples: "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).access_programs` **Added** - * `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).access_programs` **Added** - * `open_router.presets.create_presets_responses()`: `request.access_programs` **Added** +releaseNotes: "## Python SDK Changes:\n* `open_router.alpha.extractions.create()`: \n * `request.assets.Map` **Changed**\n * `response.answers.Map` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7772ba83..b73e31eb 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.101 + version: 1.3.102 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 7a15a5e6..85b4ad75 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11799,6 +11799,32 @@ components: required: - 'data' type: 'object' + ExtractionAsset: + additionalProperties: false + description: 'An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only.' + properties: + data_base64: + minLength: 1 + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' + type: 'string' + format: + enum: + - 'png' + - 'jpg' + - 'jpeg' + - 'pdf' + type: 'string' + x-speakeasy-unknown-values: allow + type: + enum: + - 'image' + - 'document' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'format' + - 'data_base64' + type: 'object' ExtractionDateAnswer: properties: confidence: @@ -11812,10 +11838,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -11842,6 +11869,7 @@ components: - 'value' type: 'object' ExtractionDateField: + additionalProperties: false properties: instructions: description: 'What the field should contain.' @@ -11872,10 +11900,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -11902,6 +11931,7 @@ components: - 'value' type: 'object' ExtractionDatetimeField: + additionalProperties: false properties: instructions: description: 'What the field should contain.' @@ -11933,10 +11963,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -11967,6 +11998,7 @@ components: - 'value' type: 'object' ExtractionDurationField: + additionalProperties: false properties: decimals: description: 'Decimal places kept in `value`.' @@ -12046,10 +12078,11 @@ components: - type: 'string' type: 'array' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow spell_confidence: @@ -12071,6 +12104,7 @@ components: - 'value' type: 'object' ExtractionEstimateField: + additionalProperties: false properties: instructions: description: 'What the field should contain.' @@ -12165,10 +12199,11 @@ components: - type: 'string' type: 'array' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow spell_confidence: @@ -12197,6 +12232,7 @@ components: - 'value' type: 'object' ExtractionForecastField: + additionalProperties: false properties: horizon: description: 'Number of forecast steps.' @@ -12316,6 +12352,12 @@ components: confidence: format: 'double' type: 'number' + confidences: + description: 'One confidence per item of `value`, in the same order.' + items: + format: 'double' + type: 'number' + type: 'array' guess: description: 'The most likely value even when `value` is null because `p_null` crossed the threshold.' items: @@ -12329,10 +12371,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow spans: @@ -12366,6 +12409,7 @@ components: - 'value' type: 'object' ExtractionListField: + additionalProperties: false properties: decimals: description: 'Decimal places kept in `value`.' @@ -12410,10 +12454,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -12441,6 +12486,7 @@ components: - 'value' type: 'object' ExtractionNumberField: + additionalProperties: false properties: decimals: description: 'Decimal places kept in `value`.' @@ -12468,11 +12514,12 @@ components: - 'type' type: 'object' ExtractionsRequest: + additionalProperties: false properties: assets: additionalProperties: - $ref: '#/components/schemas/DecisionsImageAsset' - description: 'Images keyed by reference string, as in TypeSafe''s API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.' + $ref: '#/components/schemas/ExtractionAsset' + description: 'Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset''s key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400.' type: 'object' fields: additionalProperties: @@ -12613,10 +12660,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -12643,6 +12691,7 @@ components: - 'value' type: 'object' ExtractionTextField: + additionalProperties: false properties: instructions: description: 'What the field should contain.' @@ -12673,10 +12722,11 @@ components: format: 'double' type: 'number' source: - description: 'Set to `image` when the answer was read from an image rather than the state text.' + description: 'Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.' enum: - 'state' - 'image' + - 'document' type: 'string' x-speakeasy-unknown-values: allow span: @@ -12703,6 +12753,7 @@ components: - 'value' type: 'object' ExtractionTimeField: + additionalProperties: false properties: instructions: description: 'What the field should contain.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1a7dfa6d..915f7a93 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:ccc96c5353fb2491ea1283b289e1862413351f3483ae6a03636fafc98144a5f8 - sourceBlobDigest: sha256:0f96ca3b3857d32836394a87ae1612c437ac45a5cb70745f5fc7340e176f8a22 + sourceRevisionDigest: sha256:df8d73d8a3c2e994074904c6b7b282a13f37b1708231f60fc8240715b564ab6a + sourceBlobDigest: sha256:fb00a0483bd11ce79fc75982e9498865e02050a6eac2defef0a64b918fe96069 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ccc96c5353fb2491ea1283b289e1862413351f3483ae6a03636fafc98144a5f8 - sourceBlobDigest: sha256:0f96ca3b3857d32836394a87ae1612c437ac45a5cb70745f5fc7340e176f8a22 + sourceRevisionDigest: sha256:df8d73d8a3c2e994074904c6b7b282a13f37b1708231f60fc8240715b564ab6a + sourceBlobDigest: sha256:fb00a0483bd11ce79fc75982e9498865e02050a6eac2defef0a64b918fe96069 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:7902840af4493cd0ab8bd1ae9f0524227e09edaa1c245681123e55d922e51f8b + codeSamplesRevisionDigest: sha256:78857678d6d27488340eeea14da0733a475a85b89313700bb1c75812a393e597 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 93620581..7309b0b8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3779,4 +3779,14 @@ Based on: ### Generated - [python v1.3.101] . ### Releases -- [PyPI v1.3.101] https://pypi.org/project/openrouter/1.3.101 - . \ No newline at end of file +- [PyPI v1.3.101] https://pypi.org/project/openrouter/1.3.101 - . + +## 2026-10-30 16:22:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.102] . +### Releases +- [PyPI v1.3.102] https://pypi.org/project/openrouter/1.3.102 - . \ No newline at end of file diff --git a/docs/components/extractionasset.mdx b/docs/components/extractionasset.mdx new file mode 100644 index 00000000..6fdc0585 --- /dev/null +++ b/docs/components/extractionasset.mdx @@ -0,0 +1,14 @@ +--- +title: "ExtractionAsset" +--- + +An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `data_base64` | *str* | ✔️ | N/A | +| `format_` | [components.ExtractionAssetFormat](../components/extractionassetformat.mdx) | ✔️ | N/A | +| `type` | [Optional[components.ExtractionAssetType]](../components/extractionassettype.mdx) | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/extractionassetformat.mdx b/docs/components/extractionassetformat.mdx new file mode 100644 index 00000000..3e27b886 --- /dev/null +++ b/docs/components/extractionassetformat.mdx @@ -0,0 +1,22 @@ +--- +title: "ExtractionAssetFormat" +--- + +## Example Usage + +```python +from openrouter.components import ExtractionAssetFormat + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ExtractionAssetFormat = "png" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"png"` +- `"jpg"` +- `"jpeg"` +- `"pdf"` diff --git a/docs/components/extractionassettype.mdx b/docs/components/extractionassettype.mdx new file mode 100644 index 00000000..db830fbf --- /dev/null +++ b/docs/components/extractionassettype.mdx @@ -0,0 +1,20 @@ +--- +title: "ExtractionAssetType" +--- + +## Example Usage + +```python +from openrouter.components import ExtractionAssetType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ExtractionAssetType = "image" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"image"` +- `"document"` diff --git a/docs/components/extractiondateanswer.mdx b/docs/components/extractiondateanswer.mdx index c79d84d3..dfbba98d 100644 --- a/docs/components/extractiondateanswer.mdx +++ b/docs/components/extractiondateanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionDateAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[str]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionDateAnswerSource]](../components/extractiondateanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionDateAnswerSource]](../components/extractiondateanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionDateAnswerType](../components/extractiondateanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractiondateanswersource.mdx b/docs/components/extractiondateanswersource.mdx index 3efa8603..46c6bbcf 100644 --- a/docs/components/extractiondateanswersource.mdx +++ b/docs/components/extractiondateanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionDateAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractiondatetimeanswer.mdx b/docs/components/extractiondatetimeanswer.mdx index c3a07d0e..fcd2722f 100644 --- a/docs/components/extractiondatetimeanswer.mdx +++ b/docs/components/extractiondatetimeanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionDatetimeAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[str]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionDatetimeAnswerSource]](../components/extractiondatetimeanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionDatetimeAnswerSource]](../components/extractiondatetimeanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionDatetimeAnswerType](../components/extractiondatetimeanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractiondatetimeanswersource.mdx b/docs/components/extractiondatetimeanswersource.mdx index 4de96384..ea0d47bd 100644 --- a/docs/components/extractiondatetimeanswersource.mdx +++ b/docs/components/extractiondatetimeanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionDatetimeAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractiondurationanswer.mdx b/docs/components/extractiondurationanswer.mdx index 9d2fe99c..acc4cdcf 100644 --- a/docs/components/extractiondurationanswer.mdx +++ b/docs/components/extractiondurationanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionDurationAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[float]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionDurationAnswerSource]](../components/extractiondurationanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionDurationAnswerSource]](../components/extractiondurationanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionDurationAnswerType](../components/extractiondurationanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractiondurationanswersource.mdx b/docs/components/extractiondurationanswersource.mdx index 05bfe9cb..21e7c9d2 100644 --- a/docs/components/extractiondurationanswersource.mdx +++ b/docs/components/extractiondurationanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionDurationAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractionestimateanswer.mdx b/docs/components/extractionestimateanswer.mdx index 1c076a06..b5a8ad76 100644 --- a/docs/components/extractionestimateanswer.mdx +++ b/docs/components/extractionestimateanswer.mdx @@ -4,19 +4,19 @@ title: "ExtractionEstimateAnswer" ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `confidence` | *Optional[float]* | ➖ | N/A | -| `guess` | [Optional[components.ExtractionEstimateAnswerGuess]](../components/extractionestimateanswerguess.mdx) | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | -| `mean` | [Optional[components.ExtractionEstimateAnswerMean]](../components/extractionestimateanswermean.mdx) | ➖ | N/A | -| `median` | [Optional[components.ExtractionEstimateAnswerMedian]](../components/extractionestimateanswermedian.mdx) | ➖ | N/A | -| `p_above` | *Optional[float]* | ➖ | Probability mass above `max`. | -| `p_below` | *Optional[float]* | ➖ | Probability mass below `min`. | -| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `p10` | [Optional[components.ExtractionEstimateAnswerP10]](../components/extractionestimateanswerp10.mdx) | ➖ | N/A | -| `p90` | [Optional[components.ExtractionEstimateAnswerP90]](../components/extractionestimateanswerp90.mdx) | ➖ | N/A | -| `quantiles` | List[[components.ExtractionEstimateAnswerQuantile](../components/extractionestimateanswerquantile.mdx)] | ➖ | 99 percentiles, present when the provider is asked for quantiles. | -| `source` | [Optional[components.ExtractionEstimateAnswerSource]](../components/extractionestimateanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | -| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | -| `type` | [components.ExtractionEstimateAnswerType](../components/extractionestimateanswertype.mdx) | ✔️ | N/A | -| `value` | [Nullable[components.ExtractionEstimateAnswerValue]](../components/extractionestimateanswervalue.mdx) | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `confidence` | *Optional[float]* | ➖ | N/A | +| `guess` | [Optional[components.ExtractionEstimateAnswerGuess]](../components/extractionestimateanswerguess.mdx) | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | +| `mean` | [Optional[components.ExtractionEstimateAnswerMean]](../components/extractionestimateanswermean.mdx) | ➖ | N/A | +| `median` | [Optional[components.ExtractionEstimateAnswerMedian]](../components/extractionestimateanswermedian.mdx) | ➖ | N/A | +| `p_above` | *Optional[float]* | ➖ | Probability mass above `max`. | +| `p_below` | *Optional[float]* | ➖ | Probability mass below `min`. | +| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | +| `p10` | [Optional[components.ExtractionEstimateAnswerP10]](../components/extractionestimateanswerp10.mdx) | ➖ | N/A | +| `p90` | [Optional[components.ExtractionEstimateAnswerP90]](../components/extractionestimateanswerp90.mdx) | ➖ | N/A | +| `quantiles` | List[[components.ExtractionEstimateAnswerQuantile](../components/extractionestimateanswerquantile.mdx)] | ➖ | 99 percentiles, present when the provider is asked for quantiles. | +| `source` | [Optional[components.ExtractionEstimateAnswerSource]](../components/extractionestimateanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | +| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | +| `type` | [components.ExtractionEstimateAnswerType](../components/extractionestimateanswertype.mdx) | ✔️ | N/A | +| `value` | [Nullable[components.ExtractionEstimateAnswerValue]](../components/extractionestimateanswervalue.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/extractionestimateanswersource.mdx b/docs/components/extractionestimateanswersource.mdx index 146c7bca..beccfcd7 100644 --- a/docs/components/extractionestimateanswersource.mdx +++ b/docs/components/extractionestimateanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionEstimateAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractionforecastanswer.mdx b/docs/components/extractionforecastanswer.mdx index c6372d9e..9cc2edf1 100644 --- a/docs/components/extractionforecastanswer.mdx +++ b/docs/components/extractionforecastanswer.mdx @@ -4,17 +4,17 @@ title: "ExtractionForecastAnswer" ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `confidence` | *Optional[float]* | ➖ | N/A | -| `guess` | List[[components.ExtractionForecastAnswerGuess](../components/extractionforecastanswerguess.mdx)] | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | -| `mean` | List[[components.ExtractionForecastAnswerMean](../components/extractionforecastanswermean.mdx)] | ➖ | N/A | -| `median` | List[[components.ExtractionForecastAnswerMedian](../components/extractionforecastanswermedian.mdx)] | ➖ | N/A | -| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `p10` | List[[components.ExtractionForecastAnswerP10](../components/extractionforecastanswerp10.mdx)] | ➖ | N/A | -| `p90` | List[[components.ExtractionForecastAnswerP90](../components/extractionforecastanswerp90.mdx)] | ➖ | N/A | -| `source` | [Optional[components.ExtractionForecastAnswerSource]](../components/extractionforecastanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | -| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | -| `steps` | List[[components.ExtractionForecastStep](../components/extractionforecaststep.mdx)] | ➖ | N/A | -| `type` | [components.ExtractionForecastAnswerType](../components/extractionforecastanswertype.mdx) | ✔️ | N/A | -| `value` | List[[components.ExtractionForecastAnswerValue](../components/extractionforecastanswervalue.mdx)] | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `confidence` | *Optional[float]* | ➖ | N/A | +| `guess` | List[[components.ExtractionForecastAnswerGuess](../components/extractionforecastanswerguess.mdx)] | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | +| `mean` | List[[components.ExtractionForecastAnswerMean](../components/extractionforecastanswermean.mdx)] | ➖ | N/A | +| `median` | List[[components.ExtractionForecastAnswerMedian](../components/extractionforecastanswermedian.mdx)] | ➖ | N/A | +| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | +| `p10` | List[[components.ExtractionForecastAnswerP10](../components/extractionforecastanswerp10.mdx)] | ➖ | N/A | +| `p90` | List[[components.ExtractionForecastAnswerP90](../components/extractionforecastanswerp90.mdx)] | ➖ | N/A | +| `source` | [Optional[components.ExtractionForecastAnswerSource]](../components/extractionforecastanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | +| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | +| `steps` | List[[components.ExtractionForecastStep](../components/extractionforecaststep.mdx)] | ➖ | N/A | +| `type` | [components.ExtractionForecastAnswerType](../components/extractionforecastanswertype.mdx) | ✔️ | N/A | +| `value` | List[[components.ExtractionForecastAnswerValue](../components/extractionforecastanswervalue.mdx)] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/extractionforecastanswersource.mdx b/docs/components/extractionforecastanswersource.mdx index 8e82e177..e8e36846 100644 --- a/docs/components/extractionforecastanswersource.mdx +++ b/docs/components/extractionforecastanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionForecastAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractionlistanswer.mdx b/docs/components/extractionlistanswer.mdx index b6ff7aef..3e064b84 100644 --- a/docs/components/extractionlistanswer.mdx +++ b/docs/components/extractionlistanswer.mdx @@ -4,13 +4,14 @@ title: "ExtractionListAnswer" ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `confidence` | *Optional[float]* | ➖ | N/A | -| `guess` | List[[components.ExtractionListAnswerGuess](../components/extractionlistanswerguess.mdx)] | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | -| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionListAnswerSource]](../components/extractionlistanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | -| `spans` | List[List[*int*]] | ➖ | N/A | -| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | -| `type` | [components.ExtractionListAnswerType](../components/extractionlistanswertype.mdx) | ✔️ | N/A | -| `value` | List[[components.ExtractionListAnswerValue](../components/extractionlistanswervalue.mdx)] | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `confidence` | *Optional[float]* | ➖ | N/A | +| `confidences` | List[*float*] | ➖ | One confidence per item of `value`, in the same order. | +| `guess` | List[[components.ExtractionListAnswerGuess](../components/extractionlistanswerguess.mdx)] | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | +| `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | +| `source` | [Optional[components.ExtractionListAnswerSource]](../components/extractionlistanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | +| `spans` | List[List[*int*]] | ➖ | N/A | +| `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | +| `type` | [components.ExtractionListAnswerType](../components/extractionlistanswertype.mdx) | ✔️ | N/A | +| `value` | List[[components.ExtractionListAnswerValue](../components/extractionlistanswervalue.mdx)] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/extractionlistanswersource.mdx b/docs/components/extractionlistanswersource.mdx index 1f178170..dbdee8f7 100644 --- a/docs/components/extractionlistanswersource.mdx +++ b/docs/components/extractionlistanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionListAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractionnumberanswer.mdx b/docs/components/extractionnumberanswer.mdx index 910b88e2..f8702079 100644 --- a/docs/components/extractionnumberanswer.mdx +++ b/docs/components/extractionnumberanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionNumberAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[float]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionNumberAnswerSource]](../components/extractionnumberanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionNumberAnswerSource]](../components/extractionnumberanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionNumberAnswerType](../components/extractionnumberanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractionnumberanswersource.mdx b/docs/components/extractionnumberanswersource.mdx index 9bd79076..b490ba08 100644 --- a/docs/components/extractionnumberanswersource.mdx +++ b/docs/components/extractionnumberanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionNumberAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractionsrequest.mdx b/docs/components/extractionsrequest.mdx index d0d122a3..875659a6 100644 --- a/docs/components/extractionsrequest.mdx +++ b/docs/components/extractionsrequest.mdx @@ -4,14 +4,14 @@ title: "ExtractionsRequest" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `assets` | Dict[str, [components.DecisionsImageAsset](../components/decisionsimageasset.mdx)] | ➖ | Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text. | | -| `fields` | Dict[str, [components.Fields](../components/fields.mdx)] | ✔️ | Map of field name to typed field spec. | | -| `model` | *str* | ✔️ | N/A | | -| `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | ➖ | N/A | \{
"allow_fallbacks": true
} | -| `reference_date` | *Optional[str]* | ➖ | ISO date that anchors dates written without a year. | | -| `session_id` | *Optional[str]* | ➖ | 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. | session-1234 | -| `state` | *str* | ✔️ | The text to read from. May be empty only when the request carries image assets. | | -| `trace` | [Optional[components.TraceConfig]](../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `user` | *Optional[str]* | ➖ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `assets` | Dict[str, [components.ExtractionAsset](../components/extractionasset.mdx)] | ➖ | Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400. | | +| `fields` | Dict[str, [components.Fields](../components/fields.mdx)] | ✔️ | Map of field name to typed field spec. | | +| `model` | *str* | ✔️ | N/A | | +| `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | ➖ | N/A | \{
"allow_fallbacks": true
} | +| `reference_date` | *Optional[str]* | ➖ | ISO date that anchors dates written without a year. | | +| `session_id` | *Optional[str]* | ➖ | 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. | session-1234 | +| `state` | *str* | ✔️ | The text to read from. May be empty only when the request carries image assets. | | +| `trace` | [Optional[components.TraceConfig]](../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *Optional[str]* | ➖ | N/A | | \ No newline at end of file diff --git a/docs/components/extractiontextanswer.mdx b/docs/components/extractiontextanswer.mdx index b8f0fe6c..2e4bf9d3 100644 --- a/docs/components/extractiontextanswer.mdx +++ b/docs/components/extractiontextanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionTextAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[str]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionTextAnswerSource]](../components/extractiontextanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionTextAnswerSource]](../components/extractiontextanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionTextAnswerType](../components/extractiontextanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractiontextanswersource.mdx b/docs/components/extractiontextanswersource.mdx index 29c1e186..b02a8eb9 100644 --- a/docs/components/extractiontextanswersource.mdx +++ b/docs/components/extractiontextanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionTextAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/components/extractiontimeanswer.mdx b/docs/components/extractiontimeanswer.mdx index 065ab42c..025bdf94 100644 --- a/docs/components/extractiontimeanswer.mdx +++ b/docs/components/extractiontimeanswer.mdx @@ -9,7 +9,7 @@ title: "ExtractionTimeAnswer" | `confidence` | *Optional[float]* | ➖ | N/A | | `guess` | *Optional[str]* | ➖ | The most likely value even when `value` is null because `p_null` crossed the threshold. | | `p_null` | *Optional[float]* | ➖ | Probability that the state contains nothing for this field. | -| `source` | [Optional[components.ExtractionTimeAnswerSource]](../components/extractiontimeanswersource.mdx) | ➖ | Set to `image` when the answer was read from an image rather than the state text. | +| `source` | [Optional[components.ExtractionTimeAnswerSource]](../components/extractiontimeanswersource.mdx) | ➖ | Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. | | `span` | List[*int*] | ➖ | Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. | | `spell_confidence` | *Optional[float]* | ➖ | Confidence in the spelling of text read from an image. | | `type` | [components.ExtractionTimeAnswerType](../components/extractiontimeanswertype.mdx) | ✔️ | N/A | diff --git a/docs/components/extractiontimeanswersource.mdx b/docs/components/extractiontimeanswersource.mdx index 068f14a4..5379ce46 100644 --- a/docs/components/extractiontimeanswersource.mdx +++ b/docs/components/extractiontimeanswersource.mdx @@ -2,7 +2,7 @@ title: "ExtractionTimeAnswerSource" --- -Set to `image` when the answer was read from an image rather than the state text. +Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text. ## Example Usage @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"state"` - `"image"` +- `"document"` diff --git a/docs/sdks/extractions/README.mdx b/docs/sdks/extractions/README.mdx index d2368a31..8db370b9 100644 --- a/docs/sdks/extractions/README.mdx +++ b/docs/sdks/extractions/README.mdx @@ -61,22 +61,22 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `fields` | Dict[str, [components.Fields](../../components/fields.mdx)] | ✔️ | Map of field name to typed field spec. | | -| `model` | *str* | ✔️ | N/A | | -| `state` | *str* | ✔️ | The text to read from. May be empty only when the request carries image assets. | | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `assets` | Dict[str, [components.DecisionsImageAsset](../../components/decisionsimageasset.mdx)] | ➖ | Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text. | | -| `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | N/A | \{
"allow_fallbacks": true
} | -| `reference_date` | *Optional[str]* | ➖ | ISO date that anchors dates written without a year. | | -| `session_id` | *Optional[str]* | ➖ | 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. | session-1234 | -| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `user` | *Optional[str]* | ➖ | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | -| `server_url` | *Optional[str]* | ➖ | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `fields` | Dict[str, [components.Fields](../../components/fields.mdx)] | ✔️ | Map of field name to typed field spec. | | +| `model` | *str* | ✔️ | N/A | | +| `state` | *str* | ✔️ | The text to read from. May be empty only when the request carries image assets. | | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `assets` | Dict[str, [components.ExtractionAsset](../../components/extractionasset.mdx)] | ➖ | Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400. | | +| `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | N/A | \{
"allow_fallbacks": true
} | +| `reference_date` | *Optional[str]* | ➖ | ISO date that anchors dates written without a year. | | +| `session_id` | *Optional[str]* | ➖ | 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. | session-1234 | +| `trace` | [Optional[components.TraceConfig]](../../components/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *Optional[str]* | ➖ | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| `server_url` | *Optional[str]* | ➖ | An optional server URL to use. | http://localhost:8080 | ### Response diff --git a/pyproject.toml b/pyproject.toml index b4b9c123..468c9965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.101" +version = "1.3.102" 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 f21312c2..e0515b49 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.101" +__version__: str = "1.3.102" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.101 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.102 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 79cf89c0..f74ec63f 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1808,6 +1808,12 @@ ExternalUserResponse, ExternalUserResponseTypedDict, ) + from .extractionasset import ( + ExtractionAsset, + ExtractionAssetFormat, + ExtractionAssetType, + ExtractionAssetTypedDict, + ) from .extractiondateanswer import ( ExtractionDateAnswer, ExtractionDateAnswerSource, @@ -5962,6 +5968,10 @@ "ExternalUserResponse", "ExternalUserResponseTypedDict", "ExternalUserTypedDict", + "ExtractionAsset", + "ExtractionAssetFormat", + "ExtractionAssetType", + "ExtractionAssetTypedDict", "ExtractionDateAnswer", "ExtractionDateAnswerSource", "ExtractionDateAnswerType", @@ -9466,6 +9476,10 @@ "ExternalUserTypedDict": ".externaluser", "ExternalUserResponse": ".externaluserresponse", "ExternalUserResponseTypedDict": ".externaluserresponse", + "ExtractionAsset": ".extractionasset", + "ExtractionAssetFormat": ".extractionasset", + "ExtractionAssetType": ".extractionasset", + "ExtractionAssetTypedDict": ".extractionasset", "ExtractionDateAnswer": ".extractiondateanswer", "ExtractionDateAnswerSource": ".extractiondateanswer", "ExtractionDateAnswerType": ".extractiondateanswer", diff --git a/src/openrouter/components/extractionasset.py b/src/openrouter/components/extractionasset.py new file mode 100644 index 00000000..89359890 --- /dev/null +++ b/src/openrouter/components/extractionasset.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +import pydantic +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +ExtractionAssetFormat = Union[ + Literal[ + "png", + "jpg", + "jpeg", + "pdf", + ], + UnrecognizedStr, +] + + +ExtractionAssetType = Union[ + Literal[ + "image", + "document", + ], + UnrecognizedStr, +] + + +class ExtractionAssetTypedDict(TypedDict): + r"""An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only.""" + + data_base64: str + format_: ExtractionAssetFormat + type: NotRequired[ExtractionAssetType] + + +class ExtractionAsset(BaseModel): + r"""An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only.""" + + data_base64: str + + format_: Annotated[ExtractionAssetFormat, pydantic.Field(alias="format")] + + type: Optional[ExtractionAssetType] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + 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 + + +try: + ExtractionAsset.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/extractiondateanswer.py b/src/openrouter/components/extractiondateanswer.py index 7fca5088..5978ebb1 100644 --- a/src/openrouter/components/extractiondateanswer.py +++ b/src/openrouter/components/extractiondateanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionDateAnswerType = Literal["date",] @@ -29,7 +30,7 @@ class ExtractionDateAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionDateAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -50,7 +51,7 @@ class ExtractionDateAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionDateAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/components/extractiondatetimeanswer.py b/src/openrouter/components/extractiondatetimeanswer.py index 6de327cc..6a6340b7 100644 --- a/src/openrouter/components/extractiondatetimeanswer.py +++ b/src/openrouter/components/extractiondatetimeanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionDatetimeAnswerType = Literal["datetime",] @@ -29,7 +30,7 @@ class ExtractionDatetimeAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionDatetimeAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -50,7 +51,7 @@ class ExtractionDatetimeAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionDatetimeAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/components/extractiondurationanswer.py b/src/openrouter/components/extractiondurationanswer.py index da48cb14..c8a27f37 100644 --- a/src/openrouter/components/extractiondurationanswer.py +++ b/src/openrouter/components/extractiondurationanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionDurationAnswerType = Literal["duration",] @@ -29,7 +30,7 @@ class ExtractionDurationAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionDurationAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -52,7 +53,7 @@ class ExtractionDurationAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionDurationAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/components/extractionestimateanswer.py b/src/openrouter/components/extractionestimateanswer.py index 49ba18a0..04e92295 100644 --- a/src/openrouter/components/extractionestimateanswer.py +++ b/src/openrouter/components/extractionestimateanswer.py @@ -73,10 +73,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionEstimateAnswerType = Literal["estimate",] @@ -111,7 +112,7 @@ class ExtractionEstimateAnswerTypedDict(TypedDict): quantiles: NotRequired[List[ExtractionEstimateAnswerQuantileTypedDict]] r"""99 percentiles, present when the provider is asked for quantiles.""" source: NotRequired[ExtractionEstimateAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spell_confidence: NotRequired[float] r"""Confidence in the spelling of text read from an image.""" @@ -147,7 +148,7 @@ class ExtractionEstimateAnswer(BaseModel): r"""99 percentiles, present when the provider is asked for quantiles.""" source: Optional[ExtractionEstimateAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spell_confidence: Optional[float] = None r"""Confidence in the spelling of text read from an image.""" diff --git a/src/openrouter/components/extractionforecastanswer.py b/src/openrouter/components/extractionforecastanswer.py index 46a911b6..e156568a 100644 --- a/src/openrouter/components/extractionforecastanswer.py +++ b/src/openrouter/components/extractionforecastanswer.py @@ -65,10 +65,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionForecastAnswerType = Literal["forecast",] @@ -97,7 +98,7 @@ class ExtractionForecastAnswerTypedDict(TypedDict): p10: NotRequired[List[ExtractionForecastAnswerP10TypedDict]] p90: NotRequired[List[ExtractionForecastAnswerP90TypedDict]] source: NotRequired[ExtractionForecastAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spell_confidence: NotRequired[float] r"""Confidence in the spelling of text read from an image.""" steps: NotRequired[List[ExtractionForecastStepTypedDict]] @@ -125,7 +126,7 @@ class ExtractionForecastAnswer(BaseModel): p90: Optional[List[ExtractionForecastAnswerP90]] = None source: Optional[ExtractionForecastAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spell_confidence: Optional[float] = None r"""Confidence in the spelling of text read from an image.""" diff --git a/src/openrouter/components/extractionlistanswer.py b/src/openrouter/components/extractionlistanswer.py index 82ad80fe..b6d3fdd5 100644 --- a/src/openrouter/components/extractionlistanswer.py +++ b/src/openrouter/components/extractionlistanswer.py @@ -21,10 +21,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionListAnswerType = Literal["list",] @@ -44,12 +45,14 @@ class ExtractionListAnswerTypedDict(TypedDict): type: ExtractionListAnswerType value: Nullable[List[ExtractionListAnswerValueTypedDict]] confidence: NotRequired[float] + confidences: NotRequired[List[float]] + r"""One confidence per item of `value`, in the same order.""" guess: NotRequired[List[ExtractionListAnswerGuessTypedDict]] r"""The most likely value even when `value` is null because `p_null` crossed the threshold.""" p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionListAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spans: NotRequired[List[List[int]]] spell_confidence: NotRequired[float] r"""Confidence in the spelling of text read from an image.""" @@ -62,6 +65,9 @@ class ExtractionListAnswer(BaseModel): confidence: Optional[float] = None + confidences: Optional[List[float]] = None + r"""One confidence per item of `value`, in the same order.""" + guess: Optional[List[ExtractionListAnswerGuess]] = None r"""The most likely value even when `value` is null because `p_null` crossed the threshold.""" @@ -69,7 +75,7 @@ class ExtractionListAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionListAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" spans: Optional[List[List[int]]] = None @@ -79,7 +85,15 @@ class ExtractionListAnswer(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["confidence", "guess", "p_null", "source", "spans", "spell_confidence"] + [ + "confidence", + "confidences", + "guess", + "p_null", + "source", + "spans", + "spell_confidence", + ] ) nullable_fields = set(["value"]) serialized = handler(self) diff --git a/src/openrouter/components/extractionnumberanswer.py b/src/openrouter/components/extractionnumberanswer.py index adea0721..f5efee67 100644 --- a/src/openrouter/components/extractionnumberanswer.py +++ b/src/openrouter/components/extractionnumberanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionNumberAnswerType = Literal["number",] @@ -29,7 +30,7 @@ class ExtractionNumberAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionNumberAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -50,7 +51,7 @@ class ExtractionNumberAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionNumberAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/components/extractionsrequest.py b/src/openrouter/components/extractionsrequest.py index a75599b1..fa92eb67 100644 --- a/src/openrouter/components/extractionsrequest.py +++ b/src/openrouter/components/extractionsrequest.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .decisionsimageasset import DecisionsImageAsset, DecisionsImageAssetTypedDict +from .extractionasset import ExtractionAsset, ExtractionAssetTypedDict from .extractiondatefield import ExtractionDateField, ExtractionDateFieldTypedDict from .extractiondatetimefield import ( ExtractionDatetimeField, @@ -78,8 +78,8 @@ class ExtractionsRequestTypedDict(TypedDict): model: str state: str r"""The text to read from. May be empty only when the request carries image assets.""" - assets: NotRequired[Dict[str, DecisionsImageAssetTypedDict]] - r"""Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.""" + assets: NotRequired[Dict[str, ExtractionAssetTypedDict]] + r"""Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] reference_date: NotRequired[str] r"""ISO date that anchors dates written without a year.""" @@ -99,8 +99,8 @@ class ExtractionsRequest(BaseModel): state: str r"""The text to read from. May be empty only when the request carries image assets.""" - assets: Optional[Dict[str, DecisionsImageAsset]] = None - r"""Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.""" + assets: Optional[Dict[str, ExtractionAsset]] = None + r"""Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400.""" provider: OptionalNullable[ProviderPreferences] = UNSET diff --git a/src/openrouter/components/extractionsresponse.py b/src/openrouter/components/extractionsresponse.py index edada0cb..4b3434f6 100644 --- a/src/openrouter/components/extractionsresponse.py +++ b/src/openrouter/components/extractionsresponse.py @@ -49,8 +49,8 @@ ExtractionDateAnswerTypedDict, ExtractionTimeAnswerTypedDict, ExtractionDatetimeAnswerTypedDict, - ExtractionListAnswerTypedDict, ExtractionDurationAnswerTypedDict, + ExtractionListAnswerTypedDict, ExtractionForecastAnswerTypedDict, ExtractionEstimateAnswerTypedDict, ], diff --git a/src/openrouter/components/extractiontextanswer.py b/src/openrouter/components/extractiontextanswer.py index b72f0066..7063d27d 100644 --- a/src/openrouter/components/extractiontextanswer.py +++ b/src/openrouter/components/extractiontextanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionTextAnswerType = Literal["text",] @@ -29,7 +30,7 @@ class ExtractionTextAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionTextAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -50,7 +51,7 @@ class ExtractionTextAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionTextAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/components/extractiontimeanswer.py b/src/openrouter/components/extractiontimeanswer.py index 11a35dab..de7a9924 100644 --- a/src/openrouter/components/extractiontimeanswer.py +++ b/src/openrouter/components/extractiontimeanswer.py @@ -11,10 +11,11 @@ Literal[ "state", "image", + "document", ], UnrecognizedStr, ] -r"""Set to `image` when the answer was read from an image rather than the state text.""" +r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" ExtractionTimeAnswerType = Literal["time",] @@ -29,7 +30,7 @@ class ExtractionTimeAnswerTypedDict(TypedDict): p_null: NotRequired[float] r"""Probability that the state contains nothing for this field.""" source: NotRequired[ExtractionTimeAnswerSource] - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: NotRequired[List[int]] r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" spell_confidence: NotRequired[float] @@ -50,7 +51,7 @@ class ExtractionTimeAnswer(BaseModel): r"""Probability that the state contains nothing for this field.""" source: Optional[ExtractionTimeAnswerSource] = None - r"""Set to `image` when the answer was read from an image rather than the state text.""" + r"""Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.""" span: Optional[List[int]] = None r"""Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.""" diff --git a/src/openrouter/extractions.py b/src/openrouter/extractions.py index 1def6665..7cef3d56 100644 --- a/src/openrouter/extractions.py +++ b/src/openrouter/extractions.py @@ -25,8 +25,8 @@ def create( x_open_router_categories: Optional[str] = None, assets: Optional[ Union[ - Mapping[str, components.DecisionsImageAsset], - Mapping[str, components.DecisionsImageAssetTypedDict], + Mapping[str, components.ExtractionAsset], + Mapping[str, components.ExtractionAssetTypedDict], ] ] = None, provider: OptionalNullable[ @@ -59,7 +59,7 @@ def create( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param assets: Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text. + :param assets: Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400. :param provider: :param reference_date: ISO date that anchors dates written without a year. :param session_id: 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. @@ -86,7 +86,7 @@ def create( x_open_router_categories=x_open_router_categories, extractions_request=components.ExtractionsRequest( assets=utils.get_pydantic_model( - assets, Optional[Dict[str, components.DecisionsImageAsset]] + assets, Optional[Dict[str, components.ExtractionAsset]] ), fields=utils.get_pydantic_model(fields, Dict[str, components.Fields]), model=model, @@ -248,8 +248,8 @@ async def create_async( x_open_router_categories: Optional[str] = None, assets: Optional[ Union[ - Mapping[str, components.DecisionsImageAsset], - Mapping[str, components.DecisionsImageAssetTypedDict], + Mapping[str, components.ExtractionAsset], + Mapping[str, components.ExtractionAssetTypedDict], ] ] = None, provider: OptionalNullable[ @@ -282,7 +282,7 @@ async def create_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param assets: Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text. + :param assets: Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400. :param provider: :param reference_date: ISO date that anchors dates written without a year. :param session_id: 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. @@ -309,7 +309,7 @@ async def create_async( x_open_router_categories=x_open_router_categories, extractions_request=components.ExtractionsRequest( assets=utils.get_pydantic_model( - assets, Optional[Dict[str, components.DecisionsImageAsset]] + assets, Optional[Dict[str, components.ExtractionAsset]] ), fields=utils.get_pydantic_model(fields, Dict[str, components.Fields]), model=model, diff --git a/uv.lock b/uv.lock index 1f562f78..d3013778 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.101" +version = "1.3.102" source = { editable = "." } dependencies = [ { name = "httpcore" },