raccoonai 0.1.0a17__py3-none-any.whl → 0.1.0a18__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,5 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import typing as _t
4
+
3
5
  from . import types
4
6
  from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
5
7
  from ._utils import file_from_path
@@ -80,6 +82,9 @@ __all__ = [
80
82
  "DefaultAsyncHttpxClient",
81
83
  ]
82
84
 
85
+ if not _t.TYPE_CHECKING:
86
+ from ._utils._resources_proxy import resources as resources
87
+
83
88
  _setup_logging()
84
89
 
85
90
  # Update the __module__ attribute for exported symbols so that
raccoonai/_base_client.py CHANGED
@@ -960,6 +960,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
960
960
  if self.custom_auth is not None:
961
961
  kwargs["auth"] = self.custom_auth
962
962
 
963
+ if options.follow_redirects is not None:
964
+ kwargs["follow_redirects"] = options.follow_redirects
965
+
963
966
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964
967
 
965
968
  response = None
@@ -1068,7 +1071,14 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1068
1071
  ) -> ResponseT:
1069
1072
  origin = get_origin(cast_to) or cast_to
1070
1073
 
1071
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074
+ if (
1075
+ inspect.isclass(origin)
1076
+ and issubclass(origin, BaseAPIResponse)
1077
+ # we only want to actually return the custom BaseAPIResponse class if we're
1078
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1079
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081
+ ):
1072
1082
  if not issubclass(origin, APIResponse):
1073
1083
  raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
1074
1084
 
@@ -1460,6 +1470,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1460
1470
  if self.custom_auth is not None:
1461
1471
  kwargs["auth"] = self.custom_auth
1462
1472
 
1473
+ if options.follow_redirects is not None:
1474
+ kwargs["follow_redirects"] = options.follow_redirects
1475
+
1463
1476
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
1464
1477
 
1465
1478
  response = None
@@ -1568,7 +1581,14 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1568
1581
  ) -> ResponseT:
1569
1582
  origin = get_origin(cast_to) or cast_to
1570
1583
 
1571
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584
+ if (
1585
+ inspect.isclass(origin)
1586
+ and issubclass(origin, BaseAPIResponse)
1587
+ # we only want to actually return the custom BaseAPIResponse class if we're
1588
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1589
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591
+ ):
1572
1592
  if not issubclass(origin, AsyncAPIResponse):
1573
1593
  raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
1574
1594
 
raccoonai/_models.py CHANGED
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
737
737
  idempotency_key: str
738
738
  json_data: Body
739
739
  extra_json: AnyMapping
740
+ follow_redirects: bool
740
741
 
741
742
 
742
743
  @final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
750
751
  files: Union[HttpxRequestFiles, None] = None
751
752
  idempotency_key: Union[str, None] = None
752
753
  post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
754
+ follow_redirects: Union[bool, None] = None
753
755
 
754
756
  # It should be noted that we cannot use `json` here as that would override
755
757
  # a BaseModel method in an incompatible fashion.
raccoonai/_types.py CHANGED
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
100
100
  params: Query
101
101
  extra_json: AnyMapping
102
102
  idempotency_key: str
103
+ follow_redirects: bool
103
104
 
104
105
 
105
106
  # Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
215
216
 
216
217
  class HttpxSendArgs(TypedDict, total=False):
217
218
  auth: httpx.Auth
219
+ follow_redirects: bool
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
46
46
  @property # type: ignore
47
47
  @override
48
48
  def __class__(self) -> type: # pyright: ignore
49
- proxied = self.__get_proxied__()
49
+ try:
50
+ proxied = self.__get_proxied__()
51
+ except Exception:
52
+ return type(self)
50
53
  if issubclass(type(proxied), LazyProxy):
51
54
  return type(proxied)
52
55
  return proxied.__class__
@@ -0,0 +1,24 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+ from typing_extensions import override
5
+
6
+ from ._proxy import LazyProxy
7
+
8
+
9
+ class ResourcesProxy(LazyProxy[Any]):
10
+ """A proxy for the `raccoonai.resources` module.
11
+
12
+ This is used so that we can lazily import `raccoonai.resources` only when
13
+ needed *and* so that users can just import `raccoonai` and reference `raccoonai.resources`
14
+ """
15
+
16
+ @override
17
+ def __load__(self) -> Any:
18
+ import importlib
19
+
20
+ mod = importlib.import_module("raccoonai.resources")
21
+ return mod
22
+
23
+
24
+ resources = ResourcesProxy().__as_proxied__()
raccoonai/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "raccoonai"
4
- __version__ = "0.1.0-alpha.17" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.18" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: raccoonai
3
- Version: 0.1.0a17
3
+ Version: 0.1.0a18
4
4
  Summary: The official Python library for the raccoonAI API
5
5
  Project-URL: Homepage, https://github.com/raccoonaihq/raccoonai-python
6
6
  Project-URL: Repository, https://github.com/raccoonaihq/raccoonai-python
