raccoonai 0.1.0a1__tar.gz → 0.1.0a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of raccoonai might be problematic. Click here for more details.
- raccoonai-0.1.0a3/.release-please-manifest.json +3 -0
- raccoonai-0.1.0a3/CHANGELOG.md +35 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/PKG-INFO +6 -6
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/README.md +5 -5
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/pyproject.toml +2 -2
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/requirements-dev.lock +1 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_base_client.py +9 -2
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_constants.py +1 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_models.py +8 -2
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_transform.py +11 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_version.py +1 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/resources/lam.py +84 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/fleet_create_response.py +3 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_extract_params.py +18 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_extract_response.py +3 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_integration_run_params.py +23 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_integration_run_response.py +6 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_run_params.py +18 -1
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/lam_run_response.py +3 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/api_resources/test_fleet.py +4 -4
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/api_resources/test_lam.py +60 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_client.py +26 -8
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_transform.py +10 -1
- raccoonai-0.1.0a1/.release-please-manifest.json +0 -3
- raccoonai-0.1.0a1/CHANGELOG.md +0 -9
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/.gitignore +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/CONTRIBUTING.md +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/LICENSE +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/SECURITY.md +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/api.md +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/bin/check-release-environment +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/bin/publish-pypi +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/examples/.keep +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/mypy.ini +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/noxfile.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/release-please-config.json +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/requirements.lock +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_client.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_compat.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_exceptions.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_files.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_qs.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_resource.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_response.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_streaming.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_types.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_logs.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_proxy.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_reflection.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_streams.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_sync.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_typing.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/_utils/_utils.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/lib/.keep +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/py.typed +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/resources/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/resources/fleet.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/fleet_create_params.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/fleet_logs_response.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/fleet_status_response.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/src/raccoonai/types/fleet_terminate_response.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/api_resources/__init__.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/conftest.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/sample_file.txt +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_deepcopy.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_extract_files.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_files.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_models.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_qs.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_required_args.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_response.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_streaming.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_utils/test_proxy.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/test_utils/test_typing.py +0 -0
- {raccoonai-0.1.0a1 → raccoonai-0.1.0a3}/tests/utils.py +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0-alpha.3 (2025-02-13)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/flyingraccoonai/raccoonai-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#13](https://github.com/flyingraccoonai/raccoonai-python/issues/13)) ([72b8d09](https://github.com/flyingraccoonai/raccoonai-python/commit/72b8d0941c8b4e3d4c880815a4bfd4f92ab3f208))
|
|
10
|
+
* **client:** send `X-Stainless-Read-Timeout` header ([#9](https://github.com/flyingraccoonai/raccoonai-python/issues/9)) ([8034585](https://github.com/flyingraccoonai/raccoonai-python/commit/80345850aeeb00d8551d467804554b33216866a4))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* **internal:** bummp ruff dependency ([#8](https://github.com/flyingraccoonai/raccoonai-python/issues/8)) ([248b017](https://github.com/flyingraccoonai/raccoonai-python/commit/248b017f449a20d44fd9d3f750b61713c2267b08))
|
|
16
|
+
* **internal:** change default timeout to an int ([#6](https://github.com/flyingraccoonai/raccoonai-python/issues/6)) ([b889fd3](https://github.com/flyingraccoonai/raccoonai-python/commit/b889fd33d45027dcb9a388be08096e7dc7a1ab9c))
|
|
17
|
+
* **internal:** fix type traversing dictionary params ([#10](https://github.com/flyingraccoonai/raccoonai-python/issues/10)) ([4f5365b](https://github.com/flyingraccoonai/raccoonai-python/commit/4f5365bb697819c392bb4e9bc162f7f9f051fdbf))
|
|
18
|
+
* **internal:** minor type handling changes ([#11](https://github.com/flyingraccoonai/raccoonai-python/issues/11)) ([9e102a6](https://github.com/flyingraccoonai/raccoonai-python/commit/9e102a69172abf65c913290656137e52b1519d4e))
|
|
19
|
+
* **internal:** update client tests ([#12](https://github.com/flyingraccoonai/raccoonai-python/issues/12)) ([13f2190](https://github.com/flyingraccoonai/raccoonai-python/commit/13f2190c2e9fd7d4b6f3159a962d47ef6c2d9316))
|
|
20
|
+
|
|
21
|
+
## 0.1.0-alpha.2 (2025-01-29)
|
|
22
|
+
|
|
23
|
+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/flyingraccoonai/raccoonai-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **api:** api update ([#3](https://github.com/flyingraccoonai/raccoonai-python/issues/3)) ([e251dc3](https://github.com/flyingraccoonai/raccoonai-python/commit/e251dc358ce3cc88ef81c20911125a237cd88d07))
|
|
28
|
+
|
|
29
|
+
## 0.1.0-alpha.1 (2025-01-24)
|
|
30
|
+
|
|
31
|
+
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/flyingraccoonai/raccoonai-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **api:** update via SDK Studio ([b4beda1](https://github.com/flyingraccoonai/raccoonai-python/commit/b4beda18093cfb681ade68610e307b7ce07fa4d2))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: raccoonai
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a3
|
|
4
4
|
Summary: The official Python library for the raccoonAI API
|
|
5
5
|
Project-URL: Homepage, https://github.com/flyingraccoonai/raccoonai-python
|
|
6
6
|
Project-URL: Repository, https://github.com/flyingraccoonai/raccoonai-python
|
|
@@ -69,7 +69,7 @@ response = client.lam.run(
|
|
|
69
69
|
query="Find the price of iphone 16 on Amazon.",
|
|
70
70
|
raccoon_passcode="<end-user-raccoon-passcode>",
|
|
71
71
|
)
|
|
72
|
-
print(response.
|
|
72
|
+
print(response.livestream_url)
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
While you can provide a `secret_key` keyword argument,
|
|
@@ -98,7 +98,7 @@ async def main() -> None:
|
|
|
98
98
|
query="Find the price of iphone 16 on Amazon.",
|
|
99
99
|
raccoon_passcode="<end-user-raccoon-passcode>",
|
|
100
100
|
)
|
|
101
|
-
print(response.
|
|
101
|
+
print(response.livestream_url)
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
asyncio.run(main())
|
|
@@ -121,7 +121,7 @@ stream = client.lam.run(
|
|
|
121
121
|
stream=True,
|
|
122
122
|
)
|
|
123
123
|
for response in stream:
|
|
124
|
-
print(response.
|
|
124
|
+
print(response.livestream_url)
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
The async client uses the exact same interface.
|
|
@@ -137,7 +137,7 @@ stream = await client.lam.run(
|
|
|
137
137
|
stream=True,
|
|
138
138
|
)
|
|
139
139
|
async for response in stream:
|
|
140
|
-
print(response.
|
|
140
|
+
print(response.livestream_url)
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
## Using types
|
|
@@ -288,7 +288,7 @@ response = client.lam.with_raw_response.run(
|
|
|
288
288
|
print(response.headers.get('X-My-Header'))
|
|
289
289
|
|
|
290
290
|
lam = response.parse() # get the object that `lam.run()` would have returned
|
|
291
|
-
print(lam.
|
|
291
|
+
print(lam.livestream_url)
|
|
292
292
|
```
|
|
293
293
|
|
|
294
294
|
These methods return an [`APIResponse`](https://github.com/flyingraccoonai/raccoonai-python/tree/main/src/raccoonai/_response.py) object.
|
|
@@ -37,7 +37,7 @@ response = client.lam.run(
|
|
|
37
37
|
query="Find the price of iphone 16 on Amazon.",
|
|
38
38
|
raccoon_passcode="<end-user-raccoon-passcode>",
|
|
39
39
|
)
|
|
40
|
-
print(response.
|
|
40
|
+
print(response.livestream_url)
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
While you can provide a `secret_key` keyword argument,
|
|
@@ -66,7 +66,7 @@ async def main() -> None:
|
|
|
66
66
|
query="Find the price of iphone 16 on Amazon.",
|
|
67
67
|
raccoon_passcode="<end-user-raccoon-passcode>",
|
|
68
68
|
)
|
|
69
|
-
print(response.
|
|
69
|
+
print(response.livestream_url)
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
asyncio.run(main())
|
|
@@ -89,7 +89,7 @@ stream = client.lam.run(
|
|
|
89
89
|
stream=True,
|
|
90
90
|
)
|
|
91
91
|
for response in stream:
|
|
92
|
-
print(response.
|
|
92
|
+
print(response.livestream_url)
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
The async client uses the exact same interface.
|
|
@@ -105,7 +105,7 @@ stream = await client.lam.run(
|
|
|
105
105
|
stream=True,
|
|
106
106
|
)
|
|
107
107
|
async for response in stream:
|
|
108
|
-
print(response.
|
|
108
|
+
print(response.livestream_url)
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
## Using types
|
|
@@ -256,7 +256,7 @@ response = client.lam.with_raw_response.run(
|
|
|
256
256
|
print(response.headers.get('X-My-Header'))
|
|
257
257
|
|
|
258
258
|
lam = response.parse() # get the object that `lam.run()` would have returned
|
|
259
|
-
print(lam.
|
|
259
|
+
print(lam.livestream_url)
|
|
260
260
|
```
|
|
261
261
|
|
|
262
262
|
These methods return an [`APIResponse`](https://github.com/flyingraccoonai/raccoonai-python/tree/main/src/raccoonai/_response.py) object.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "raccoonai"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.3"
|
|
4
4
|
description = "The official Python library for the raccoonAI API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -177,7 +177,7 @@ select = [
|
|
|
177
177
|
"T201",
|
|
178
178
|
"T203",
|
|
179
179
|
# misuse of typing.TYPE_CHECKING
|
|
180
|
-
"
|
|
180
|
+
"TC004",
|
|
181
181
|
# import rules
|
|
182
182
|
"TID251",
|
|
183
183
|
]
|
|
@@ -418,10 +418,17 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
418
418
|
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
|
|
419
419
|
headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
|
|
420
420
|
|
|
421
|
-
# Don't set
|
|
421
|
+
# Don't set these headers if they were already set or removed by the caller. We check
|
|
422
422
|
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
|
|
423
|
-
|
|
423
|
+
lower_custom_headers = [header.lower() for header in custom_headers]
|
|
424
|
+
if "x-stainless-retry-count" not in lower_custom_headers:
|
|
424
425
|
headers["x-stainless-retry-count"] = str(retries_taken)
|
|
426
|
+
if "x-stainless-read-timeout" not in lower_custom_headers:
|
|
427
|
+
timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout
|
|
428
|
+
if isinstance(timeout, Timeout):
|
|
429
|
+
timeout = timeout.read
|
|
430
|
+
if timeout is not None:
|
|
431
|
+
headers["x-stainless-read-timeout"] = str(timeout)
|
|
425
432
|
|
|
426
433
|
return headers
|
|
427
434
|
|
|
@@ -6,7 +6,7 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
|
|
|
6
6
|
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
|
|
7
7
|
|
|
8
8
|
# default timeout is 1 minute
|
|
9
|
-
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60
|
|
9
|
+
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
|
|
10
10
|
DEFAULT_MAX_RETRIES = 2
|
|
11
11
|
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
|
|
12
12
|
|
|
@@ -172,7 +172,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
172
172
|
@override
|
|
173
173
|
def __str__(self) -> str:
|
|
174
174
|
# mypy complains about an invalid self arg
|
|
175
|
-
return f
|
|
175
|
+
return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc]
|
|
176
176
|
|
|
177
177
|
# Override the 'construct' method in a way that supports recursive parsing without validation.
|
|
178
178
|
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
|
|
@@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
|
426
426
|
|
|
427
427
|
If the given value does not match the expected type then it is returned as-is.
|
|
428
428
|
"""
|
|
429
|
+
|
|
430
|
+
# store a reference to the original type we were given before we extract any inner
|
|
431
|
+
# types so that we can properly resolve forward references in `TypeAliasType` annotations
|
|
432
|
+
original_type = None
|
|
433
|
+
|
|
429
434
|
# we allow `object` as the input type because otherwise, passing things like
|
|
430
435
|
# `Literal['value']` will be reported as a type error by type checkers
|
|
431
436
|
type_ = cast("type[object]", type_)
|
|
432
437
|
if is_type_alias_type(type_):
|
|
438
|
+
original_type = type_ # type: ignore[unreachable]
|
|
433
439
|
type_ = type_.__value__ # type: ignore[unreachable]
|
|
434
440
|
|
|
435
441
|
# unwrap `Annotated[T, ...]` -> `T`
|
|
@@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
|
446
452
|
|
|
447
453
|
if is_union(origin):
|
|
448
454
|
try:
|
|
449
|
-
return validate_type(type_=cast("type[object]", type_), value=value)
|
|
455
|
+
return validate_type(type_=cast("type[object]", original_type or type_), value=value)
|
|
450
456
|
except Exception:
|
|
451
457
|
pass
|
|
452
458
|
|
|
@@ -25,7 +25,7 @@ from ._typing import (
|
|
|
25
25
|
is_annotated_type,
|
|
26
26
|
strip_annotated_type,
|
|
27
27
|
)
|
|
28
|
-
from .._compat import model_dump, is_typeddict
|
|
28
|
+
from .._compat import get_origin, model_dump, is_typeddict
|
|
29
29
|
|
|
30
30
|
_T = TypeVar("_T")
|
|
31
31
|
|
|
@@ -164,9 +164,14 @@ def _transform_recursive(
|
|
|
164
164
|
inner_type = annotation
|
|
165
165
|
|
|
166
166
|
stripped_type = strip_annotated_type(inner_type)
|
|
167
|
+
origin = get_origin(stripped_type) or stripped_type
|
|
167
168
|
if is_typeddict(stripped_type) and is_mapping(data):
|
|
168
169
|
return _transform_typeddict(data, stripped_type)
|
|
169
170
|
|
|
171
|
+
if origin == dict and is_mapping(data):
|
|
172
|
+
items_type = get_args(stripped_type)[1]
|
|
173
|
+
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
|
174
|
+
|
|
170
175
|
if (
|
|
171
176
|
# List[T]
|
|
172
177
|
(is_list_type(stripped_type) and is_list(data))
|
|
@@ -307,9 +312,14 @@ async def _async_transform_recursive(
|
|
|
307
312
|
inner_type = annotation
|
|
308
313
|
|
|
309
314
|
stripped_type = strip_annotated_type(inner_type)
|
|
315
|
+
origin = get_origin(stripped_type) or stripped_type
|
|
310
316
|
if is_typeddict(stripped_type) and is_mapping(data):
|
|
311
317
|
return await _async_transform_typeddict(data, stripped_type)
|
|
312
318
|
|
|
319
|
+
if origin == dict and is_mapping(data):
|
|
320
|
+
items_type = get_args(stripped_type)[1]
|
|
321
|
+
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
|
322
|
+
|
|
313
323
|
if (
|
|
314
324
|
# List[T]
|
|
315
325
|
(is_list_type(stripped_type) and is_list(data))
|