diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6506b40..9eaabf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/context.dev-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -35,7 +35,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 87163c2..2d333c3 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to PyPI in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/brand-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml +# You can run this workflow by navigating to https://www.github.com/context-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml name: Publish PyPI on: workflow_dispatch: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 5606b8c..8686458 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -9,7 +9,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'brand-dot-dev/context-python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'context-dot-dev/context-python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v6 diff --git a/.gitignore b/.gitignore index 95ceb18..3824f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b06ba91..da59f99 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.1" + ".": "0.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index c4d3922..7aefc87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-c2e94e0c758b1aaba120c2a4231842fff0a120acc471fe24c7a81221e13a0482.yml -openapi_spec_hash: aabc231b46b1ca3375882f96c378c665 -config_hash: ab5135cc119f83ae2821f9445ed99d16 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml +openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14 +config_hash: 38268bb88fc4dcbb8f2f94dd138b5910 diff --git a/CHANGELOG.md b/CHANGELOG.md index 36df33c..8ec33e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,197 @@ # Changelog -## 0.2.1 (2026-03-20) +## 0.4.0 (2026-03-28) + +Full Changelog: [v0.3.0...v0.4.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.3.0...v0.4.0) + +### Features + +* **api:** api update ([f502ad6](https://github.com/context-dot-dev/context-python-sdk/commit/f502ad62ce34a4f0677272bec3260cb09e1c535d)) +* **api:** api update ([e04913b](https://github.com/context-dot-dev/context-python-sdk/commit/e04913ba154a94938a61cf8e0e6ea595abdcc9ab)) +* **api:** api update ([38a4e7f](https://github.com/context-dot-dev/context-python-sdk/commit/38a4e7f37ec82795600b81181833d1899b8f55d5)) +* **api:** api update ([4a10229](https://github.com/context-dot-dev/context-python-sdk/commit/4a102292482af5d8e25c6ccf56bdb18999cdb465)) +* **api:** api update ([c4538b4](https://github.com/context-dot-dev/context-python-sdk/commit/c4538b459e6dcee56fb4b2ca85c94db4589d4318)) +* **api:** api update ([5cc1e7d](https://github.com/context-dot-dev/context-python-sdk/commit/5cc1e7d56a2bc8210d4b2b06c581459cea572210)) +* **api:** manual updates ([8304083](https://github.com/context-dot-dev/context-python-sdk/commit/830408303450a4b85dfd444a2c4790cc8fecf292)) +* **api:** manual updates ([3285d21](https://github.com/context-dot-dev/context-python-sdk/commit/3285d21cae790e5529ba6fcd7a79612ffc7e7738)) +* **internal:** implement indices array format for query and form serialization ([6f40553](https://github.com/context-dot-dev/context-python-sdk/commit/6f40553d0aebcb2ecdc082481c656a89cb48b330)) -Full Changelog: [v0.2.0...v0.2.1](https://github.com/brand-dot-dev/context-python-sdk/compare/v0.2.0...v0.2.1) ### Bug Fixes -* sanitize endpoint path params ([8ccc27d](https://github.com/brand-dot-dev/context-python-sdk/commit/8ccc27d64fd1046ba6059c87a931b7b81716a82c)) +* **deps:** bump minimum typing-extensions version ([4695dbc](https://github.com/context-dot-dev/context-python-sdk/commit/4695dbc34b87e85188379626840776680c6bb9b6)) +* **pydantic:** do not pass `by_alias` unless set ([b1723b9](https://github.com/context-dot-dev/context-python-sdk/commit/b1723b9dcac429353c6d02808e6d795e5ed5caa3)) +* sanitize endpoint path params ([8ccc27d](https://github.com/context-dot-dev/context-python-sdk/commit/8ccc27d64fd1046ba6059c87a931b7b81716a82c)) + + +### Chores + +* configure new SDK language ([0277c2c](https://github.com/context-dot-dev/context-python-sdk/commit/0277c2c3a9c03e58f50a2628c133612140dd6f73)) +* **internal:** tweak CI branches ([0dbacf7](https://github.com/context-dot-dev/context-python-sdk/commit/0dbacf7d2c95a87668cd1fc052378984ca1a865e)) +* sync repo ([4003edb](https://github.com/context-dot-dev/context-python-sdk/commit/4003edb15451de5089894ef4477e36b1347569d3)) +* update SDK settings ([5cb4d7b](https://github.com/context-dot-dev/context-python-sdk/commit/5cb4d7b1710af51afa2285bae4dc24dd3b0ac4b7)) +* update SDK settings ([604b2b5](https://github.com/context-dot-dev/context-python-sdk/commit/604b2b5ef62858f4e58fd161df617c2f04a3a316)) +* update SDK settings ([d0ad046](https://github.com/context-dot-dev/context-python-sdk/commit/d0ad0460e53493b09f8f5126e26f9118989ca2bb)) +* update SDK settings ([0c90793](https://github.com/context-dot-dev/context-python-sdk/commit/0c90793462f3394063c47abf0bfb3b2bed60b685)) +* update SDK settings ([154e20a](https://github.com/context-dot-dev/context-python-sdk/commit/154e20a04eed818849ddcada3f11d97b918abf46)) +* update SDK settings ([212e987](https://github.com/context-dot-dev/context-python-sdk/commit/212e987d1d5d6dbbf0bc5f5a1a6eab6a69e67775)) + +## 0.3.0 (2026-03-25) + +Full Changelog: [v0.2.0...v0.3.0](https://github.com/context-dot-dev/python-sdk/compare/v0.2.0...v0.3.0) + +### Features + +* **api:** api update ([1c8cf2c](https://github.com/context-dot-dev/python-sdk/commit/1c8cf2cf35082ef29bdb212f65e2b2a6576ee171)) +* **api:** api update ([06eeb90](https://github.com/context-dot-dev/python-sdk/commit/06eeb901097ef65fc3bd748262ee0535fedbd41f)) +* **api:** api update ([99080ad](https://github.com/context-dot-dev/python-sdk/commit/99080ade4047eba1c61b35aa5244ca139d259b2b)) +* **api:** api update ([42f1031](https://github.com/context-dot-dev/python-sdk/commit/42f10313977a9f557c5b067f81f8bbad55fdd76a)) +* **api:** api update ([7fa889e](https://github.com/context-dot-dev/python-sdk/commit/7fa889e647b8e5a99b4d224a192cc6337390af7e)) +* **api:** api update ([e8992d4](https://github.com/context-dot-dev/python-sdk/commit/e8992d4c206a30ecc97395145d3a1c61b8ef1c7a)) +* **api:** api update ([09fa73a](https://github.com/context-dot-dev/python-sdk/commit/09fa73a99432c4a131bba9d924d38f12a9537e51)) +* **api:** api update ([c94b956](https://github.com/context-dot-dev/python-sdk/commit/c94b95672e4a684f5375f1b48f351c0839be1fdc)) +* **api:** api update ([2131c0e](https://github.com/context-dot-dev/python-sdk/commit/2131c0e5287b5e9abcba8b90c57810f05d479bf9)) +* **api:** api update ([5e513f4](https://github.com/context-dot-dev/python-sdk/commit/5e513f457d07e9f0560aa8f50542934d7393c929)) +* **api:** api update ([9556441](https://github.com/context-dot-dev/python-sdk/commit/95564414d4f0ec6095e06df2d5e1e8e2b9d2d889)) +* **api:** api update ([08ca403](https://github.com/context-dot-dev/python-sdk/commit/08ca403530f9057d25b443c0c8b02fe821fef14f)) +* **api:** api update ([3584d59](https://github.com/context-dot-dev/python-sdk/commit/3584d596dd958801f09f6bc8dc8c805ce77e5351)) +* **api:** api update ([6d6658c](https://github.com/context-dot-dev/python-sdk/commit/6d6658cd07e8ac63eb3e8dabcdcacb9e9b434eac)) +* **api:** api update ([f606974](https://github.com/context-dot-dev/python-sdk/commit/f6069740829283a3ae92129aead5ecf9e7b1e3c6)) +* **api:** api update ([66e9f1b](https://github.com/context-dot-dev/python-sdk/commit/66e9f1bff651d0cbb90edfec969b5d8522384d55)) +* **api:** api update ([5dcdf4e](https://github.com/context-dot-dev/python-sdk/commit/5dcdf4ebf86287ba4ddeb2f1e7f522975f4201d5)) +* **api:** api update ([55d0b8f](https://github.com/context-dot-dev/python-sdk/commit/55d0b8ff29b7264baef44d29c0e787da969fe258)) +* **api:** api update ([6c71e83](https://github.com/context-dot-dev/python-sdk/commit/6c71e83258954d60bf452dfb0ff98d505c5b8fd4)) +* **api:** api update ([5d94310](https://github.com/context-dot-dev/python-sdk/commit/5d94310f089a9c68f371be77588f6d28d26e92b5)) +* **api:** api update ([8cfbec2](https://github.com/context-dot-dev/python-sdk/commit/8cfbec23d5dc6d20eb1c01950bb1e15d7b5f6558)) +* **api:** api update ([b4f32bb](https://github.com/context-dot-dev/python-sdk/commit/b4f32bbe3594730346a863e6cc9872880a6a0c67)) +* **api:** api update ([7f5f368](https://github.com/context-dot-dev/python-sdk/commit/7f5f368fee87e0b76cb2598bd84fe74be2ca3c98)) +* **api:** api update ([87df1d4](https://github.com/context-dot-dev/python-sdk/commit/87df1d46a0d754a0d3dc3cc68b4fd9d2cce93356)) +* **api:** api update ([f91ea74](https://github.com/context-dot-dev/python-sdk/commit/f91ea744a88f266bc754d3225fbeb90e01d8c759)) +* **api:** api update ([ed3e4c7](https://github.com/context-dot-dev/python-sdk/commit/ed3e4c7f6f4d0e23f1879959ac1cc534454ff8d8)) +* **api:** api update ([eb66567](https://github.com/context-dot-dev/python-sdk/commit/eb66567eee137fe637b6629a0113b3af26eae9e9)) +* **api:** manual updates ([5a4711d](https://github.com/context-dot-dev/python-sdk/commit/5a4711dd78aa1a27c8ed0318aab099a60a6a6363)) +* **api:** manual updates ([4dc72c5](https://github.com/context-dot-dev/python-sdk/commit/4dc72c5ee1563a72f7d0cfbc3196fc94694acf95)) +* **api:** manual updates ([62ec1b4](https://github.com/context-dot-dev/python-sdk/commit/62ec1b480e338243030e770e4a0cae33468575c2)) +* **api:** manual updates ([17cbb91](https://github.com/context-dot-dev/python-sdk/commit/17cbb910aa48e07ced617793793165219952444f)) +* **api:** manual updates ([d95285a](https://github.com/context-dot-dev/python-sdk/commit/d95285ae339e8df4d50e793e7c9938ac226974f1)) +* **api:** manual updates ([152e848](https://github.com/context-dot-dev/python-sdk/commit/152e8489b6ecbbe717d48ac0c437e88c64e923a5)) +* **api:** manual updates ([887cd82](https://github.com/context-dot-dev/python-sdk/commit/887cd82aaf78b8752cbf2fe8956ce81a9905d882)) +* **api:** manual updates ([bfe7d93](https://github.com/context-dot-dev/python-sdk/commit/bfe7d93dd9719704e9f18b8397c30127affcf218)) +* **api:** manual updates ([df07feb](https://github.com/context-dot-dev/python-sdk/commit/df07feb9025fb1e5f3555ae9dc98efc073b2d1e0)) +* **api:** manual updates ([59f9ac6](https://github.com/context-dot-dev/python-sdk/commit/59f9ac61748a337bcbec52a0034f06cac9e1b3d9)) +* **api:** manual updates ([59002c5](https://github.com/context-dot-dev/python-sdk/commit/59002c5632848838141179929202e55c3c53d6a9)) +* **api:** manual updates ([89a4986](https://github.com/context-dot-dev/python-sdk/commit/89a49860aa2c253b9f12397684d7ee38670298b1)) +* **api:** manual updates ([e850add](https://github.com/context-dot-dev/python-sdk/commit/e850add60f02a45cf5ca3d47cb2f8d79f2545107)) +* **api:** manual updates ([ec427c1](https://github.com/context-dot-dev/python-sdk/commit/ec427c1d9a888f17310304714b099ec2487fea82)) +* **api:** manual updates ([315c5dc](https://github.com/context-dot-dev/python-sdk/commit/315c5dcb1aa4982bf5e90b3fbe1223c969234a64)) +* **api:** manual updates ([adc4bd6](https://github.com/context-dot-dev/python-sdk/commit/adc4bd6260c7bc6471fa060b66c1f3e8f368bf07)) +* **api:** manual updates ([8f3190c](https://github.com/context-dot-dev/python-sdk/commit/8f3190c847269b9537c2000feadff81762171295)) +* **api:** manual updates ([7c294f5](https://github.com/context-dot-dev/python-sdk/commit/7c294f5085d548520f19c3e00d11faccd9622825)) +* **api:** manual updates ([bb1bf90](https://github.com/context-dot-dev/python-sdk/commit/bb1bf90daf24a834121f2656741b1bce3e611588)) +* **api:** manual updates ([9039f16](https://github.com/context-dot-dev/python-sdk/commit/9039f1632ed997579d6ab4f55a83adcf2fbc3fce)) +* **api:** manual updates ([fa44a02](https://github.com/context-dot-dev/python-sdk/commit/fa44a02f3397ae35b14ce65f8cacb60b4cc76b33)) +* **api:** manual updates ([90c550f](https://github.com/context-dot-dev/python-sdk/commit/90c550fdeaefe75facfd24724c878a70f8aa35b4)) +* clean up environment call outs ([3d8cf3d](https://github.com/context-dot-dev/python-sdk/commit/3d8cf3dcad83da7cf75078c501997fb0cfc4eefa)) +* **client:** add custom JSON encoder for extended type support ([4d2628a](https://github.com/context-dot-dev/python-sdk/commit/4d2628ade95a98924df0a63347dc5d4263fa86e5)) +* **client:** add follow_redirects request option ([7a9a565](https://github.com/context-dot-dev/python-sdk/commit/7a9a5654ef7f84e4b8231ec5c50b972dc2241dba)) +* **client:** add support for aiohttp ([ec89992](https://github.com/context-dot-dev/python-sdk/commit/ec89992888ebc95015e914ec22ad479054797455)) +* **client:** add support for binary request streaming ([fb022d1](https://github.com/context-dot-dev/python-sdk/commit/fb022d1dba2ccc882189db9f21a62de5321217d4)) +* **client:** support file upload requests ([5a700a4](https://github.com/context-dot-dev/python-sdk/commit/5a700a45169a4bf3e13f7d27fd1eb0698db48b53)) +* improve future compat with pydantic v3 ([3cc4580](https://github.com/context-dot-dev/python-sdk/commit/3cc4580e2035d82876574d3515d6f0e8b3194220)) +* **types:** replace List[str] with SequenceNotStr in params ([e4204bb](https://github.com/context-dot-dev/python-sdk/commit/e4204bb3295a96c4eeea07e306a9866d1ee8e852)) + + +### Bug Fixes + +* avoid newer type syntax ([4eda6ab](https://github.com/context-dot-dev/python-sdk/commit/4eda6ab5d68888b9ae0a6f4c5333532603acbd06)) +* **ci:** correct conditional ([ad26494](https://github.com/context-dot-dev/python-sdk/commit/ad26494daca49a55899f9e769e9b38e20f51857a)) +* **ci:** release-doctor — report correct token name ([5dfdca8](https://github.com/context-dot-dev/python-sdk/commit/5dfdca8ac67612c7ebe230b03d8b30754c7ceb49)) +* **client:** close streams without requiring full consumption ([8c87170](https://github.com/context-dot-dev/python-sdk/commit/8c8717069bf064ca9a467b1c478ed642a10d5342)) +* **client:** correctly parse binary response | stream ([26be0c4](https://github.com/context-dot-dev/python-sdk/commit/26be0c417636a9be6f5b52fd079038b3eeb11484)) +* **client:** don't send Content-Type header on GET requests ([34c2827](https://github.com/context-dot-dev/python-sdk/commit/34c2827853c1d1c04ac05d3ce3fa519179d60793)) +* compat with Python 3.14 ([8602245](https://github.com/context-dot-dev/python-sdk/commit/860224506b4fe79750cff976b1bed305f4f826da)) +* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([768e2d1](https://github.com/context-dot-dev/python-sdk/commit/768e2d13ddf92adde07ad4715419caa4b3257338)) +* **deps:** bump minimum typing-extensions version ([b00d64f](https://github.com/context-dot-dev/python-sdk/commit/b00d64faf3853055f45d4f2224d1d1e7ecd408dd)) +* **docs:** fix mcp installation instructions for remote servers ([04909f3](https://github.com/context-dot-dev/python-sdk/commit/04909f3e6ed80cf91c19354f03ad5eb0f92f4398)) +* ensure streams are always closed ([77df827](https://github.com/context-dot-dev/python-sdk/commit/77df827c2608b4326d707c0ecbc93d7ec83957d5)) +* **parsing:** correctly handle nested discriminated unions ([3f1078d](https://github.com/context-dot-dev/python-sdk/commit/3f1078dede16aed00d8e434b4491f4f3285cfe51)) +* **parsing:** ignore empty metadata ([dca3c67](https://github.com/context-dot-dev/python-sdk/commit/dca3c6732cef49c169afc94625b8ccfecb11cdc2)) +* **parsing:** parse extra field types ([eba3879](https://github.com/context-dot-dev/python-sdk/commit/eba38798002dd3cac30d4189e74bfe4c5a9700f9)) +* **pydantic:** do not pass `by_alias` unless set ([e50e790](https://github.com/context-dot-dev/python-sdk/commit/e50e790617805b8d8e7433cab5c5818fc19e5414)) +* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([b2bff71](https://github.com/context-dot-dev/python-sdk/commit/b2bff712704ec48751c0b2ea4f51960913811a98)) +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([f64c32a](https://github.com/context-dot-dev/python-sdk/commit/f64c32a4b1a4a7b4560d26fcc14fa9f66961bf5b)) +* use async_to_httpx_files in patch method ([cfd96a1](https://github.com/context-dot-dev/python-sdk/commit/cfd96a1560076b2db2bdb36556f3546a06b4ad91)) + + +### Chores + +* add missing docstrings ([d511865](https://github.com/context-dot-dev/python-sdk/commit/d511865b2e098417a8ee142c082938e68db84cfb)) +* add Python 3.14 classifier and testing ([c3c5690](https://github.com/context-dot-dev/python-sdk/commit/c3c5690cda3a9e5c5ca874799cf9018119f30781)) +* bump `httpx-aiohttp` version to 0.1.9 ([ceb1df0](https://github.com/context-dot-dev/python-sdk/commit/ceb1df09dd39451859697ff35836cfa278ba420a)) +* **ci:** change upload type ([9f67ed0](https://github.com/context-dot-dev/python-sdk/commit/9f67ed039e0b905f81d8c1e1a1bd79e9c997d483)) +* **ci:** enable for pull requests ([d908899](https://github.com/context-dot-dev/python-sdk/commit/d9088990a6b2e760d1a425117848697882a2b5bd)) +* **ci:** only run for pushes and fork pull requests ([4a9a6ac](https://github.com/context-dot-dev/python-sdk/commit/4a9a6acb4467d8f45b3d81967094fdd119f30bd2)) +* **ci:** skip uploading artifacts on stainless-internal branches ([d4eb82a](https://github.com/context-dot-dev/python-sdk/commit/d4eb82a95117381b0f3ef3c8a06a7716370b654c)) +* **ci:** upgrade `actions/github-script` ([2b8ee02](https://github.com/context-dot-dev/python-sdk/commit/2b8ee025004e0cb91395ca4dcfa8cca70e91f1dd)) +* configure new SDK language ([1fc1964](https://github.com/context-dot-dev/python-sdk/commit/1fc1964f8ec52cd807d6c69d119dc9175551a94b)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([eedd772](https://github.com/context-dot-dev/python-sdk/commit/eedd772cb757bcff196b6ed21ac9e887b8423fe0)) +* do not install brew dependencies in ./scripts/bootstrap by default ([f856a6b](https://github.com/context-dot-dev/python-sdk/commit/f856a6b751a5ff4c057eed53c9b765fa88b1df09)) +* **docs:** remove reference to rye shell ([5d1533b](https://github.com/context-dot-dev/python-sdk/commit/5d1533ba7fd39e6d1b0cc4cd44793e4de4233d64)) +* **docs:** remove unnecessary param examples ([93f2f3f](https://github.com/context-dot-dev/python-sdk/commit/93f2f3f95c7ebaa648a16c752d4d81c48929c39c)) +* **docs:** use environment variables for authentication in code snippets ([ab01c66](https://github.com/context-dot-dev/python-sdk/commit/ab01c662dc0eeff8e6335f9296c27264fbd27ce2)) +* format all `api.md` files ([1e07eb2](https://github.com/context-dot-dev/python-sdk/commit/1e07eb24f5f98442570db5b59cca02beba01791d)) +* **internal/tests:** avoid race condition with implicit client cleanup ([ccaa28b](https://github.com/context-dot-dev/python-sdk/commit/ccaa28b34cfbd24a0f46371dca4e43ab7a15fa61)) +* **internal:** add missing files argument to base client ([a0aab9c](https://github.com/context-dot-dev/python-sdk/commit/a0aab9cdf8e231a1c1e0177484944f04af00aeaa)) +* **internal:** add request options to SSE classes ([2c7a465](https://github.com/context-dot-dev/python-sdk/commit/2c7a465cd6c6af51ee31c51e654197c5b2f2141c)) +* **internal:** add Sequence related utils ([6e617e9](https://github.com/context-dot-dev/python-sdk/commit/6e617e978bd81bed9d39aa5be446c0697d96a173)) +* **internal:** bump dependencies ([2e44fb1](https://github.com/context-dot-dev/python-sdk/commit/2e44fb1f73e3fbec9bb6326da4fbbf94d40dcd0d)) +* **internal:** bump pinned h11 dep ([a9e93bf](https://github.com/context-dot-dev/python-sdk/commit/a9e93bf5b4f7d4d6bf2c82b9e1db113a8396d398)) +* **internal:** change ci workflow machines ([169d92b](https://github.com/context-dot-dev/python-sdk/commit/169d92b7eda9c15d806accc91e89033d0e4e0dc2)) +* **internal:** codegen related update ([67b3cdd](https://github.com/context-dot-dev/python-sdk/commit/67b3cdd7dbc80aa0195894c80c3ca2636f689cf7)) +* **internal:** codegen related update ([1fe969e](https://github.com/context-dot-dev/python-sdk/commit/1fe969e85edcb0370dbd7f926c860115939e0aa9)) +* **internal:** codegen related update ([2b591ec](https://github.com/context-dot-dev/python-sdk/commit/2b591ec1951445ed47e3c7d5e2f129e04133b42e)) +* **internal:** codegen related update ([92cf858](https://github.com/context-dot-dev/python-sdk/commit/92cf85837fb7a56a98736c97d5115308e51c5906)) +* **internal:** detect missing future annotations with ruff ([2d0454e](https://github.com/context-dot-dev/python-sdk/commit/2d0454e6f67dd4700753139aa49c7c774ead033a)) +* **internal:** fix lint error on Python 3.14 ([52df74d](https://github.com/context-dot-dev/python-sdk/commit/52df74dc18219979bf3c62b6d682e04cfc10af67)) +* **internal:** fix ruff target version ([8674d17](https://github.com/context-dot-dev/python-sdk/commit/8674d1739383a872081dbc40b3726572654a5800)) +* **internal:** grammar fix (it's -> its) ([569ba5e](https://github.com/context-dot-dev/python-sdk/commit/569ba5e3563091f8e4f770c279c805ad43cafa50)) +* **internal:** make `test_proxy_environment_variables` more resilient ([481029b](https://github.com/context-dot-dev/python-sdk/commit/481029be8d533936b4078d6eeecf135b102463c3)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([b7ecf85](https://github.com/context-dot-dev/python-sdk/commit/b7ecf85a40b0f93e742349f13b986f1263a2cc73)) +* **internal:** move mypy configurations to `pyproject.toml` file ([62bff96](https://github.com/context-dot-dev/python-sdk/commit/62bff96543fce02199301107ad8fea0f86883ebd)) +* **internal:** remove mock server code ([7ecae89](https://github.com/context-dot-dev/python-sdk/commit/7ecae891adfda542f0bfd7d0b94a3b098742e4f0)) +* **internal:** tweak CI branches ([792abc0](https://github.com/context-dot-dev/python-sdk/commit/792abc0a5813db36397413e29e8741810321878f)) +* **internal:** update `actions/checkout` version ([da116bb](https://github.com/context-dot-dev/python-sdk/commit/da116bb533a1e98211c72c5c95eb2eb8b725e5d7)) +* **internal:** update comment in script ([59767cf](https://github.com/context-dot-dev/python-sdk/commit/59767cfff3a11d740c30d764b566730551b1e259)) +* **internal:** update conftest.py ([fd16274](https://github.com/context-dot-dev/python-sdk/commit/fd16274f9eb87fac48f5d746e628f135f98ff052)) +* **internal:** update pydantic dependency ([7800848](https://github.com/context-dot-dev/python-sdk/commit/7800848421ccea5af40e1c7cc8c15708b1c4948d)) +* **internal:** update pyright exclude list ([b0ec69a](https://github.com/context-dot-dev/python-sdk/commit/b0ec69ae1a0caa28e00b37df2ad8e602ca127c35)) +* **internal:** version bump ([7a15a0a](https://github.com/context-dot-dev/python-sdk/commit/7a15a0aceaca0cd700f7aab8282e5bdef8cbf31f)) +* **package:** drop Python 3.8 support ([ecc46d0](https://github.com/context-dot-dev/python-sdk/commit/ecc46d081a6d8ecbbdb633e444218f0d12487f2b)) +* **package:** mark python 3.13 as supported ([4600562](https://github.com/context-dot-dev/python-sdk/commit/46005627ab1a6e83e62bb90a8b8f0183b2292786)) +* **project:** add settings file for vscode ([5218747](https://github.com/context-dot-dev/python-sdk/commit/5218747ee50439e600cfb756f14364d9a7e7aef3)) +* **readme:** fix version rendering on pypi ([ed9ea71](https://github.com/context-dot-dev/python-sdk/commit/ed9ea71094d6bede408dd145d9951bd5bf24c0b8)) +* **readme:** update badges ([727b0fa](https://github.com/context-dot-dev/python-sdk/commit/727b0fa230d8a40abbd1e36e592ba3ba05b6f8eb)) +* speedup initial import ([995537f](https://github.com/context-dot-dev/python-sdk/commit/995537fa33a6c193350c3d730505591a700a3af5)) +* sync repo ([5180c7e](https://github.com/context-dot-dev/python-sdk/commit/5180c7e58c8d720173e9bd49149dc48a912bca52)) +* **tests:** add tests for httpx client instantiation & proxies ([bb70721](https://github.com/context-dot-dev/python-sdk/commit/bb70721dd5ac47752cc749ac9269eb4e7d1bb6d4)) +* **tests:** run tests in parallel ([b12584c](https://github.com/context-dot-dev/python-sdk/commit/b12584c87749c3a9e06653418a9e3365f80cfee0)) +* **tests:** skip some failing tests on the latest python versions ([1c82bc6](https://github.com/context-dot-dev/python-sdk/commit/1c82bc6b846e17da31ec6798c9fcd59336709a60)) +* **types:** change optional parameter type from NotGiven to Omit ([ef0373e](https://github.com/context-dot-dev/python-sdk/commit/ef0373ec0840486ad33c4cac1af9e306d12debc9)) +* update @stainless-api/prism-cli to v5.15.0 ([c3e909c](https://github.com/context-dot-dev/python-sdk/commit/c3e909c65e6d21d669321ac53dbb7ac84a5d9afc)) +* update github action ([66063f3](https://github.com/context-dot-dev/python-sdk/commit/66063f3144f528c5268e056fd4e90ae65d759c30)) +* update lockfile ([8102591](https://github.com/context-dot-dev/python-sdk/commit/8102591bdc579695e7c9e569962d4e08dedb5ac1)) +* update mock server docs ([8d2e54b](https://github.com/context-dot-dev/python-sdk/commit/8d2e54bc9152c1f461e0992da97a83430b21f7c2)) +* update SDK settings ([742f3b1](https://github.com/context-dot-dev/python-sdk/commit/742f3b18ff6be8ad43546b721faa8e19f517c202)) +* update SDK settings ([7d20c93](https://github.com/context-dot-dev/python-sdk/commit/7d20c9391955189295df7dd145946dd0b82686dc)) +* update SDK settings ([be2487f](https://github.com/context-dot-dev/python-sdk/commit/be2487f18b9891af6d337d7b9db24ea33122382c)) +* update SDK settings ([f7a639b](https://github.com/context-dot-dev/python-sdk/commit/f7a639bcc1d10e14c42eb59e109c2bdb6c3cc761)) +* update SDK settings ([d65d040](https://github.com/context-dot-dev/python-sdk/commit/d65d04065c5dd84d2d4d57e2f0fddf78d0a56132)) + + +### Documentation + +* **client:** fix httpx.Timeout documentation reference ([05629cf](https://github.com/context-dot-dev/python-sdk/commit/05629cf3a6cef8bf5b65aa4df60528e313883a7b)) +* prominently feature MCP server setup in root SDK readmes ([6ca0c13](https://github.com/context-dot-dev/python-sdk/commit/6ca0c134a8a6ac54af90cbc8562f716141dd57c2)) ## 0.2.0 (2026-03-18) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 27fbe67..5b7ef4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/brand-dot-dev/context-python-sdk.git +$ pip install git+ssh://git@github.com/context-dot-dev/context-python-sdk.git ``` Alternatively, you can build from source and install the wheel file: @@ -113,7 +113,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/brand-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/context-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 83a846f..29a84e8 100644 --- a/README.md +++ b/README.md @@ -283,9 +283,9 @@ brand = response.parse() # get the object that `brand.retrieve()` would have re print(brand.brand) ``` -These methods return an [`APIResponse`](https://github.com/brand-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object. +These methods return an [`APIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/brand-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -391,7 +391,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/brand-dot-dev/context-python-sdk/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/context-dot-dev/context-python-sdk/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/pyproject.toml b/pyproject.toml index 878070e..7842351 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.2.1" +version = "0.4.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" @@ -37,8 +37,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/brand-dot-dev/context-python-sdk" -Repository = "https://github.com/brand-dot-dev/context-python-sdk" +Homepage = "https://github.com/context-dot-dev/context-python-sdk" +Repository = "https://github.com/context-dot-dev/context-python-sdk" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] @@ -112,7 +112,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/brand-dot-dev/context-python-sdk/tree/main/\g<2>)' +replacement = '[\1](https://github.com/context-dot-dev/context-python-sdk/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/context/dev/_qs.py b/src/context/dev/_qs.py index ada6fd3..de8c99b 100644 --- a/src/context/dev/_qs.py +++ b/src/context/dev/_qs.py @@ -101,7 +101,10 @@ def _stringify_item( items.extend(self._stringify_item(key, item, opts)) return items elif array_format == "indices": - raise NotImplementedError("The array indices format is not supported yet") + items = [] + for i, item in enumerate(value): + items.extend(self._stringify_item(f"{key}[{i}]", item, opts)) + return items elif array_format == "brackets": items = [] key = key + "[]" diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 40c8eb3..cc40342 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "0.2.1" # x-release-please-version +__version__ = "0.4.0" # x-release-please-version diff --git a/src/context/dev/resources/ai.py b/src/context/dev/resources/ai.py index 68bbfe0..8c01210 100644 --- a/src/context/dev/resources/ai.py +++ b/src/context/dev/resources/ai.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> AIResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AIResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> AIResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AIResourceWithStreamingResponse(self) @@ -164,7 +164,7 @@ def extract_products( ) -> AIExtractProductsResponse: """Beta feature: Extract product information from a brand's website. - Brand.dev will + We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more. @@ -202,7 +202,7 @@ def extract_products( ) -> AIExtractProductsResponse: """Beta feature: Extract product information from a brand's website. - Brand.dev will + We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more. @@ -265,7 +265,7 @@ def with_raw_response(self) -> AsyncAIResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncAIResourceWithRawResponse(self) @@ -274,7 +274,7 @@ def with_streaming_response(self) -> AsyncAIResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncAIResourceWithStreamingResponse(self) @@ -396,7 +396,7 @@ async def extract_products( ) -> AIExtractProductsResponse: """Beta feature: Extract product information from a brand's website. - Brand.dev will + We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more. @@ -434,7 +434,7 @@ async def extract_products( ) -> AIExtractProductsResponse: """Beta feature: Extract product information from a brand's website. - Brand.dev will + We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more. diff --git a/src/context/dev/resources/brand.py b/src/context/dev/resources/brand.py index 7d52db8..4e092d1 100644 --- a/src/context/dev/resources/brand.py +++ b/src/context/dev/resources/brand.py @@ -44,7 +44,7 @@ def with_raw_response(self) -> BrandResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return BrandResourceWithRawResponse(self) @@ -53,7 +53,7 @@ def with_streaming_response(self) -> BrandResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return BrandResourceWithStreamingResponse(self) @@ -1413,7 +1413,7 @@ def with_raw_response(self) -> AsyncBrandResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncBrandResourceWithRawResponse(self) @@ -1422,7 +1422,7 @@ def with_streaming_response(self) -> AsyncBrandResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncBrandResourceWithStreamingResponse(self) diff --git a/src/context/dev/resources/industry.py b/src/context/dev/resources/industry.py index 8a995e5..ae71953 100644 --- a/src/context/dev/resources/industry.py +++ b/src/context/dev/resources/industry.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> IndustryResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return IndustryResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> IndustryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return IndustryResourceWithStreamingResponse(self) @@ -108,7 +108,7 @@ def with_raw_response(self) -> AsyncIndustryResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncIndustryResourceWithRawResponse(self) @@ -117,7 +117,7 @@ def with_streaming_response(self) -> AsyncIndustryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncIndustryResourceWithStreamingResponse(self) diff --git a/src/context/dev/resources/style.py b/src/context/dev/resources/style.py index 6a7c23d..f7a7d84 100644 --- a/src/context/dev/resources/style.py +++ b/src/context/dev/resources/style.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> StyleResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return StyleResourceWithRawResponse(self) @@ -40,7 +40,7 @@ def with_streaming_response(self) -> StyleResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return StyleResourceWithStreamingResponse(self) @@ -166,7 +166,7 @@ def with_raw_response(self) -> AsyncStyleResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncStyleResourceWithRawResponse(self) @@ -175,7 +175,7 @@ def with_streaming_response(self) -> AsyncStyleResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncStyleResourceWithStreamingResponse(self) diff --git a/src/context/dev/resources/utility.py b/src/context/dev/resources/utility.py index 2998696..775300e 100644 --- a/src/context/dev/resources/utility.py +++ b/src/context/dev/resources/utility.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> UtilityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return UtilityResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> UtilityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return UtilityResourceWithStreamingResponse(self) @@ -150,7 +150,7 @@ def with_raw_response(self) -> AsyncUtilityResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncUtilityResourceWithRawResponse(self) @@ -159,7 +159,7 @@ def with_streaming_response(self) -> AsyncUtilityResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncUtilityResourceWithStreamingResponse(self) diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index 5ba2455..7e4203b 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -40,7 +40,7 @@ def with_raw_response(self) -> WebResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return WebResourceWithRawResponse(self) @@ -49,7 +49,7 @@ def with_streaming_response(self) -> WebResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return WebResourceWithStreamingResponse(self) @@ -130,10 +130,8 @@ def web_scrape_html( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeHTMLResponse: - """Scrapes the given URL and returns the raw HTML content of the page. - - Uses - automatic proxy escalation to handle blocked sites. + """ + Scrapes the given URL and returns the raw HTML content of the page. Args: url: Full URL to scrape (must include http:// or https:// protocol) @@ -205,6 +203,7 @@ def web_scrape_md( include_images: bool | Omit = omit, include_links: bool | Omit = omit, shorten_base64_images: bool | Omit = omit, + use_main_content_only: bool | 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, @@ -213,9 +212,8 @@ def web_scrape_md( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeMdResponse: """ - Scrapes the given URL, converts the HTML content to GitHub Flavored Markdown - (GFM), and returns the result. Uses automatic proxy escalation to handle blocked - sites. + Scrapes the given URL, converts the HTML content to Markdown, and returns the + result. Args: url: Full URL to scrape and convert to markdown (must include http:// or https:// @@ -227,6 +225,9 @@ def web_scrape_md( shorten_base64_images: Shorten base64-encoded image data in the Markdown output + use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars, + and navigation + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -248,6 +249,7 @@ def web_scrape_md( "include_images": include_images, "include_links": include_links, "shorten_base64_images": shorten_base64_images, + "use_main_content_only": use_main_content_only, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), @@ -259,6 +261,7 @@ def web_scrape_sitemap( self, *, domain: str, + max_links: int | 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, @@ -275,6 +278,9 @@ def web_scrape_sitemap( domain: Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be automatically normalized and validated. + max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. + Minimum is 1, maximum is 100,000. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -290,7 +296,13 @@ def web_scrape_sitemap( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"domain": domain}, web_web_scrape_sitemap_params.WebWebScrapeSitemapParams), + query=maybe_transform( + { + "domain": domain, + "max_links": max_links, + }, + web_web_scrape_sitemap_params.WebWebScrapeSitemapParams, + ), ), cast_to=WebWebScrapeSitemapResponse, ) @@ -303,7 +315,7 @@ def with_raw_response(self) -> AsyncWebResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers """ return AsyncWebResourceWithRawResponse(self) @@ -312,7 +324,7 @@ def with_streaming_response(self) -> AsyncWebResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response + For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response """ return AsyncWebResourceWithStreamingResponse(self) @@ -393,10 +405,8 @@ async def web_scrape_html( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeHTMLResponse: - """Scrapes the given URL and returns the raw HTML content of the page. - - Uses - automatic proxy escalation to handle blocked sites. + """ + Scrapes the given URL and returns the raw HTML content of the page. Args: url: Full URL to scrape (must include http:// or https:// protocol) @@ -468,6 +478,7 @@ async def web_scrape_md( include_images: bool | Omit = omit, include_links: bool | Omit = omit, shorten_base64_images: bool | Omit = omit, + use_main_content_only: bool | 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, @@ -476,9 +487,8 @@ async def web_scrape_md( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeMdResponse: """ - Scrapes the given URL, converts the HTML content to GitHub Flavored Markdown - (GFM), and returns the result. Uses automatic proxy escalation to handle blocked - sites. + Scrapes the given URL, converts the HTML content to Markdown, and returns the + result. Args: url: Full URL to scrape and convert to markdown (must include http:// or https:// @@ -490,6 +500,9 @@ async def web_scrape_md( shorten_base64_images: Shorten base64-encoded image data in the Markdown output + use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars, + and navigation + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -511,6 +524,7 @@ async def web_scrape_md( "include_images": include_images, "include_links": include_links, "shorten_base64_images": shorten_base64_images, + "use_main_content_only": use_main_content_only, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), @@ -522,6 +536,7 @@ async def web_scrape_sitemap( self, *, domain: str, + max_links: int | 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, @@ -538,6 +553,9 @@ async def web_scrape_sitemap( domain: Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be automatically normalized and validated. + max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. + Minimum is 1, maximum is 100,000. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -554,7 +572,11 @@ async def web_scrape_sitemap( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( - {"domain": domain}, web_web_scrape_sitemap_params.WebWebScrapeSitemapParams + { + "domain": domain, + "max_links": max_links, + }, + web_web_scrape_sitemap_params.WebWebScrapeSitemapParams, ), ), cast_to=WebWebScrapeSitemapResponse, diff --git a/src/context/dev/types/web_web_scrape_images_response.py b/src/context/dev/types/web_web_scrape_images_response.py index 26d8fce..c1622c7 100644 --- a/src/context/dev/types/web_web_scrape_images_response.py +++ b/src/context/dev/types/web_web_scrape_images_response.py @@ -12,7 +12,7 @@ class Image(BaseModel): alt: Optional[str] = None """Alt text of the image, or null if not present""" - element: Literal["img", "svg", "link", "source", "video"] + element: Literal["img", "svg", "link", "source", "video", "css", "object", "meta", "background"] """The HTML element the image was found in""" src: str diff --git a/src/context/dev/types/web_web_scrape_md_params.py b/src/context/dev/types/web_web_scrape_md_params.py index 28765b0..d556da1 100644 --- a/src/context/dev/types/web_web_scrape_md_params.py +++ b/src/context/dev/types/web_web_scrape_md_params.py @@ -24,3 +24,9 @@ class WebWebScrapeMdParams(TypedDict, total=False): shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")] """Shorten base64-encoded image data in the Markdown output""" + + use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")] + """ + Extract only the main content of the page, excluding headers, footers, sidebars, + and navigation + """ diff --git a/src/context/dev/types/web_web_scrape_sitemap_params.py b/src/context/dev/types/web_web_scrape_sitemap_params.py index 2ad3d83..f78f498 100644 --- a/src/context/dev/types/web_web_scrape_sitemap_params.py +++ b/src/context/dev/types/web_web_scrape_sitemap_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["WebWebScrapeSitemapParams"] @@ -13,3 +15,9 @@ class WebWebScrapeSitemapParams(TypedDict, total=False): The domain will be automatically normalized and validated. """ + + max_links: Annotated[int, PropertyInfo(alias="maxLinks")] + """Maximum number of links to return from the sitemap crawl. + + Defaults to 10,000. Minimum is 1, maximum is 100,000. + """ diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index c837e7d..417d5be 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -152,6 +152,7 @@ def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None: include_images=True, include_links=True, shorten_base64_images=True, + use_main_content_only=True, ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"]) @@ -189,6 +190,15 @@ def test_method_web_scrape_sitemap(self, client: ContextDev) -> None: ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_web_scrape_sitemap_with_all_params(self, client: ContextDev) -> None: + web = client.web.web_scrape_sitemap( + domain="domain", + max_links=1, + ) + assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_web_scrape_sitemap(self, client: ContextDev) -> None: @@ -350,6 +360,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncCon include_images=True, include_links=True, shorten_base64_images=True, + use_main_content_only=True, ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"]) @@ -387,6 +398,15 @@ async def test_method_web_scrape_sitemap(self, async_client: AsyncContextDev) -> ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_web_scrape_sitemap_with_all_params(self, async_client: AsyncContextDev) -> None: + web = await async_client.web.web_scrape_sitemap( + domain="domain", + max_links=1, + ) + assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_web_scrape_sitemap(self, async_client: AsyncContextDev) -> None: