Skip to content

Commit 20899c0

Browse files
release: 0.9.0 (#87)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent daf1cc2 commit 20899c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1394
-778
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.8.0"
2+
".": "0.9.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-db7245c74772a8cd47c02886619fed0568fbb58b1fa8aba0dc77524b924a4fb6.yml
3-
openapi_spec_hash: ca3de8d7b14b78683e39464fe7d4b1e1
4-
config_hash: 410f8a2f86f605885911277be47c3c78
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-c8152db455001be3f09a3bc60d63711699d2c2a4ea5f7bbc1d71726efda0fd9b.yml
3+
openapi_spec_hash: 97719df292ca220de5d35d36f9756b95
4+
config_hash: ae81af9b7eb88a788a80bcf3480e0b6b

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## 0.9.0 (2025-10-28)
4+
5+
Full Changelog: [v0.8.0...v0.9.0](https://github.com/ContextualAI/contextual-client-python/compare/v0.8.0...v0.9.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([3ebbcab](https://github.com/ContextualAI/contextual-client-python/commit/3ebbcab780e0391c420126b8cbf11589aba78470))
10+
* improve future compat with pydantic v3 ([2837532](https://github.com/ContextualAI/contextual-client-python/commit/2837532cb8930994be7d02c356421a1a3e990c78))
11+
* **types:** replace List[str] with SequenceNotStr in params ([ee66bc5](https://github.com/ContextualAI/contextual-client-python/commit/ee66bc5ce67fefb92b384ea979475ed54a53af9d))
12+
13+
14+
### Bug Fixes
15+
16+
* avoid newer type syntax ([551b56e](https://github.com/ContextualAI/contextual-client-python/commit/551b56e22af03e8305e599814f484a5ed64b9cb3))
17+
* **compat:** compat with `pydantic&lt;2.8.0` when using additional fields ([ceb597f](https://github.com/ContextualAI/contextual-client-python/commit/ceb597f1da87f0e2ae718a6143ec57c60b8f4d3d))
18+
19+
20+
### Chores
21+
22+
* bump `httpx-aiohttp` version to 0.1.9 ([bdcc7c6](https://github.com/ContextualAI/contextual-client-python/commit/bdcc7c6b9c7784c25b49debbcadca2307c43e5b6))
23+
* do not install brew dependencies in ./scripts/bootstrap by default ([41397b2](https://github.com/ContextualAI/contextual-client-python/commit/41397b25ce468bf58ed53e8e78e7cea2fcf41a47))
24+
* **internal:** add Sequence related utils ([f00b892](https://github.com/ContextualAI/contextual-client-python/commit/f00b892536ef8c2d6f67965d7db28a1956adebb5))
25+
* **internal:** detect missing future annotations with ruff ([6958d77](https://github.com/ContextualAI/contextual-client-python/commit/6958d772079b5f5571e7db3c39255d146b11dd5b))
26+
* **internal:** improve examples ([c6f06b9](https://github.com/ContextualAI/contextual-client-python/commit/c6f06b9b0859a68bb32fa96294443abd139070e4))
27+
* **internal:** move mypy configurations to `pyproject.toml` file ([57b4284](https://github.com/ContextualAI/contextual-client-python/commit/57b42849dd5340b2ce21aa8b6b8fb0c7e15529ba))
28+
* **internal:** update pydantic dependency ([35223af](https://github.com/ContextualAI/contextual-client-python/commit/35223af9a91cc39d4800294b7821480ac2d2b0ee))
29+
* **internal:** update pyright exclude list ([e89669e](https://github.com/ContextualAI/contextual-client-python/commit/e89669e93ed4a4e74993adfee5756b3502719e8c))
30+
* **tests:** simplify `get_platform` test ([1f089bd](https://github.com/ContextualAI/contextual-client-python/commit/1f089bdf7319dee3c726d844d11f35a924cfdcc4))
31+
* **types:** change optional parameter type from NotGiven to Omit ([07ee8a4](https://github.com/ContextualAI/contextual-client-python/commit/07ee8a4cecd02070a7fd44d1daec9687af2fce45))
32+
333
## 0.8.0 (2025-08-26)
434

535
Full Changelog: [v0.7.0...v0.8.0](https://github.com/ContextualAI/contextual-client-python/compare/v0.7.0...v0.8.0)

api.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Methods:
4343
- <code title="get /datastores/{datastore_id}/documents/{document_id}/parse">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">get_parse_result</a>(document_id, \*, datastore_id, \*\*<a href="src/contextual/types/datastores/document_get_parse_result_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_get_parse_result_response.py">DocumentGetParseResultResponse</a></code>
4444
- <code title="post /datastores/{datastore_id}/documents">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">ingest</a>(datastore_id, \*\*<a href="src/contextual/types/datastores/document_ingest_params.py">params</a>) -> <a href="./src/contextual/types/datastores/ingestion_response.py">IngestionResponse</a></code>
4545
- <code title="get /datastores/{datastore_id}/documents/{document_id}/metadata">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">metadata</a>(document_id, \*, datastore_id) -> <a href="./src/contextual/types/datastores/document_metadata.py">DocumentMetadata</a></code>
46-
- <code title="post /datastores/{datastore_id}/documents/{document_id}/metadata">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">set_metadata</a>(document_id, \*, datastore_id, \*\*<a href="src/contextual/types/datastores/document_set_metadata_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_metadata.py">DocumentMetadata</a></code>
46+
- <code title="put /datastores/{datastore_id}/documents/{document_id}/metadata">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">set_metadata</a>(document_id, \*, datastore_id, \*\*<a href="src/contextual/types/datastores/document_set_metadata_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_metadata.py">DocumentMetadata</a></code>
4747

4848
# Agents
4949

@@ -79,13 +79,18 @@ Methods:
7979
Types:
8080

8181
```python
82-
from contextual.types.agents import QueryResponse, RetrievalInfoResponse, QueryMetricsResponse
82+
from contextual.types.agents import (
83+
QueryResponse,
84+
RetrievalInfoResponse,
85+
QueryFeedbackResponse,
86+
QueryMetricsResponse,
87+
)
8388
```
8489

8590
Methods:
8691

8792
- <code title="post /agents/{agent_id}/query">client.agents.query.<a href="./src/contextual/resources/agents/query.py">create</a>(agent_id, \*\*<a href="src/contextual/types/agents/query_create_params.py">params</a>) -> <a href="./src/contextual/types/agents/query_response.py">QueryResponse</a></code>
88-
- <code title="post /agents/{agent_id}/feedback">client.agents.query.<a href="./src/contextual/resources/agents/query.py">feedback</a>(agent_id, \*\*<a href="src/contextual/types/agents/query_feedback_params.py">params</a>) -> object</code>
93+
- <code title="post /agents/{agent_id}/feedback">client.agents.query.<a href="./src/contextual/resources/agents/query.py">feedback</a>(agent_id, \*\*<a href="src/contextual/types/agents/query_feedback_params.py">params</a>) -> <a href="./src/contextual/types/agents/query_feedback_response.py">QueryFeedbackResponse</a></code>
8994
- <code title="get /agents/{agent_id}/metrics">client.agents.query.<a href="./src/contextual/resources/agents/query.py">metrics</a>(agent_id, \*\*<a href="src/contextual/types/agents/query_metrics_params.py">params</a>) -> <a href="./src/contextual/types/agents/query_metrics_response.py">QueryMetricsResponse</a></code>
9095
- <code title="get /agents/{agent_id}/query/{message_id}/retrieval/info">client.agents.query.<a href="./src/contextual/resources/agents/query.py">retrieval_info</a>(message_id, \*, agent_id, \*\*<a href="src/contextual/types/agents/query_retrieval_info_params.py">params</a>) -> <a href="./src/contextual/types/agents/retrieval_info_response.py">RetrievalInfoResponse</a></code>
9196

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "contextual-client"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
description = "The official Python library for the Contextual AI API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -39,7 +39,7 @@ Homepage = "https://github.com/ContextualAI/contextual-client-python"
3939
Repository = "https://github.com/ContextualAI/contextual-client-python"
4040

4141
[project.optional-dependencies]
42-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
42+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
4343

4444
[tool.rye]
4545
managed = true
@@ -56,7 +56,6 @@ dev-dependencies = [
5656
"dirty-equals>=0.6.0",
5757
"importlib-metadata>=6.7.0",
5858
"rich>=13.7.1",
59-
"nest_asyncio==1.6.0",
6059
"pytest-xdist>=3.6.1",
6160
]
6261

@@ -148,6 +147,7 @@ exclude = [
148147
"_dev",
149148
".venv",
150149
".nox",
150+
".git",
151151
]
152152

153153
reportImplicitOverride = true
@@ -156,6 +156,58 @@ reportOverlappingOverload = false
156156
reportImportCycles = false
157157
reportPrivateUsage = false
158158

159+
[tool.mypy]
160+
pretty = true
161+
show_error_codes = true
162+
163+
# Exclude _files.py because mypy isn't smart enough to apply
164+
# the correct type narrowing and as this is an internal module
165+
# it's fine to just use Pyright.
166+
#
167+
# We also exclude our `tests` as mypy doesn't always infer
168+
# types correctly and Pyright will still catch any type errors.
169+
exclude = ['src/contextual/_files.py', '_dev/.*.py', 'tests/.*']
170+
171+
strict_equality = true
172+
implicit_reexport = true
173+
check_untyped_defs = true
174+
no_implicit_optional = true
175+
176+
warn_return_any = true
177+
warn_unreachable = true
178+
warn_unused_configs = true
179+
180+
# Turn these options off as it could cause conflicts
181+
# with the Pyright options.
182+
warn_unused_ignores = false
183+
warn_redundant_casts = false
184+
185+
disallow_any_generics = true
186+
disallow_untyped_defs = true
187+
disallow_untyped_calls = true
188+
disallow_subclassing_any = true
189+
disallow_incomplete_defs = true
190+
disallow_untyped_decorators = true
191+
cache_fine_grained = true
192+
193+
# By default, mypy reports an error if you assign a value to the result
194+
# of a function call that doesn't return anything. We do this in our test
195+
# cases:
196+
# ```
197+
# result = ...
198+
# assert result is None
199+
# ```
200+
# Changing this codegen to make mypy happy would increase complexity
201+
# and would not be worth it.
202+
disable_error_code = "func-returns-value,overload-cannot-match"
203+
204+
# https://github.com/python/mypy/issues/12162
205+
[[tool.mypy.overrides]]
206+
module = "black.files.*"
207+
ignore_errors = true
208+
ignore_missing_imports = true
209+
210+
159211
[tool.ruff]
160212
line-length = 120
161213
output-format = "grouped"
@@ -172,6 +224,8 @@ select = [
172224
"B",
173225
# remove unused imports
174226
"F401",
227+
# check for missing future annotations
228+
"FA102",
175229
# bare except statements
176230
"E722",
177231
# unused arguments
@@ -194,6 +248,8 @@ unfixable = [
194248
"T203",
195249
]
196250

251+
extend-safe-fixes = ["FA102"]
252+
197253
[tool.ruff.lint.flake8-tidy-imports.banned-api]
198254
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
199255

requirements-dev.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ httpx==0.28.1
5656
# via contextual-client
5757
# via httpx-aiohttp
5858
# via respx
59-
httpx-aiohttp==0.1.8
59+
httpx-aiohttp==0.1.9
6060
# via contextual-client
6161
idna==3.4
6262
# via anyio
@@ -75,7 +75,6 @@ multidict==6.4.4
7575
mypy==1.14.1
7676
mypy-extensions==1.0.0
7777
# via mypy
78-
nest-asyncio==1.6.0
7978
nodeenv==1.8.0
8079
# via pyright
8180
nox==2023.4.22
@@ -89,9 +88,9 @@ pluggy==1.5.0
8988
propcache==0.3.1
9089
# via aiohttp
9190
# via yarl
92-
pydantic==2.10.3
91+
pydantic==2.11.9
9392
# via contextual-client
94-
pydantic-core==2.27.1
93+
pydantic-core==2.33.2
9594
# via pydantic
9695
pygments==2.18.0
9796
# via rich
@@ -127,6 +126,9 @@ typing-extensions==4.12.2
127126
# via pydantic
128127
# via pydantic-core
129128
# via pyright
129+
# via typing-inspection
130+
typing-inspection==0.4.1
131+
# via pydantic
130132
virtualenv==20.24.5
131133
# via nox
132134
yarl==1.20.0

requirements.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ httpcore==1.0.9
4343
httpx==0.28.1
4444
# via contextual-client
4545
# via httpx-aiohttp
46-
httpx-aiohttp==0.1.8
46+
httpx-aiohttp==0.1.9
4747
# via contextual-client
4848
idna==3.4
4949
# via anyio
@@ -55,9 +55,9 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.10.3
58+
pydantic==2.11.9
5959
# via contextual-client
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
6868
# via multidict
6969
# via pydantic
7070
# via pydantic-core
71+
# via typing-inspection
72+
typing-inspection==0.4.1
73+
# via pydantic
7174
yarl==1.20.0
7275
# via aiohttp

scripts/bootstrap

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
88
brew bundle check >/dev/null 2>&1 || {
9-
echo "==> Installing Homebrew dependencies…"
10-
brew bundle
9+
echo -n "==> Install Homebrew dependencies? (y/N): "
10+
read -r response
11+
case "$response" in
12+
[yY][eE][sS]|[yY])
13+
brew bundle
14+
;;
15+
*)
16+
;;
17+
esac
18+
echo
1119
}
1220
fi
1321

src/contextual/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing as _t
44

55
from . import types
6-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
77
from ._utils import file_from_path
88
from ._client import (
99
Client,
@@ -48,7 +48,9 @@
4848
"ProxiesTypes",
4949
"NotGiven",
5050
"NOT_GIVEN",
51+
"not_given",
5152
"Omit",
53+
"omit",
5254
"ContextualAIError",
5355
"APIError",
5456
"APIStatusError",

0 commit comments

Comments
 (0)