@@ -162,7 +162,6 @@ response = client.lam.run(
162
162
  raccoon_passcode="<end-user-raccoon-passcode>",
163
163
  advanced={
164
164
  "block_ads": True,
165
- "extension_ids": ["df2399ea-a938-438f-9d4b-ef3bc95cf8af"],
166
165
  "proxy": {
167
166
  "city": "sanfrancisco",
168
167
  "country": "us",
@@ -1,22 +1,23 @@
1
- raccoonai/__init__.py,sha256=ut5jCAExi9IzT9pzrjpsJoVhn6bzWI6jIXNXB-fXBY4,2523
2
- raccoonai/_base_client.py,sha256=_4wTEgzlmFDSwSH0b-KYmeYbSRVzw28FfeVPCW45mUo,64847
1
+ raccoonai/__init__.py,sha256=-A6AJxDjviQFqkzoBiO5BzSEe_LEMi5pQ861niFmLtk,2634
2
+ raccoonai/_base_client.py,sha256=R9UA9AEmUXbU3sPAQ8759ehYh9UAW640OGZ356drsTA,65887
3
3
  raccoonai/_client.py,sha256=b4Du_3dCdsg2TTDuMwokhvEDTrn5CWy5bqcsubr2ZaY,18886
4
4
  raccoonai/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  raccoonai/_constants.py,sha256=FkmVVcfVS3gR69v_fTrqA_qjakyxJHOWJcw3jpEck8Y,465
6
6
  raccoonai/_exceptions.py,sha256=Y-DcD2M8xkSw8IEkk4KHj73O8GQxCtWm4HWYQ02j7z8,3226
7
7
  raccoonai/_files.py,sha256=a0SHeBu6FT5rt_CKotWZyna5GpgB42go35AUK5sEiD4,3624
8
- raccoonai/_models.py,sha256=mB2r2VWQq49jG-F0RIXDrBxPp3v-Eg12wMOtVTNxtv4,29057
8
+ raccoonai/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
9
9
  raccoonai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  raccoonai/_resource.py,sha256=zfxyYCvzutc1dvCP-j9UPc1sn9U8F-X9gGyqleOvCxY,1118
11
11
  raccoonai/_response.py,sha256=RuSNonzoPj-1q1FxDHtgUIMLvTqKLTg8GtTxrNV3XzY,28806
12
12
  raccoonai/_streaming.py,sha256=zHnkREZO5v33YJ7P0YZ7KhJET4ZzevGw1JzRY2-Mls4,10112
13
- raccoonai/_types.py,sha256=sN2zE-vBl9KBlBKL8fkN2DNZnItdjDl-3fTpP9cg69w,6146
14
- raccoonai/_version.py,sha256=-4VebHqdGC83aHpDGnNl7cMy5RMFsTh4VTwZnBUJ5cg,170
13
+ raccoonai/_types.py,sha256=nkB-Qzpl6R51fi6nwZsLH73N43GgXxZqG3KJ51pm8-o,6200
14
+ raccoonai/_version.py,sha256=pjqr1cd84GFAJEhrOZvHafZ9dAJuD3dgemPBXa1ZGj4,170
15
15
  raccoonai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  raccoonai/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  raccoonai/_utils/_logs.py,sha256=Af3FKkE-LAPzYTl8bnFD4yPvPBIO-QyCra-r9_dSmOM,784
18
- raccoonai/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
18
+ raccoonai/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
19
19
  raccoonai/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
+ raccoonai/_utils/_resources_proxy.py,sha256=rlNyHdV3OTAHOl9OHEyoMVhEN_mlzxq-Wb9Hz_P-Hxo,604
20
21
  raccoonai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
22
  raccoonai/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
22
23
  raccoonai/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
@@ -65,7 +66,7 @@ raccoonai/types/tail/user_create_params.py,sha256=4Pe2d2L_TqNAeBNtG92ml1zLA3wTt_
65
66
  raccoonai/types/tail/user_create_response.py,sha256=eYexuFeSkGZs58pqSLga-9D4zAwCEiX7xi6OllB3F2Q,517
66
67
  raccoonai/types/tail/user_status_params.py,sha256=gxSN0_zGeqOSKpDaoKh0O6l8j0jMyxP7f7ONIPWOVZE,459
67
68
  raccoonai/types/tail/user_status_response.py,sha256=BakDkr-yhueamBAx-wrHCUZ4h9rYJCQPnDD49paA_aU,472
68
- raccoonai-0.1.0a17.dist-info/METADATA,sha256=B_AbRyMJYqIY-sq1YU0HsBKLoTigKuuB-GjySXGQzS4,15528
69
- raccoonai-0.1.0a17.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
70
- raccoonai-0.1.0a17.dist-info/licenses/LICENSE,sha256=enGvZ2fGU7wGgMPWkgyWhnsFhCpxwdeG_selO_ovoTM,11340
71
- raccoonai-0.1.0a17.dist-info/RECORD,,
69
+ raccoonai-0.1.0a18.dist-info/METADATA,sha256=Vo2rhDy5UXTSIh1O7Lk1vFG-XssKltyrMsHsW8koh2c,15461
70
+ raccoonai-0.1.0a18.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
71
+ raccoonai-0.1.0a18.dist-info/licenses/LICENSE,sha256=enGvZ2fGU7wGgMPWkgyWhnsFhCpxwdeG_selO_ovoTM,11340
72
+ raccoonai-0.1.0a18.dist-info/RECORD,,