diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 59acac4..8935e93 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.27.0" + ".": "0.28.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 8716811..f9df407 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-622b43986c45c1efbeb06dd933786980257f300b7a0edbb2d2a4f708afacce36.yml -openapi_spec_hash: ade837ffc4873d3b50a0fab3f061b397 -config_hash: a3a8e3c71c17eabb21ab8173521181a4 +configured_endpoints: 22 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-fc4ab722e6762cc69d533f57bea0d70b00e44a30c4ad8144e14ff70a1170ec7c.yml +openapi_spec_hash: 2533ea676c195d5f7d30a67c201fd32d +config_hash: 5cb785fcdf07e4053f36b434e1db2d8a diff --git a/CHANGELOG.md b/CHANGELOG.md index 77dc76c..e0dab30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,228 @@ # Changelog +## 0.28.0 (2025-12-15) + +Full Changelog: [v0.27.0...v0.28.0](https://github.com/hyperspell/python-sdk/compare/v0.27.0...v0.28.0) + +### Features + +* **api:** api update ([c6c2b84](https://github.com/hyperspell/python-sdk/commit/c6c2b84de8b1c2480740921847d1a43120ec66a4)) +* **api:** api update ([cc4b7a1](https://github.com/hyperspell/python-sdk/commit/cc4b7a13f9aa8f38e2d115fc2292cf6b1f959cd0)) +* **api:** api update ([2e9f356](https://github.com/hyperspell/python-sdk/commit/2e9f356bd097204a9d89b927768e261e79397b36)) +* **api:** api update ([0f29501](https://github.com/hyperspell/python-sdk/commit/0f2950160b0842b7522f9a7ac3100b003f276cc4)) +* **api:** api update ([add1d76](https://github.com/hyperspell/python-sdk/commit/add1d76538a307e7a1c3fc592207d50351c4c5ca)) +* **api:** api update ([1bfef28](https://github.com/hyperspell/python-sdk/commit/1bfef28fdcd09c6b6cccfb0aa21055b2ad220403)) +* **api:** api update ([9f27d7f](https://github.com/hyperspell/python-sdk/commit/9f27d7f462d15b54cf1aa62e962da1d34a03e616)) +* **api:** api update ([476c23d](https://github.com/hyperspell/python-sdk/commit/476c23d01aae74bc13013d71e32430264d45bab1)) +* **api:** api update ([f7a4696](https://github.com/hyperspell/python-sdk/commit/f7a4696dec30ab24f9d9679aa2108db7eee54eea)) +* **api:** api update ([8cc8137](https://github.com/hyperspell/python-sdk/commit/8cc8137a2d6d7f31ff0b700d5e0785fedeae3548)) +* **api:** api update ([d2f69a5](https://github.com/hyperspell/python-sdk/commit/d2f69a5441b2257818f1dcf7332eac31b4717123)) +* **api:** api update ([508ad7e](https://github.com/hyperspell/python-sdk/commit/508ad7ed7ad9dc387996a63727da6db1f929d22c)) +* **api:** api update ([7c260a4](https://github.com/hyperspell/python-sdk/commit/7c260a44ab0c326018ec50fdda6d87d8e9322ded)) +* **api:** api update ([796beb0](https://github.com/hyperspell/python-sdk/commit/796beb01090fbd33bf769e2917c14e8c9d2b5087)) +* **api:** api update ([1158074](https://github.com/hyperspell/python-sdk/commit/11580746b95550270c9aa0b5a358c26a1dd6888c)) +* **api:** api update ([77b1d4c](https://github.com/hyperspell/python-sdk/commit/77b1d4c16f9f01827d2ef9a886b85c2b2e41829b)) +* **api:** api update ([d2c231b](https://github.com/hyperspell/python-sdk/commit/d2c231b07652d05a03e545078b17da80d425a072)) +* **api:** api update ([ac37961](https://github.com/hyperspell/python-sdk/commit/ac3796155df478f984b59d18b81e0ab8a0b20a36)) +* **api:** api update ([853645f](https://github.com/hyperspell/python-sdk/commit/853645f31184d6be577afe6ef7e872bca5198b3c)) +* **api:** api update ([e6c05cd](https://github.com/hyperspell/python-sdk/commit/e6c05cd496db6e9df09da720bd74e6c2f0f853b7)) +* **api:** api update ([ec5f973](https://github.com/hyperspell/python-sdk/commit/ec5f97338107ae64be0e174dda3ec4dda5903918)) +* **api:** api update ([6b411be](https://github.com/hyperspell/python-sdk/commit/6b411be3d85dbc3106741cfbfa08454ce443b173)) +* **api:** api update ([0789efa](https://github.com/hyperspell/python-sdk/commit/0789efa8c1e2762ce8bf5329a7411dba886709dd)) +* **api:** api update ([e4edf05](https://github.com/hyperspell/python-sdk/commit/e4edf05d2e2700fef1e70250204aee103ac54686)) +* **api:** api update ([7248ff5](https://github.com/hyperspell/python-sdk/commit/7248ff5db8bbc8708f8dfe8afb78d519401ee7f2)) +* **api:** api update ([8316353](https://github.com/hyperspell/python-sdk/commit/83163535a6b7319bd8cc73239d50bcee3d5210bc)) +* **api:** api update ([bdbe8e1](https://github.com/hyperspell/python-sdk/commit/bdbe8e18368b930262871391533f887557942b3a)) +* **api:** api update ([3334f14](https://github.com/hyperspell/python-sdk/commit/3334f14582bda6ec78c9b479317c8d818b1c1227)) +* **api:** api update ([b6ad9f4](https://github.com/hyperspell/python-sdk/commit/b6ad9f43113a8cbf23580027c37ecaf95cb37cb3)) +* **api:** api update ([74e46e9](https://github.com/hyperspell/python-sdk/commit/74e46e9fc6e453ec408fc2641f8e3526df13927e)) +* **api:** api update ([bccb2cc](https://github.com/hyperspell/python-sdk/commit/bccb2cc8cac69ba61476aa224a753b5c88f14eca)) +* **api:** api update ([c05d86e](https://github.com/hyperspell/python-sdk/commit/c05d86eac76104c1a6b312663dd6b973070b51ce)) +* **api:** api update ([b20e5b5](https://github.com/hyperspell/python-sdk/commit/b20e5b5bf8b894faf515d9ca770d757078d265d9)) +* **api:** api update ([68a23b5](https://github.com/hyperspell/python-sdk/commit/68a23b559af192e808a96ec6627e66cd822dc6f3)) +* **api:** api update ([8c94bf0](https://github.com/hyperspell/python-sdk/commit/8c94bf04366d1fb7d20c273f8f3bb0885e909371)) +* **api:** api update ([98ba9ee](https://github.com/hyperspell/python-sdk/commit/98ba9eea46e52fc115349f02fb38b34bf6c0a2a5)) +* **api:** api update ([7f9a7d6](https://github.com/hyperspell/python-sdk/commit/7f9a7d6d36ada54deb77797ca5df94c3aff3b03a)) +* **api:** api update ([00ba4b4](https://github.com/hyperspell/python-sdk/commit/00ba4b401237d149089aa7cef3a5e8b394e86e91)) +* **api:** api update ([cd17269](https://github.com/hyperspell/python-sdk/commit/cd17269808efe9af49416acb84ae6e1eaa4ef1c4)) +* **api:** api update ([78195d4](https://github.com/hyperspell/python-sdk/commit/78195d43929013ad14e6a079b2c63c2f90fb8377)) +* **api:** api update ([#25](https://github.com/hyperspell/python-sdk/issues/25)) ([26170a5](https://github.com/hyperspell/python-sdk/commit/26170a5f86b9ed0dcbdd6cc01708a3a1a8a161b7)) +* **api:** api update ([#28](https://github.com/hyperspell/python-sdk/issues/28)) ([72667ce](https://github.com/hyperspell/python-sdk/commit/72667cec5a0c172460551b0cce48aa667e88b99a)) +* **api:** api update ([#29](https://github.com/hyperspell/python-sdk/issues/29)) ([e2312ba](https://github.com/hyperspell/python-sdk/commit/e2312bac25802f12f99f762d1e8e0cd7693dcf23)) +* **api:** api update ([#30](https://github.com/hyperspell/python-sdk/issues/30)) ([08bae2f](https://github.com/hyperspell/python-sdk/commit/08bae2f240c913ffae8a6594877f4c78789f20f0)) +* **api:** api update ([#31](https://github.com/hyperspell/python-sdk/issues/31)) ([a245e70](https://github.com/hyperspell/python-sdk/commit/a245e70aea6c76a5bdf45685ccb02edf271ab25b)) +* **api:** api update ([#38](https://github.com/hyperspell/python-sdk/issues/38)) ([fd5a6d5](https://github.com/hyperspell/python-sdk/commit/fd5a6d5ba2b090d5cea1e70bf73d1674209c5907)) +* **api:** api update ([#39](https://github.com/hyperspell/python-sdk/issues/39)) ([5aaf7cd](https://github.com/hyperspell/python-sdk/commit/5aaf7cd7208f1fef5edfeab8324ad6e977fae517)) +* **api:** api update ([#43](https://github.com/hyperspell/python-sdk/issues/43)) ([7c8ccc6](https://github.com/hyperspell/python-sdk/commit/7c8ccc641b0f75f99dbd7a2992c15e03a39143c9)) +* **api:** api update ([#44](https://github.com/hyperspell/python-sdk/issues/44)) ([693304c](https://github.com/hyperspell/python-sdk/commit/693304cef80f58fbda0eb78368a2047830f77c50)) +* **api:** api update ([#48](https://github.com/hyperspell/python-sdk/issues/48)) ([5a8674d](https://github.com/hyperspell/python-sdk/commit/5a8674d60ac79e1a0e2784bd63aafa2a59727357)) +* **api:** api update ([#49](https://github.com/hyperspell/python-sdk/issues/49)) ([2c1476c](https://github.com/hyperspell/python-sdk/commit/2c1476cdb81b093fa1729b830822be93f3709527)) +* **api:** api update ([#71](https://github.com/hyperspell/python-sdk/issues/71)) ([5e4a65e](https://github.com/hyperspell/python-sdk/commit/5e4a65e73caf6914b2aa6a847709fb6b490af0f1)) +* **api:** api update ([#77](https://github.com/hyperspell/python-sdk/issues/77)) ([5df0fc9](https://github.com/hyperspell/python-sdk/commit/5df0fc974b9990b3f00aec8e41822d418f0410ed)) +* **api:** api update ([#79](https://github.com/hyperspell/python-sdk/issues/79)) ([4bbaa8b](https://github.com/hyperspell/python-sdk/commit/4bbaa8b5ee05ad8794f838cbba09244639598f1f)) +* **api:** api update ([#81](https://github.com/hyperspell/python-sdk/issues/81)) ([816ced9](https://github.com/hyperspell/python-sdk/commit/816ced9a28f9f7d29488c54916f5166c53905a7b)) +* **api:** api update ([#82](https://github.com/hyperspell/python-sdk/issues/82)) ([2a12261](https://github.com/hyperspell/python-sdk/commit/2a12261f52ef6c38863f54c46007b31cb888b45e)) +* **api:** api update ([#83](https://github.com/hyperspell/python-sdk/issues/83)) ([e349d69](https://github.com/hyperspell/python-sdk/commit/e349d6919cf8bc3276b5da7e8aa3cfa8d4e23a67)) +* **api:** api update ([#86](https://github.com/hyperspell/python-sdk/issues/86)) ([9cfa06b](https://github.com/hyperspell/python-sdk/commit/9cfa06b7c4bfab15f9b2e973b767dc02c9961877)) +* **api:** update via SDK Studio ([d801e8a](https://github.com/hyperspell/python-sdk/commit/d801e8ac08a4816c6139057868c567cd9992badc)) +* **api:** update via SDK Studio ([18945ea](https://github.com/hyperspell/python-sdk/commit/18945ea3354e140c6d150fb0d8e2238a33113c5e)) +* **api:** update via SDK Studio ([b005609](https://github.com/hyperspell/python-sdk/commit/b005609bbfd778bf2bbb8eba1c22fae89f75441a)) +* **api:** update via SDK Studio ([49e68c8](https://github.com/hyperspell/python-sdk/commit/49e68c866483f9be8900eef7fc3e776e43cd74b1)) +* **api:** update via SDK Studio ([634025a](https://github.com/hyperspell/python-sdk/commit/634025ac77ffe7b2691e53800ee0915dae55e486)) +* **api:** update via SDK Studio ([1f502f0](https://github.com/hyperspell/python-sdk/commit/1f502f0278a7c35e76cbdd8b18b0bb3ab8f69287)) +* **api:** update via SDK Studio ([df1dc5d](https://github.com/hyperspell/python-sdk/commit/df1dc5d547313a241604e554cf515d904ad196a6)) +* **api:** update via SDK Studio ([adcbd19](https://github.com/hyperspell/python-sdk/commit/adcbd194629860d4af7c85720938dd26dd47e026)) +* **api:** update via SDK Studio ([4929e75](https://github.com/hyperspell/python-sdk/commit/4929e750336a8d43d9d8d54dc7d1d44f58d12071)) +* **api:** update via SDK Studio ([743c857](https://github.com/hyperspell/python-sdk/commit/743c85738f9beeb8f493d3bf88c7db53184eab1c)) +* **api:** update via SDK Studio ([b6dd141](https://github.com/hyperspell/python-sdk/commit/b6dd141ce233e2835fa1b3dd9ffd0a582cc39db1)) +* **api:** update via SDK Studio ([4161ff3](https://github.com/hyperspell/python-sdk/commit/4161ff335fa76ce6ed7ca86f9aec446ebe71b227)) +* **api:** update via SDK Studio ([e7a6bd1](https://github.com/hyperspell/python-sdk/commit/e7a6bd18157bfaa267da257f3248da9173bf83f6)) +* **api:** update via SDK Studio ([5d3bc9c](https://github.com/hyperspell/python-sdk/commit/5d3bc9c68523ff572bb27e8d77e24a2819f6e6be)) +* **api:** update via SDK Studio ([37def01](https://github.com/hyperspell/python-sdk/commit/37def01e5290efee8228c0e81f6ef2c9e7fb2b0b)) +* **api:** update via SDK Studio ([fd10b3b](https://github.com/hyperspell/python-sdk/commit/fd10b3b4b26774c5fcd033481712fda2cb77cc80)) +* **api:** update via SDK Studio ([a92de5a](https://github.com/hyperspell/python-sdk/commit/a92de5a8dbc7c6b516b58d159840657c356cf423)) +* **api:** update via SDK Studio ([20bf1bb](https://github.com/hyperspell/python-sdk/commit/20bf1bbf36b4b5aa984cd6f405eb98fb6a743dba)) +* **api:** update via SDK Studio ([21036b0](https://github.com/hyperspell/python-sdk/commit/21036b0a3b626fa41925b58b24616484158b9361)) +* **api:** update via SDK Studio ([bf294db](https://github.com/hyperspell/python-sdk/commit/bf294db204ddb25338ab2370d78d6c378c78686a)) +* **api:** update via SDK Studio ([3e2a9c8](https://github.com/hyperspell/python-sdk/commit/3e2a9c86135e8d972cebf8a6e79a1d07c44efc1b)) +* **api:** update via SDK Studio ([0e3d89e](https://github.com/hyperspell/python-sdk/commit/0e3d89ee7008ce4462f5370917c9f784d275c390)) +* **api:** update via SDK Studio ([bff74c9](https://github.com/hyperspell/python-sdk/commit/bff74c98b5b08e45e291381753340a22c6b04c89)) +* **api:** update via SDK Studio ([5512870](https://github.com/hyperspell/python-sdk/commit/55128707104ac90ebcefe72795161d98c1790e6c)) +* **api:** update via SDK Studio ([f82c2b5](https://github.com/hyperspell/python-sdk/commit/f82c2b5e708cd5c3cd5d62b451b52e6916afa23c)) +* **api:** update via SDK Studio ([c7b0af6](https://github.com/hyperspell/python-sdk/commit/c7b0af61e07cbef440241ec4ba74c23d3445593b)) +* **api:** update via SDK Studio ([4277aee](https://github.com/hyperspell/python-sdk/commit/4277aee6c04653c5c822480e4af7188de64235d0)) +* **api:** update via SDK Studio ([#32](https://github.com/hyperspell/python-sdk/issues/32)) ([f8f7ad1](https://github.com/hyperspell/python-sdk/commit/f8f7ad136e37e084d5f3b8379d8e58bb04b85f2b)) +* **api:** update via SDK Studio ([#33](https://github.com/hyperspell/python-sdk/issues/33)) ([d8aad38](https://github.com/hyperspell/python-sdk/commit/d8aad387e9a44b98f8fb1e2a0564e400203649d7)) +* **api:** update via SDK Studio ([#41](https://github.com/hyperspell/python-sdk/issues/41)) ([2aaad04](https://github.com/hyperspell/python-sdk/commit/2aaad04fee563cf795dd0dbbc9d15b2ee0bbac65)) +* **api:** update via SDK Studio ([#67](https://github.com/hyperspell/python-sdk/issues/67)) ([52566fe](https://github.com/hyperspell/python-sdk/commit/52566fe8f84f526eb78a5949b68de52bf0414cd4)) +* **api:** update via SDK Studio ([#68](https://github.com/hyperspell/python-sdk/issues/68)) ([3014583](https://github.com/hyperspell/python-sdk/commit/3014583dd53a24950206dc0b2ef7fb3be53fbf55)) +* **api:** update via SDK Studio ([#69](https://github.com/hyperspell/python-sdk/issues/69)) ([01cdba5](https://github.com/hyperspell/python-sdk/commit/01cdba5e514ddefc6f0aba9bcff2c8954a3b10e5)) +* **api:** update via SDK Studio ([#70](https://github.com/hyperspell/python-sdk/issues/70)) ([f5871a8](https://github.com/hyperspell/python-sdk/commit/f5871a8f77a3839d90ce67bedcf9336caafb227b)) +* **api:** update via SDK Studio ([#72](https://github.com/hyperspell/python-sdk/issues/72)) ([3551d71](https://github.com/hyperspell/python-sdk/commit/3551d711e30daaeac10f0935194ba97a30eecf87)) +* clean up environment call outs ([e99844e](https://github.com/hyperspell/python-sdk/commit/e99844ee29928beeed51cd47d53e3ababe33e608)) +* **client:** add follow_redirects request option ([6402278](https://github.com/hyperspell/python-sdk/commit/6402278b75ad1ebc68d15a2d56b3f630c8139633)) +* **client:** add support for aiohttp ([c0845dc](https://github.com/hyperspell/python-sdk/commit/c0845dc8133eb74e72f18651e9da53102609d833)) +* **client:** allow passing `NotGiven` for body ([#53](https://github.com/hyperspell/python-sdk/issues/53)) ([25f5f65](https://github.com/hyperspell/python-sdk/commit/25f5f65fe53fc426f3901ff5c0dabf77be7b0bdc)) +* **client:** send `X-Stainless-Read-Timeout` header ([#45](https://github.com/hyperspell/python-sdk/issues/45)) ([314ac6f](https://github.com/hyperspell/python-sdk/commit/314ac6fbf8b7dbd4b3eb9d5293c4bdf6d21b4f36)) +* **client:** support file upload requests ([98a9c26](https://github.com/hyperspell/python-sdk/commit/98a9c26c10636926fb05844b3494707e5d64babf)) +* improve future compat with pydantic v3 ([ebc041e](https://github.com/hyperspell/python-sdk/commit/ebc041e9c7389c11d5f2049232fa84b1b4188668)) +* **types:** replace List[str] with SequenceNotStr in params ([3682734](https://github.com/hyperspell/python-sdk/commit/3682734864bd6767b30a2a57c85a49df45fcdcfe)) + + +### Bug Fixes + +* asyncify on non-asyncio runtimes ([#51](https://github.com/hyperspell/python-sdk/issues/51)) ([9a1d74d](https://github.com/hyperspell/python-sdk/commit/9a1d74da8a683ac1ae3474d298df21e097581a8d)) +* avoid newer type syntax ([7658b38](https://github.com/hyperspell/python-sdk/commit/7658b3838b534fe2a3d65c18da254eef6436e736)) +* **ci:** correct conditional ([980b910](https://github.com/hyperspell/python-sdk/commit/980b910eaa78cf84de10c0521e4ed2f142689ae0)) +* **ci:** ensure pip is always available ([#65](https://github.com/hyperspell/python-sdk/issues/65)) ([fc830b0](https://github.com/hyperspell/python-sdk/commit/fc830b067dfc5e4408c772ac2275ad34aa503f97)) +* **ci:** release-doctor — report correct token name ([6ddb78b](https://github.com/hyperspell/python-sdk/commit/6ddb78b355f8e36a85fcfaf1592618bae5c67473)) +* **ci:** remove publishing patch ([#66](https://github.com/hyperspell/python-sdk/issues/66)) ([ca14208](https://github.com/hyperspell/python-sdk/commit/ca142083e62f5214f3b6fdd21a32c233a6d10ced)) +* **client:** close streams without requiring full consumption ([669e4cf](https://github.com/hyperspell/python-sdk/commit/669e4cf750158df6aa381083911c051a6afb8f07)) +* **client:** correctly parse binary response | stream ([5304250](https://github.com/hyperspell/python-sdk/commit/53042509a6ee129e470ff4e57ce6ba072b294cce)) +* **client:** don't send Content-Type header on GET requests ([f7a04b5](https://github.com/hyperspell/python-sdk/commit/f7a04b5a47aa9a6fc338498a34db4074824c198e)) +* **client:** mark some request bodies as optional ([25f5f65](https://github.com/hyperspell/python-sdk/commit/25f5f65fe53fc426f3901ff5c0dabf77be7b0bdc)) +* compat with Python 3.14 ([53fdd97](https://github.com/hyperspell/python-sdk/commit/53fdd97e8631bf9093c775de401b0f1fd8965efe)) +* **compat:** compat with `pydantic<2.8.0` when using additional fields ([d792335](https://github.com/hyperspell/python-sdk/commit/d79233578d0271e5de5b16043341565a8224bcf6)) +* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([6ed583e](https://github.com/hyperspell/python-sdk/commit/6ed583ec067269fb1c27c8dcce9167795a1abd17)) +* ensure streams are always closed ([c676043](https://github.com/hyperspell/python-sdk/commit/c6760434add9e200c865154a08d0289d556b70a8)) +* **package:** support direct resource imports ([d8b54e0](https://github.com/hyperspell/python-sdk/commit/d8b54e020764be85d1fd2de167deb1e825e6aceb)) +* **parsing:** correctly handle nested discriminated unions ([f4e309d](https://github.com/hyperspell/python-sdk/commit/f4e309d6a8d85f5aa0cb3fee3e41bf9c6487b5b1)) +* **parsing:** ignore empty metadata ([01e34f8](https://github.com/hyperspell/python-sdk/commit/01e34f8e8697e5380884a0d93dd6b2d248f578d0)) +* **parsing:** parse extra field types ([167331c](https://github.com/hyperspell/python-sdk/commit/167331c90f0001fa4165d2cafa185c6017383dad)) +* **perf:** optimize some hot paths ([5d2b562](https://github.com/hyperspell/python-sdk/commit/5d2b5623fa87e6839df8e9a76662c3461be9b19c)) +* **perf:** skip traversing types for NotGiven values ([8509e29](https://github.com/hyperspell/python-sdk/commit/8509e297c4e2e480a8f1f9ede0429fa94dc3f97d)) +* **pydantic v1:** more robust ModelField.annotation check ([0e19885](https://github.com/hyperspell/python-sdk/commit/0e19885e7e31d9ce9cb0499995d44898111701b5)) +* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([8121bc2](https://github.com/hyperspell/python-sdk/commit/8121bc2f5c651cdd51ec83bdd55ae72685f53be7)) +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([9c7824f](https://github.com/hyperspell/python-sdk/commit/9c7824f603cd5b1935ee1aac676e3fcf299d51f6)) +* **types:** handle more discriminated union shapes ([#64](https://github.com/hyperspell/python-sdk/issues/64)) ([ea3ea28](https://github.com/hyperspell/python-sdk/commit/ea3ea28c4fca79d43f3372824dffdf5603d51f27)) + + +### Chores + +* add missing docstrings ([16f09b6](https://github.com/hyperspell/python-sdk/commit/16f09b68057a3be4b878f32980d7d07fefbc7cb9)) +* add Python 3.14 classifier and testing ([75b429e](https://github.com/hyperspell/python-sdk/commit/75b429e1dc942a6595024682d7bf9d7b22cad632)) +* broadly detect json family of content-type headers ([e03af44](https://github.com/hyperspell/python-sdk/commit/e03af4450a09bd2c8d7f6f63881c1f919c512270)) +* bump `httpx-aiohttp` version to 0.1.9 ([802a6ee](https://github.com/hyperspell/python-sdk/commit/802a6ee6c0b67bddd725727078fc9c3ce2650b69)) +* **ci:** add timeout thresholds for CI jobs ([0a03092](https://github.com/hyperspell/python-sdk/commit/0a0309297b8954f728d9877d4dbec0fd14e9e5bb)) +* **ci:** change upload type ([c01d519](https://github.com/hyperspell/python-sdk/commit/c01d519131a2c4620c9454c4e634c2e39053b00c)) +* **ci:** enable for pull requests ([be36a2d](https://github.com/hyperspell/python-sdk/commit/be36a2d8699cc44db332a126f7de25b7ba422a94)) +* **ci:** fix installation instructions ([3567715](https://github.com/hyperspell/python-sdk/commit/3567715ff2540fa63cc0feed569a98d42af731a6)) +* **ci:** only run for pushes and fork pull requests ([991d685](https://github.com/hyperspell/python-sdk/commit/991d6859286e86aa022eb83aab8ecc6e337798f4)) +* **ci:** only use depot for staging repos ([f8b4a37](https://github.com/hyperspell/python-sdk/commit/f8b4a37b034140150bcf7fae13bcfb15a5ec1fb8)) +* **ci:** upload sdks to package manager ([733ed75](https://github.com/hyperspell/python-sdk/commit/733ed759b06612d5da69c9fd241240c951ef1964)) +* **client:** minor internal fixes ([c1c047d](https://github.com/hyperspell/python-sdk/commit/c1c047de9b2b73f884a6d9a41ec00e0bd9362bf7)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([223b7fc](https://github.com/hyperspell/python-sdk/commit/223b7fcd14499af7a908d7ddb9cbe83e44656737)) +* do not install brew dependencies in ./scripts/bootstrap by default ([d9de5e4](https://github.com/hyperspell/python-sdk/commit/d9de5e46c7d49ed75cf7bb9ddc5451ed00576260)) +* **docs:** grammar improvements ([5e2a523](https://github.com/hyperspell/python-sdk/commit/5e2a523d1c080c7254e9b2f0e3bc112c0bbfbe09)) +* **docs:** remove reference to rye shell ([14db0da](https://github.com/hyperspell/python-sdk/commit/14db0dac660c359e5740e04b0aebb72578cb2577)) +* **docs:** remove unnecessary param examples ([00bf3e4](https://github.com/hyperspell/python-sdk/commit/00bf3e468bf63ae069648cdcb45b897a6d2f0179)) +* **docs:** update client docstring ([#57](https://github.com/hyperspell/python-sdk/issues/57)) ([b93eac9](https://github.com/hyperspell/python-sdk/commit/b93eac92c1aa75241baaeba8979ec9603a538193)) +* **docs:** use environment variables for authentication in code snippets ([0e42e5d](https://github.com/hyperspell/python-sdk/commit/0e42e5d97de61b3224eeaac980df5efc35a9336e)) +* **internal/tests:** avoid race condition with implicit client cleanup ([01d946a](https://github.com/hyperspell/python-sdk/commit/01d946a29b5dbfd37f2f7a7c93f6824c5865af1b)) +* **internal:** add Sequence related utils ([9cbe921](https://github.com/hyperspell/python-sdk/commit/9cbe921b91aacb926a8b5020ed935b9c5ea3773d)) +* **internal:** avoid errors for isinstance checks on proxies ([c86a164](https://github.com/hyperspell/python-sdk/commit/c86a164ba1bdecfc7db3c4d12c9753d8c99ec232)) +* **internal:** base client updates ([70b2439](https://github.com/hyperspell/python-sdk/commit/70b2439ad669934605653b780d1b2b9ca6fbd0c6)) +* **internal:** bummp ruff dependency ([#37](https://github.com/hyperspell/python-sdk/issues/37)) ([cef604a](https://github.com/hyperspell/python-sdk/commit/cef604afecf30df7c584bb70ce4fa61ace9d4742)) +* **internal:** bump pinned h11 dep ([1ce5781](https://github.com/hyperspell/python-sdk/commit/1ce57814e1d392b0c6a51b75c1dd92550f9399c3)) +* **internal:** bump pyright version ([6730ab4](https://github.com/hyperspell/python-sdk/commit/6730ab4c5f500720ddb5d6500260cbe9e4cf0375)) +* **internal:** bump rye to 0.44.0 ([#63](https://github.com/hyperspell/python-sdk/issues/63)) ([d0d34fc](https://github.com/hyperspell/python-sdk/commit/d0d34fc3b73469284cdc43bc61bbee53906acb1d)) +* **internal:** change ci workflow machines ([c9d8d8d](https://github.com/hyperspell/python-sdk/commit/c9d8d8d6b2d49b53307ed4a99042b01cdc44e089)) +* **internal:** change default timeout to an int ([#35](https://github.com/hyperspell/python-sdk/issues/35)) ([f192b6f](https://github.com/hyperspell/python-sdk/commit/f192b6fdf340bfeb9e1853c752df0244841ab8c9)) +* **internal:** codegen related update ([f7cd6c7](https://github.com/hyperspell/python-sdk/commit/f7cd6c7b1feafef059ecdf6be0bb9adbd5f28929)) +* **internal:** codegen related update ([059575d](https://github.com/hyperspell/python-sdk/commit/059575d505a4e37bcee381422913786e98730cc0)) +* **internal:** codegen related update ([#26](https://github.com/hyperspell/python-sdk/issues/26)) ([f6008b9](https://github.com/hyperspell/python-sdk/commit/f6008b93caaecd5b28e50c84dc908d820a0f222b)) +* **internal:** codegen related update ([#52](https://github.com/hyperspell/python-sdk/issues/52)) ([1663641](https://github.com/hyperspell/python-sdk/commit/166364110507a27382de3ed086da802448a40420)) +* **internal:** codegen related update ([#62](https://github.com/hyperspell/python-sdk/issues/62)) ([7d8fa4f](https://github.com/hyperspell/python-sdk/commit/7d8fa4f7989e99c2da10e7119d1f0410d38362db)) +* **internal:** detect missing future annotations with ruff ([210e641](https://github.com/hyperspell/python-sdk/commit/210e641ade71c871f0f80f1c0a0cc043169be302)) +* **internal:** expand CI branch coverage ([f1427b7](https://github.com/hyperspell/python-sdk/commit/f1427b73328af89415877c97b15d65ba86fa8ca4)) +* **internal:** fix devcontainers setup ([#54](https://github.com/hyperspell/python-sdk/issues/54)) ([6b255f1](https://github.com/hyperspell/python-sdk/commit/6b255f161ecc1c9113b829327fe162167bf62b9b)) +* **internal:** fix list file params ([29a6f87](https://github.com/hyperspell/python-sdk/commit/29a6f87ea8686a4cd0412ae712818804d704c18d)) +* **internal:** fix ruff target version ([9454556](https://github.com/hyperspell/python-sdk/commit/945455659b4896b89be368476adeb8c062e8d520)) +* **internal:** fix type traversing dictionary params ([#46](https://github.com/hyperspell/python-sdk/issues/46)) ([3b755e0](https://github.com/hyperspell/python-sdk/commit/3b755e0e12f723232830aa9398f61b8d55da5735)) +* **internal:** grammar fix (it's -> its) ([516dd5e](https://github.com/hyperspell/python-sdk/commit/516dd5e4f13fcffa9593e58f7a4c8bf855968ae0)) +* **internal:** import reformatting ([220525f](https://github.com/hyperspell/python-sdk/commit/220525fbfa4af4d0773a723c2c0dd53c05daf790)) +* **internal:** minor formatting changes ([1f27a6e](https://github.com/hyperspell/python-sdk/commit/1f27a6e74e0f8f25f5944fcdddfcd1fe620255bb)) +* **internal:** minor formatting changes ([#27](https://github.com/hyperspell/python-sdk/issues/27)) ([b58a9f0](https://github.com/hyperspell/python-sdk/commit/b58a9f01edc5f9918f7a29fa81f1a8a1ae93bdfa)) +* **internal:** minor type handling changes ([#47](https://github.com/hyperspell/python-sdk/issues/47)) ([de1503e](https://github.com/hyperspell/python-sdk/commit/de1503e4e5feabe6267187654467ced1f171ff57)) +* **internal:** move mypy configurations to `pyproject.toml` file ([116ded2](https://github.com/hyperspell/python-sdk/commit/116ded251332fdfa7366f5b0beb98f1c76aac4d2)) +* **internal:** properly set __pydantic_private__ ([#55](https://github.com/hyperspell/python-sdk/issues/55)) ([412ccce](https://github.com/hyperspell/python-sdk/commit/412ccce91dc434650d88bc4c41f096c06132f1de)) +* **internal:** reduce CI branch coverage ([31cead5](https://github.com/hyperspell/python-sdk/commit/31cead5ba3df9609967a8f8f3f579b4c856fe649)) +* **internal:** refactor retries to not use recursion ([491a541](https://github.com/hyperspell/python-sdk/commit/491a541b6285df23e3de492fb3e1cf24f2b4db37)) +* **internal:** remove extra empty newlines ([#61](https://github.com/hyperspell/python-sdk/issues/61)) ([b299f2e](https://github.com/hyperspell/python-sdk/commit/b299f2e25d537d7baf139579d11826e8fdbf655d)) +* **internal:** remove trailing character ([#80](https://github.com/hyperspell/python-sdk/issues/80)) ([f28f2b7](https://github.com/hyperspell/python-sdk/commit/f28f2b705e253c8cb73b67eab20ed9e5c52a8f5d)) +* **internal:** remove unused http client options forwarding ([#58](https://github.com/hyperspell/python-sdk/issues/58)) ([da92b87](https://github.com/hyperspell/python-sdk/commit/da92b87db946431698648460c2fa71ffaffe3437)) +* **internal:** slight transform perf improvement ([#84](https://github.com/hyperspell/python-sdk/issues/84)) ([1a6703c](https://github.com/hyperspell/python-sdk/commit/1a6703c8d4f3fe6dd8fc2111c2e3cfd0ade27377)) +* **internal:** update client tests ([#50](https://github.com/hyperspell/python-sdk/issues/50)) ([f31aeaf](https://github.com/hyperspell/python-sdk/commit/f31aeaf9eaecb541fbc092b5997518efbc8a34e9)) +* **internal:** update comment in script ([3f74f9d](https://github.com/hyperspell/python-sdk/commit/3f74f9ded72572e20d6839d14c34713d75c83d4c)) +* **internal:** update conftest.py ([0564fee](https://github.com/hyperspell/python-sdk/commit/0564fee480c8d731cf678a706bdbb2c8089436ef)) +* **internal:** update models test ([757a2dd](https://github.com/hyperspell/python-sdk/commit/757a2dd42bbadf9a94d28156dcffc3a4b6ad669b)) +* **internal:** update pydantic dependency ([a83362d](https://github.com/hyperspell/python-sdk/commit/a83362dc7319cfb8837d99efda10025857b21347)) +* **internal:** update pyright exclude list ([ccfaa5f](https://github.com/hyperspell/python-sdk/commit/ccfaa5f283c0f2cd5966fd1996ae65afa49bef0b)) +* **internal:** update pyright settings ([442555c](https://github.com/hyperspell/python-sdk/commit/442555c5f3430e17a42dd3363359810172858e1c)) +* **package:** drop Python 3.8 support ([4d8d0a5](https://github.com/hyperspell/python-sdk/commit/4d8d0a501af22b0d5321e34e1d6c368dec622d34)) +* **package:** mark python 3.13 as supported ([b04d1e6](https://github.com/hyperspell/python-sdk/commit/b04d1e6c7d2dbd8852963ee8f08596ed332e04ec)) +* **project:** add settings file for vscode ([f597f95](https://github.com/hyperspell/python-sdk/commit/f597f9542a2572674dfc0a97fd94950cee114edf)) +* **readme:** fix version rendering on pypi ([a109225](https://github.com/hyperspell/python-sdk/commit/a1092259c98715d17ce95259420baf3c3d325db8)) +* **readme:** update badges ([c2c73f5](https://github.com/hyperspell/python-sdk/commit/c2c73f56601e3bfde70479cf74cc4f6c2ac2818b)) +* slight wording improvement in README ([#85](https://github.com/hyperspell/python-sdk/issues/85)) ([4597f85](https://github.com/hyperspell/python-sdk/commit/4597f85a79b9c4f8b3f1f05744c163aa0c837b73)) +* **tests:** add tests for httpx client instantiation & proxies ([366c38b](https://github.com/hyperspell/python-sdk/commit/366c38b0ef2e11c95a301fca736a52d11a9992dd)) +* **tests:** run tests in parallel ([b9ca684](https://github.com/hyperspell/python-sdk/commit/b9ca68436f382e30316174bfb0007612246e1bf7)) +* **tests:** simplify `get_platform` test ([7364d6f](https://github.com/hyperspell/python-sdk/commit/7364d6f85d7849ac24377552f31a9d7b4d622565)) +* **tests:** skip some failing tests on the latest python versions ([9eebf62](https://github.com/hyperspell/python-sdk/commit/9eebf628b254b4f463ea7b899dcef53af5362228)) +* **types:** change optional parameter type from NotGiven to Omit ([59fe8c6](https://github.com/hyperspell/python-sdk/commit/59fe8c67a542f707d1867b8786baafbc018c7de2)) +* update @stainless-api/prism-cli to v5.15.0 ([37e8a3f](https://github.com/hyperspell/python-sdk/commit/37e8a3f52aff75d78adc6ba7a0a51107cc9e0fe1)) +* update github action ([c2227bb](https://github.com/hyperspell/python-sdk/commit/c2227bbbca9210c1156bd219d6eea4c9d8a56376)) +* update lockfile ([9170730](https://github.com/hyperspell/python-sdk/commit/9170730ae0dd8259dcd9b5814b76e6a79247b237)) +* update SDK settings ([#74](https://github.com/hyperspell/python-sdk/issues/74)) ([2097566](https://github.com/hyperspell/python-sdk/commit/2097566f6ebaa15a5ab11191d3131f79aa2ae0fb)) + + +### Documentation + +* **client:** fix httpx.Timeout documentation reference ([741b8eb](https://github.com/hyperspell/python-sdk/commit/741b8eb3a70340950e3e53dc471e5e903b4ffff8)) +* remove private imports from datetime snippets ([25eb634](https://github.com/hyperspell/python-sdk/commit/25eb634de104e2acb93104bcfdea1caf7344f627)) +* revise readme docs about nested params ([#59](https://github.com/hyperspell/python-sdk/issues/59)) ([26a8c1e](https://github.com/hyperspell/python-sdk/commit/26a8c1e11b1d4286dbc627db63c064dc05e901f3)) +* update URLs from stainlessapi.com to stainless.com ([#56](https://github.com/hyperspell/python-sdk/issues/56)) ([fb40ed8](https://github.com/hyperspell/python-sdk/commit/fb40ed87bdd21583e133307eb6c158d55e49b432)) + ## 0.27.0 (2025-12-12) Full Changelog: [v0.26.0...v0.27.0](https://github.com/hyperspell/python-sdk/compare/v0.26.0...v0.27.0) diff --git a/api.md b/api.md index 0452def..8cfcaed 100644 --- a/api.md +++ b/api.md @@ -70,6 +70,7 @@ from hyperspell.types import Memory, MemoryStatus, MemoryDeleteResponse, MemoryS Methods: +- client.memories.update(resource_id, \*, source, \*\*params) -> MemoryStatus - client.memories.list(\*\*params) -> SyncCursorPage[Memory] - client.memories.delete(resource_id, \*, source) -> MemoryDeleteResponse - client.memories.add(\*\*params) -> MemoryStatus diff --git a/pyproject.toml b/pyproject.toml index 1dd7a71..87fff54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hyperspell" -version = "0.27.0" +version = "0.28.0" description = "The official Python library for the hyperspell API" dynamic = ["readme"] license = "MIT" diff --git a/src/hyperspell/_version.py b/src/hyperspell/_version.py index 5d030cd..1223a2c 100644 --- a/src/hyperspell/_version.py +++ b/src/hyperspell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "hyperspell" -__version__ = "0.27.0" # x-release-please-version +__version__ = "0.28.0" # x-release-please-version diff --git a/src/hyperspell/resources/memories.py b/src/hyperspell/resources/memories.py index 628e868..5d558e2 100644 --- a/src/hyperspell/resources/memories.py +++ b/src/hyperspell/resources/memories.py @@ -8,7 +8,13 @@ import httpx -from ..types import memory_add_params, memory_list_params, memory_search_params, memory_upload_params +from ..types import ( + memory_add_params, + memory_list_params, + memory_search_params, + memory_update_params, + memory_upload_params, +) from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from .._compat import cached_property @@ -50,11 +56,123 @@ def with_streaming_response(self) -> MemoriesResourceWithStreamingResponse: """ return MemoriesResourceWithStreamingResponse(self) + def update( + self, + resource_id: str, + *, + source: Literal[ + "collections", + "vault", + "web_crawler", + "notion", + "slack", + "google_calendar", + "reddit", + "box", + "google_drive", + "airtable", + "algolia", + "amplitude", + "asana", + "ashby", + "bamboohr", + "basecamp", + "bubbles", + "calendly", + "confluence", + "clickup", + "datadog", + "deel", + "discord", + "dropbox", + "exa", + "facebook", + "front", + "github", + "gitlab", + "google_docs", + "google_mail", + "google_sheet", + "hubspot", + "jira", + "linear", + "microsoft_teams", + "mixpanel", + "monday", + "outlook", + "perplexity", + "rippling", + "salesforce", + "segment", + "todoist", + "twitter", + "zoom", + ], + collection: Union[str, object, None] | Omit = omit, + metadata: Union[Dict[str, Union[str, float, bool]], object, None] | Omit = omit, + text: Union[str, object, None] | Omit = omit, + title: Union[str, object, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MemoryStatus: + """Updates an existing document in the index. + + You can update the text, collection, + title, and metadata. The document must already exist or a 404 will be returned. + This works for documents from any source (vault, slack, gmail, etc.). + + To remove a collection, set it to null explicitly. + + Args: + collection: The collection to move the document to. Set to null to remove the collection. + + metadata: Custom metadata for filtering. Keys must be alphanumeric with underscores, max + 64 chars. Values must be string, number, or boolean. Will be merged with + existing metadata. + + text: Full text of the document. If provided, the document will be re-indexed. + + title: Title of the document. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not source: + raise ValueError(f"Expected a non-empty value for `source` but received {source!r}") + if not resource_id: + raise ValueError(f"Expected a non-empty value for `resource_id` but received {resource_id!r}") + return self._post( + f"/memories/update/{source}/{resource_id}", + body=maybe_transform( + { + "collection": collection, + "metadata": metadata, + "text": text, + "title": title, + }, + memory_update_params.MemoryUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MemoryStatus, + ) + def list( self, *, collection: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + filter: Optional[str] | Omit = omit, size: int | Omit = omit, source: Optional[ Literal[ @@ -122,6 +240,10 @@ def list( Args: collection: Filter documents by collection. + filter: + Filter documents by metadata using MongoDB-style operators. Example: + {"department": "engineering", "priority": {"$gt": 3}} + source: Filter documents by source. extra_headers: Send extra headers @@ -144,6 +266,7 @@ def list( { "collection": collection, "cursor": cursor, + "filter": filter, "size": size, "source": source, }, @@ -606,11 +729,123 @@ def with_streaming_response(self) -> AsyncMemoriesResourceWithStreamingResponse: """ return AsyncMemoriesResourceWithStreamingResponse(self) + async def update( + self, + resource_id: str, + *, + source: Literal[ + "collections", + "vault", + "web_crawler", + "notion", + "slack", + "google_calendar", + "reddit", + "box", + "google_drive", + "airtable", + "algolia", + "amplitude", + "asana", + "ashby", + "bamboohr", + "basecamp", + "bubbles", + "calendly", + "confluence", + "clickup", + "datadog", + "deel", + "discord", + "dropbox", + "exa", + "facebook", + "front", + "github", + "gitlab", + "google_docs", + "google_mail", + "google_sheet", + "hubspot", + "jira", + "linear", + "microsoft_teams", + "mixpanel", + "monday", + "outlook", + "perplexity", + "rippling", + "salesforce", + "segment", + "todoist", + "twitter", + "zoom", + ], + collection: Union[str, object, None] | Omit = omit, + metadata: Union[Dict[str, Union[str, float, bool]], object, None] | Omit = omit, + text: Union[str, object, None] | Omit = omit, + title: Union[str, object, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MemoryStatus: + """Updates an existing document in the index. + + You can update the text, collection, + title, and metadata. The document must already exist or a 404 will be returned. + This works for documents from any source (vault, slack, gmail, etc.). + + To remove a collection, set it to null explicitly. + + Args: + collection: The collection to move the document to. Set to null to remove the collection. + + metadata: Custom metadata for filtering. Keys must be alphanumeric with underscores, max + 64 chars. Values must be string, number, or boolean. Will be merged with + existing metadata. + + text: Full text of the document. If provided, the document will be re-indexed. + + title: Title of the document. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not source: + raise ValueError(f"Expected a non-empty value for `source` but received {source!r}") + if not resource_id: + raise ValueError(f"Expected a non-empty value for `resource_id` but received {resource_id!r}") + return await self._post( + f"/memories/update/{source}/{resource_id}", + body=await async_maybe_transform( + { + "collection": collection, + "metadata": metadata, + "text": text, + "title": title, + }, + memory_update_params.MemoryUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MemoryStatus, + ) + def list( self, *, collection: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + filter: Optional[str] | Omit = omit, size: int | Omit = omit, source: Optional[ Literal[ @@ -678,6 +913,10 @@ def list( Args: collection: Filter documents by collection. + filter: + Filter documents by metadata using MongoDB-style operators. Example: + {"department": "engineering", "priority": {"$gt": 3}} + source: Filter documents by source. extra_headers: Send extra headers @@ -700,6 +939,7 @@ def list( { "collection": collection, "cursor": cursor, + "filter": filter, "size": size, "source": source, }, @@ -1146,6 +1386,9 @@ class MemoriesResourceWithRawResponse: def __init__(self, memories: MemoriesResource) -> None: self._memories = memories + self.update = to_raw_response_wrapper( + memories.update, + ) self.list = to_raw_response_wrapper( memories.list, ) @@ -1173,6 +1416,9 @@ class AsyncMemoriesResourceWithRawResponse: def __init__(self, memories: AsyncMemoriesResource) -> None: self._memories = memories + self.update = async_to_raw_response_wrapper( + memories.update, + ) self.list = async_to_raw_response_wrapper( memories.list, ) @@ -1200,6 +1446,9 @@ class MemoriesResourceWithStreamingResponse: def __init__(self, memories: MemoriesResource) -> None: self._memories = memories + self.update = to_streamed_response_wrapper( + memories.update, + ) self.list = to_streamed_response_wrapper( memories.list, ) @@ -1227,6 +1476,9 @@ class AsyncMemoriesResourceWithStreamingResponse: def __init__(self, memories: AsyncMemoriesResource) -> None: self._memories = memories + self.update = async_to_streamed_response_wrapper( + memories.update, + ) self.list = async_to_streamed_response_wrapper( memories.list, ) diff --git a/src/hyperspell/types/__init__.py b/src/hyperspell/types/__init__.py index fb57352..434ea44 100644 --- a/src/hyperspell/types/__init__.py +++ b/src/hyperspell/types/__init__.py @@ -12,6 +12,7 @@ from .memory_list_params import MemoryListParams as MemoryListParams from .vault_list_response import VaultListResponse as VaultListResponse from .memory_search_params import MemorySearchParams as MemorySearchParams +from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams from .memory_upload_params import MemoryUploadParams as MemoryUploadParams from .auth_user_token_params import AuthUserTokenParams as AuthUserTokenParams from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse diff --git a/src/hyperspell/types/memory_list_params.py b/src/hyperspell/types/memory_list_params.py index c2679fb..5e01df3 100644 --- a/src/hyperspell/types/memory_list_params.py +++ b/src/hyperspell/types/memory_list_params.py @@ -14,6 +14,12 @@ class MemoryListParams(TypedDict, total=False): cursor: Optional[str] + filter: Optional[str] + """Filter documents by metadata using MongoDB-style operators. + + Example: {"department": "engineering", "priority": {"$gt": 3}} + """ + size: int source: Optional[ diff --git a/src/hyperspell/types/memory_update_params.py b/src/hyperspell/types/memory_update_params.py new file mode 100644 index 0000000..60ef274 --- /dev/null +++ b/src/hyperspell/types/memory_update_params.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["MemoryUpdateParams"] + + +class MemoryUpdateParams(TypedDict, total=False): + source: Required[ + Literal[ + "collections", + "vault", + "web_crawler", + "notion", + "slack", + "google_calendar", + "reddit", + "box", + "google_drive", + "airtable", + "algolia", + "amplitude", + "asana", + "ashby", + "bamboohr", + "basecamp", + "bubbles", + "calendly", + "confluence", + "clickup", + "datadog", + "deel", + "discord", + "dropbox", + "exa", + "facebook", + "front", + "github", + "gitlab", + "google_docs", + "google_mail", + "google_sheet", + "hubspot", + "jira", + "linear", + "microsoft_teams", + "mixpanel", + "monday", + "outlook", + "perplexity", + "rippling", + "salesforce", + "segment", + "todoist", + "twitter", + "zoom", + ] + ] + + collection: Union[str, object, None] + """The collection to move the document to. Set to null to remove the collection.""" + + metadata: Union[Dict[str, Union[str, float, bool]], object, None] + """Custom metadata for filtering. + + Keys must be alphanumeric with underscores, max 64 chars. Values must be string, + number, or boolean. Will be merged with existing metadata. + """ + + text: Union[str, object, None] + """Full text of the document. If provided, the document will be re-indexed.""" + + title: Union[str, object, None] + """Title of the document.""" diff --git a/tests/api_resources/test_memories.py b/tests/api_resources/test_memories.py index 87f5dba..36f9f67 100644 --- a/tests/api_resources/test_memories.py +++ b/tests/api_resources/test_memories.py @@ -25,6 +25,60 @@ class TestMemories: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_update(self, client: Hyperspell) -> None: + memory = client.memories.update( + resource_id="resource_id", + source="collections", + ) + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Hyperspell) -> None: + memory = client.memories.update( + resource_id="resource_id", + source="collections", + collection="string", + metadata={"foo": "string"}, + text="string", + title="string", + ) + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Hyperspell) -> None: + response = client.memories.with_raw_response.update( + resource_id="resource_id", + source="collections", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + memory = response.parse() + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Hyperspell) -> None: + with client.memories.with_streaming_response.update( + resource_id="resource_id", + source="collections", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + memory = response.parse() + assert_matches_type(MemoryStatus, memory, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Hyperspell) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_id` but received ''"): + client.memories.with_raw_response.update( + resource_id="", + source="collections", + ) + @parametrize def test_method_list(self, client: Hyperspell) -> None: memory = client.memories.list() @@ -35,6 +89,7 @@ def test_method_list_with_all_params(self, client: Hyperspell) -> None: memory = client.memories.list( collection="collection", cursor="cursor", + filter="filter", size=0, source="collections", ) @@ -373,6 +428,60 @@ class TestAsyncMemories: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @parametrize + async def test_method_update(self, async_client: AsyncHyperspell) -> None: + memory = await async_client.memories.update( + resource_id="resource_id", + source="collections", + ) + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncHyperspell) -> None: + memory = await async_client.memories.update( + resource_id="resource_id", + source="collections", + collection="string", + metadata={"foo": "string"}, + text="string", + title="string", + ) + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncHyperspell) -> None: + response = await async_client.memories.with_raw_response.update( + resource_id="resource_id", + source="collections", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + memory = await response.parse() + assert_matches_type(MemoryStatus, memory, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncHyperspell) -> None: + async with async_client.memories.with_streaming_response.update( + resource_id="resource_id", + source="collections", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + memory = await response.parse() + assert_matches_type(MemoryStatus, memory, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncHyperspell) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_id` but received ''"): + await async_client.memories.with_raw_response.update( + resource_id="", + source="collections", + ) + @parametrize async def test_method_list(self, async_client: AsyncHyperspell) -> None: memory = await async_client.memories.list() @@ -383,6 +492,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHyperspell) memory = await async_client.memories.list( collection="collection", cursor="cursor", + filter="filter", size=0, source="collections", )