raccoonai 0.1.0a6__py3-none-any.whl → 0.1.0a8__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/_base_client.py +7 -1
- raccoonai/_client.py +20 -3
- raccoonai/_files.py +1 -1
- raccoonai/_version.py +1 -1
- raccoonai/resources/__init__.py +28 -0
- raccoonai/resources/extensions.py +400 -0
- raccoonai/resources/fleet.py +176 -14
- raccoonai/resources/lam.py +219 -764
- raccoonai/resources/tail/__init__.py +47 -0
- raccoonai/resources/tail/apps.py +225 -0
- raccoonai/resources/tail/auth.py +186 -0
- raccoonai/resources/tail/tail.py +273 -0
- raccoonai/types/__init__.py +10 -4
- raccoonai/types/extension_all_response.py +22 -0
- raccoonai/types/extension_get_response.py +16 -0
- raccoonai/types/extension_upload_params.py +13 -0
- raccoonai/types/extension_upload_response.py +16 -0
- raccoonai/types/fleet_create_params.py +26 -12
- raccoonai/types/fleet_create_response.py +3 -5
- raccoonai/types/fleet_sessions_params.py +42 -0
- raccoonai/types/fleet_sessions_response.py +58 -0
- raccoonai/types/fleet_status_response.py +3 -5
- raccoonai/types/fleet_terminate_response.py +3 -5
- raccoonai/types/lam_run_params.py +36 -3
- raccoonai/types/lam_run_response.py +9 -1
- raccoonai/types/lam_tasks_params.py +39 -0
- raccoonai/types/lam_tasks_response.py +52 -0
- raccoonai/types/tail/__init__.py +9 -0
- raccoonai/types/tail/app_all_response.py +38 -0
- raccoonai/types/tail/app_linked_params.py +13 -0
- raccoonai/types/tail/app_linked_response.py +14 -0
- raccoonai/types/tail/auth_status_params.py +15 -0
- raccoonai/types/tail/auth_status_response.py +17 -0
- raccoonai/types/tail_users_params.py +26 -0
- raccoonai/types/tail_users_response.py +48 -0
- {raccoonai-0.1.0a6.dist-info → raccoonai-0.1.0a8.dist-info}/METADATA +33 -16
- raccoonai-0.1.0a8.dist-info/RECORD +61 -0
- raccoonai/types/lam_extract_params.py +0 -68
- raccoonai/types/lam_extract_response.py +0 -31
- raccoonai/types/lam_integration_run_params.py +0 -57
- raccoonai/types/lam_integration_run_response.py +0 -53
- raccoonai-0.1.0a6.dist-info/RECORD +0 -44
- {raccoonai-0.1.0a6.dist-info → raccoonai-0.1.0a8.dist-info}/WHEEL +0 -0
- {raccoonai-0.1.0a6.dist-info → raccoonai-0.1.0a8.dist-info}/licenses/LICENSE +0 -0
raccoonai/_base_client.py
CHANGED
|
@@ -63,7 +63,7 @@ from ._types import (
|
|
|
63
63
|
ModelBuilderProtocol,
|
|
64
64
|
)
|
|
65
65
|
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
|
|
66
|
-
from ._compat import model_copy, model_dump
|
|
66
|
+
from ._compat import PYDANTIC_V2, model_copy, model_dump
|
|
67
67
|
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
|
|
68
68
|
from ._response import (
|
|
69
69
|
APIResponse,
|
|
@@ -207,6 +207,9 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
|
|
|
207
207
|
model: Type[_T],
|
|
208
208
|
options: FinalRequestOptions,
|
|
209
209
|
) -> None:
|
|
210
|
+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
|
|
211
|
+
self.__pydantic_private__ = {}
|
|
212
|
+
|
|
210
213
|
self._model = model
|
|
211
214
|
self._client = client
|
|
212
215
|
self._options = options
|
|
@@ -292,6 +295,9 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
|
|
|
292
295
|
client: AsyncAPIClient,
|
|
293
296
|
options: FinalRequestOptions,
|
|
294
297
|
) -> None:
|
|
298
|
+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
|
|
299
|
+
self.__pydantic_private__ = {}
|
|
300
|
+
|
|
295
301
|
self._model = model
|
|
296
302
|
self._client = client
|
|
297
303
|
self._options = options
|
raccoonai/_client.py
CHANGED
|
@@ -24,7 +24,7 @@ from ._utils import (
|
|
|
24
24
|
get_async_library,
|
|
25
25
|
)
|
|
26
26
|
from ._version import __version__
|
|
27
|
-
from .resources import lam, fleet
|
|
27
|
+
from .resources import lam, fleet, extensions
|
|
28
28
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
29
29
|
from ._exceptions import APIStatusError, RaccoonAIError
|
|
30
30
|
from ._base_client import (
|
|
@@ -32,6 +32,7 @@ from ._base_client import (
|
|
|
32
32
|
SyncAPIClient,
|
|
33
33
|
AsyncAPIClient,
|
|
34
34
|
)
|
|
35
|
+
from .resources.tail import tail
|
|
35
36
|
|
|
36
37
|
__all__ = [
|
|
37
38
|
"ENVIRONMENTS",
|
|
@@ -54,7 +55,9 @@ ENVIRONMENTS: Dict[str, str] = {
|
|
|
54
55
|
|
|
55
56
|
class RaccoonAI(SyncAPIClient):
|
|
56
57
|
lam: lam.LamResource
|
|
58
|
+
tail: tail.TailResource
|
|
57
59
|
fleet: fleet.FleetResource
|
|
60
|
+
extensions: extensions.ExtensionsResource
|
|
58
61
|
with_raw_response: RaccoonAIWithRawResponse
|
|
59
62
|
with_streaming_response: RaccoonAIWithStreamedResponse
|
|
60
63
|
|
|
@@ -87,7 +90,7 @@ class RaccoonAI(SyncAPIClient):
|
|
|
87
90
|
# part of our public interface in the future.
|
|
88
91
|
_strict_response_validation: bool = False,
|
|
89
92
|
) -> None:
|
|
90
|
-
"""Construct a new synchronous
|
|
93
|
+
"""Construct a new synchronous RaccoonAI client instance.
|
|
91
94
|
|
|
92
95
|
This automatically infers the `secret_key` argument from the `RACCOON_SECRET_KEY` environment variable if it is not provided.
|
|
93
96
|
"""
|
|
@@ -137,7 +140,9 @@ class RaccoonAI(SyncAPIClient):
|
|
|
137
140
|
)
|
|
138
141
|
|
|
139
142
|
self.lam = lam.LamResource(self)
|
|
143
|
+
self.tail = tail.TailResource(self)
|
|
140
144
|
self.fleet = fleet.FleetResource(self)
|
|
145
|
+
self.extensions = extensions.ExtensionsResource(self)
|
|
141
146
|
self.with_raw_response = RaccoonAIWithRawResponse(self)
|
|
142
147
|
self.with_streaming_response = RaccoonAIWithStreamedResponse(self)
|
|
143
148
|
|
|
@@ -250,7 +255,9 @@ class RaccoonAI(SyncAPIClient):
|
|
|
250
255
|
|
|
251
256
|
class AsyncRaccoonAI(AsyncAPIClient):
|
|
252
257
|
lam: lam.AsyncLamResource
|
|
258
|
+
tail: tail.AsyncTailResource
|
|
253
259
|
fleet: fleet.AsyncFleetResource
|
|
260
|
+
extensions: extensions.AsyncExtensionsResource
|
|
254
261
|
with_raw_response: AsyncRaccoonAIWithRawResponse
|
|
255
262
|
with_streaming_response: AsyncRaccoonAIWithStreamedResponse
|
|
256
263
|
|
|
@@ -283,7 +290,7 @@ class AsyncRaccoonAI(AsyncAPIClient):
|
|
|
283
290
|
# part of our public interface in the future.
|
|
284
291
|
_strict_response_validation: bool = False,
|
|
285
292
|
) -> None:
|
|
286
|
-
"""Construct a new async
|
|
293
|
+
"""Construct a new async AsyncRaccoonAI client instance.
|
|
287
294
|
|
|
288
295
|
This automatically infers the `secret_key` argument from the `RACCOON_SECRET_KEY` environment variable if it is not provided.
|
|
289
296
|
"""
|
|
@@ -333,7 +340,9 @@ class AsyncRaccoonAI(AsyncAPIClient):
|
|
|
333
340
|
)
|
|
334
341
|
|
|
335
342
|
self.lam = lam.AsyncLamResource(self)
|
|
343
|
+
self.tail = tail.AsyncTailResource(self)
|
|
336
344
|
self.fleet = fleet.AsyncFleetResource(self)
|
|
345
|
+
self.extensions = extensions.AsyncExtensionsResource(self)
|
|
337
346
|
self.with_raw_response = AsyncRaccoonAIWithRawResponse(self)
|
|
338
347
|
self.with_streaming_response = AsyncRaccoonAIWithStreamedResponse(self)
|
|
339
348
|
|
|
@@ -447,25 +456,33 @@ class AsyncRaccoonAI(AsyncAPIClient):
|
|
|
447
456
|
class RaccoonAIWithRawResponse:
|
|
448
457
|
def __init__(self, client: RaccoonAI) -> None:
|
|
449
458
|
self.lam = lam.LamResourceWithRawResponse(client.lam)
|
|
459
|
+
self.tail = tail.TailResourceWithRawResponse(client.tail)
|
|
450
460
|
self.fleet = fleet.FleetResourceWithRawResponse(client.fleet)
|
|
461
|
+
self.extensions = extensions.ExtensionsResourceWithRawResponse(client.extensions)
|
|
451
462
|
|
|
452
463
|
|
|
453
464
|
class AsyncRaccoonAIWithRawResponse:
|
|
454
465
|
def __init__(self, client: AsyncRaccoonAI) -> None:
|
|
455
466
|
self.lam = lam.AsyncLamResourceWithRawResponse(client.lam)
|
|
467
|
+
self.tail = tail.AsyncTailResourceWithRawResponse(client.tail)
|
|
456
468
|
self.fleet = fleet.AsyncFleetResourceWithRawResponse(client.fleet)
|
|
469
|
+
self.extensions = extensions.AsyncExtensionsResourceWithRawResponse(client.extensions)
|
|
457
470
|
|
|
458
471
|
|
|
459
472
|
class RaccoonAIWithStreamedResponse:
|
|
460
473
|
def __init__(self, client: RaccoonAI) -> None:
|
|
461
474
|
self.lam = lam.LamResourceWithStreamingResponse(client.lam)
|
|
475
|
+
self.tail = tail.TailResourceWithStreamingResponse(client.tail)
|
|
462
476
|
self.fleet = fleet.FleetResourceWithStreamingResponse(client.fleet)
|
|
477
|
+
self.extensions = extensions.ExtensionsResourceWithStreamingResponse(client.extensions)
|
|
463
478
|
|
|
464
479
|
|
|
465
480
|
class AsyncRaccoonAIWithStreamedResponse:
|
|
466
481
|
def __init__(self, client: AsyncRaccoonAI) -> None:
|
|
467
482
|
self.lam = lam.AsyncLamResourceWithStreamingResponse(client.lam)
|
|
483
|
+
self.tail = tail.AsyncTailResourceWithStreamingResponse(client.tail)
|
|
468
484
|
self.fleet = fleet.AsyncFleetResourceWithStreamingResponse(client.fleet)
|
|
485
|
+
self.extensions = extensions.AsyncExtensionsResourceWithStreamingResponse(client.extensions)
|
|
469
486
|
|
|
470
487
|
|
|
471
488
|
Client = RaccoonAI
|
raccoonai/_files.py
CHANGED
|
@@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
|
|
|
34
34
|
if not is_file_content(obj):
|
|
35
35
|
prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
|
|
36
36
|
raise RuntimeError(
|
|
37
|
-
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead."
|
|
37
|
+
f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/raccoonaihq/raccoonai-python/tree/main#file-uploads"
|
|
38
38
|
) from None
|
|
39
39
|
|
|
40
40
|
|
raccoonai/_version.py
CHANGED
raccoonai/resources/__init__.py
CHANGED
|
@@ -8,6 +8,14 @@ from .lam import (
|
|
|
8
8
|
LamResourceWithStreamingResponse,
|
|
9
9
|
AsyncLamResourceWithStreamingResponse,
|
|
10
10
|
)
|
|
11
|
+
from .tail import (
|
|
12
|
+
TailResource,
|
|
13
|
+
AsyncTailResource,
|
|
14
|
+
TailResourceWithRawResponse,
|
|
15
|
+
AsyncTailResourceWithRawResponse,
|
|
16
|
+
TailResourceWithStreamingResponse,
|
|
17
|
+
AsyncTailResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
11
19
|
from .fleet import (
|
|
12
20
|
FleetResource,
|
|
13
21
|
AsyncFleetResource,
|
|
@@ -16,6 +24,14 @@ from .fleet import (
|
|
|
16
24
|
FleetResourceWithStreamingResponse,
|
|
17
25
|
AsyncFleetResourceWithStreamingResponse,
|
|
18
26
|
)
|
|
27
|
+
from .extensions import (
|
|
28
|
+
ExtensionsResource,
|
|
29
|
+
AsyncExtensionsResource,
|
|
30
|
+
ExtensionsResourceWithRawResponse,
|
|
31
|
+
AsyncExtensionsResourceWithRawResponse,
|
|
32
|
+
ExtensionsResourceWithStreamingResponse,
|
|
33
|
+
AsyncExtensionsResourceWithStreamingResponse,
|
|
34
|
+
)
|
|
19
35
|
|
|
20
36
|
__all__ = [
|
|
21
37
|
"LamResource",
|
|
@@ -24,10 +40,22 @@ __all__ = [
|
|
|
24
40
|
"AsyncLamResourceWithRawResponse",
|
|
25
41
|
"LamResourceWithStreamingResponse",
|
|
26
42
|
"AsyncLamResourceWithStreamingResponse",
|
|
43
|
+
"TailResource",
|
|
44
|
+
"AsyncTailResource",
|
|
45
|
+
"TailResourceWithRawResponse",
|
|
46
|
+
"AsyncTailResourceWithRawResponse",
|
|
47
|
+
"TailResourceWithStreamingResponse",
|
|
48
|
+
"AsyncTailResourceWithStreamingResponse",
|
|
27
49
|
"FleetResource",
|
|
28
50
|
"AsyncFleetResource",
|
|
29
51
|
"FleetResourceWithRawResponse",
|
|
30
52
|
"AsyncFleetResourceWithRawResponse",
|
|
31
53
|
"FleetResourceWithStreamingResponse",
|
|
32
54
|
"AsyncFleetResourceWithStreamingResponse",
|
|
55
|
+
"ExtensionsResource",
|
|
56
|
+
"AsyncExtensionsResource",
|
|
57
|
+
"ExtensionsResourceWithRawResponse",
|
|
58
|
+
"AsyncExtensionsResourceWithRawResponse",
|
|
59
|
+
"ExtensionsResourceWithStreamingResponse",
|
|
60
|
+
"AsyncExtensionsResourceWithStreamingResponse",
|
|
33
61
|
]
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Mapping, cast
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import extension_upload_params
|
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
|
|
11
|
+
from .._utils import (
|
|
12
|
+
extract_files,
|
|
13
|
+
maybe_transform,
|
|
14
|
+
deepcopy_minimal,
|
|
15
|
+
async_maybe_transform,
|
|
16
|
+
)
|
|
17
|
+
from .._compat import cached_property
|
|
18
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
19
|
+
from .._response import (
|
|
20
|
+
to_raw_response_wrapper,
|
|
21
|
+
to_streamed_response_wrapper,
|
|
22
|
+
async_to_raw_response_wrapper,
|
|
23
|
+
async_to_streamed_response_wrapper,
|
|
24
|
+
)
|
|
25
|
+
from .._base_client import make_request_options
|
|
26
|
+
from ..types.extension_all_response import ExtensionAllResponse
|
|
27
|
+
from ..types.extension_get_response import ExtensionGetResponse
|
|
28
|
+
from ..types.extension_upload_response import ExtensionUploadResponse
|
|
29
|
+
|
|
30
|
+
__all__ = ["ExtensionsResource", "AsyncExtensionsResource"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ExtensionsResource(SyncAPIResource):
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_raw_response(self) -> ExtensionsResourceWithRawResponse:
|
|
36
|
+
"""
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
|
+
the raw response object instead of the parsed content.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
41
|
+
"""
|
|
42
|
+
return ExtensionsResourceWithRawResponse(self)
|
|
43
|
+
|
|
44
|
+
@cached_property
|
|
45
|
+
def with_streaming_response(self) -> ExtensionsResourceWithStreamingResponse:
|
|
46
|
+
"""
|
|
47
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#with_streaming_response
|
|
50
|
+
"""
|
|
51
|
+
return ExtensionsResourceWithStreamingResponse(self)
|
|
52
|
+
|
|
53
|
+
def delete(
|
|
54
|
+
self,
|
|
55
|
+
extension_id: str,
|
|
56
|
+
*,
|
|
57
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
|
+
extra_headers: Headers | None = None,
|
|
60
|
+
extra_query: Query | None = None,
|
|
61
|
+
extra_body: Body | None = None,
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
63
|
+
) -> object:
|
|
64
|
+
"""
|
|
65
|
+
Delete Extension Endpoint
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
extension_id: The ID of the extension to delete
|
|
69
|
+
|
|
70
|
+
extra_headers: Send extra headers
|
|
71
|
+
|
|
72
|
+
extra_query: Add additional query parameters to the request
|
|
73
|
+
|
|
74
|
+
extra_body: Add additional JSON properties to the request
|
|
75
|
+
|
|
76
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
77
|
+
"""
|
|
78
|
+
if not extension_id:
|
|
79
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
80
|
+
return self._delete(
|
|
81
|
+
f"/extensions/{extension_id}",
|
|
82
|
+
options=make_request_options(
|
|
83
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
84
|
+
),
|
|
85
|
+
cast_to=object,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
def all(
|
|
89
|
+
self,
|
|
90
|
+
*,
|
|
91
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
92
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
93
|
+
extra_headers: Headers | None = None,
|
|
94
|
+
extra_query: Query | None = None,
|
|
95
|
+
extra_body: Body | None = None,
|
|
96
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
97
|
+
) -> ExtensionAllResponse:
|
|
98
|
+
"""List Extensions Endpoint"""
|
|
99
|
+
return self._get(
|
|
100
|
+
"/extensions",
|
|
101
|
+
options=make_request_options(
|
|
102
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
103
|
+
),
|
|
104
|
+
cast_to=ExtensionAllResponse,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def get(
|
|
108
|
+
self,
|
|
109
|
+
extension_id: str,
|
|
110
|
+
*,
|
|
111
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
112
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
113
|
+
extra_headers: Headers | None = None,
|
|
114
|
+
extra_query: Query | None = None,
|
|
115
|
+
extra_body: Body | None = None,
|
|
116
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
117
|
+
) -> ExtensionGetResponse:
|
|
118
|
+
"""
|
|
119
|
+
Get Extension Endpoint
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
extension_id: The ID of the extension
|
|
123
|
+
|
|
124
|
+
extra_headers: Send extra headers
|
|
125
|
+
|
|
126
|
+
extra_query: Add additional query parameters to the request
|
|
127
|
+
|
|
128
|
+
extra_body: Add additional JSON properties to the request
|
|
129
|
+
|
|
130
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
131
|
+
"""
|
|
132
|
+
if not extension_id:
|
|
133
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
134
|
+
return self._get(
|
|
135
|
+
f"/extensions/{extension_id}",
|
|
136
|
+
options=make_request_options(
|
|
137
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
138
|
+
),
|
|
139
|
+
cast_to=ExtensionGetResponse,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
def upload(
|
|
143
|
+
self,
|
|
144
|
+
*,
|
|
145
|
+
file: FileTypes,
|
|
146
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
147
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
148
|
+
extra_headers: Headers | None = None,
|
|
149
|
+
extra_query: Query | None = None,
|
|
150
|
+
extra_body: Body | None = None,
|
|
151
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
152
|
+
) -> ExtensionUploadResponse:
|
|
153
|
+
"""
|
|
154
|
+
Upload Extension Endpoint
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
extra_headers: Send extra headers
|
|
158
|
+
|
|
159
|
+
extra_query: Add additional query parameters to the request
|
|
160
|
+
|
|
161
|
+
extra_body: Add additional JSON properties to the request
|
|
162
|
+
|
|
163
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
164
|
+
"""
|
|
165
|
+
body = deepcopy_minimal({"file": file})
|
|
166
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
167
|
+
# It should be noted that the actual Content-Type header that will be
|
|
168
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
169
|
+
# multipart/form-data; boundary=---abc--
|
|
170
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
171
|
+
return self._post(
|
|
172
|
+
"/extensions",
|
|
173
|
+
body=maybe_transform(body, extension_upload_params.ExtensionUploadParams),
|
|
174
|
+
files=files,
|
|
175
|
+
options=make_request_options(
|
|
176
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
177
|
+
),
|
|
178
|
+
cast_to=ExtensionUploadResponse,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class AsyncExtensionsResource(AsyncAPIResource):
|
|
183
|
+
@cached_property
|
|
184
|
+
def with_raw_response(self) -> AsyncExtensionsResourceWithRawResponse:
|
|
185
|
+
"""
|
|
186
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
187
|
+
the raw response object instead of the parsed content.
|
|
188
|
+
|
|
189
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
190
|
+
"""
|
|
191
|
+
return AsyncExtensionsResourceWithRawResponse(self)
|
|
192
|
+
|
|
193
|
+
@cached_property
|
|
194
|
+
def with_streaming_response(self) -> AsyncExtensionsResourceWithStreamingResponse:
|
|
195
|
+
"""
|
|
196
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
197
|
+
|
|
198
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#with_streaming_response
|
|
199
|
+
"""
|
|
200
|
+
return AsyncExtensionsResourceWithStreamingResponse(self)
|
|
201
|
+
|
|
202
|
+
async def delete(
|
|
203
|
+
self,
|
|
204
|
+
extension_id: str,
|
|
205
|
+
*,
|
|
206
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
207
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
208
|
+
extra_headers: Headers | None = None,
|
|
209
|
+
extra_query: Query | None = None,
|
|
210
|
+
extra_body: Body | None = None,
|
|
211
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
212
|
+
) -> object:
|
|
213
|
+
"""
|
|
214
|
+
Delete Extension Endpoint
|
|
215
|
+
|
|
216
|
+
Args:
|
|
217
|
+
extension_id: The ID of the extension to delete
|
|
218
|
+
|
|
219
|
+
extra_headers: Send extra headers
|
|
220
|
+
|
|
221
|
+
extra_query: Add additional query parameters to the request
|
|
222
|
+
|
|
223
|
+
extra_body: Add additional JSON properties to the request
|
|
224
|
+
|
|
225
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
226
|
+
"""
|
|
227
|
+
if not extension_id:
|
|
228
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
229
|
+
return await self._delete(
|
|
230
|
+
f"/extensions/{extension_id}",
|
|
231
|
+
options=make_request_options(
|
|
232
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
233
|
+
),
|
|
234
|
+
cast_to=object,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
async def all(
|
|
238
|
+
self,
|
|
239
|
+
*,
|
|
240
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
241
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
242
|
+
extra_headers: Headers | None = None,
|
|
243
|
+
extra_query: Query | None = None,
|
|
244
|
+
extra_body: Body | None = None,
|
|
245
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
246
|
+
) -> ExtensionAllResponse:
|
|
247
|
+
"""List Extensions Endpoint"""
|
|
248
|
+
return await self._get(
|
|
249
|
+
"/extensions",
|
|
250
|
+
options=make_request_options(
|
|
251
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
252
|
+
),
|
|
253
|
+
cast_to=ExtensionAllResponse,
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
async def get(
|
|
257
|
+
self,
|
|
258
|
+
extension_id: str,
|
|
259
|
+
*,
|
|
260
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
261
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
262
|
+
extra_headers: Headers | None = None,
|
|
263
|
+
extra_query: Query | None = None,
|
|
264
|
+
extra_body: Body | None = None,
|
|
265
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
266
|
+
) -> ExtensionGetResponse:
|
|
267
|
+
"""
|
|
268
|
+
Get Extension Endpoint
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
extension_id: The ID of the extension
|
|
272
|
+
|
|
273
|
+
extra_headers: Send extra headers
|
|
274
|
+
|
|
275
|
+
extra_query: Add additional query parameters to the request
|
|
276
|
+
|
|
277
|
+
extra_body: Add additional JSON properties to the request
|
|
278
|
+
|
|
279
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
280
|
+
"""
|
|
281
|
+
if not extension_id:
|
|
282
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
283
|
+
return await self._get(
|
|
284
|
+
f"/extensions/{extension_id}",
|
|
285
|
+
options=make_request_options(
|
|
286
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
287
|
+
),
|
|
288
|
+
cast_to=ExtensionGetResponse,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
async def upload(
|
|
292
|
+
self,
|
|
293
|
+
*,
|
|
294
|
+
file: FileTypes,
|
|
295
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
296
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
297
|
+
extra_headers: Headers | None = None,
|
|
298
|
+
extra_query: Query | None = None,
|
|
299
|
+
extra_body: Body | None = None,
|
|
300
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
301
|
+
) -> ExtensionUploadResponse:
|
|
302
|
+
"""
|
|
303
|
+
Upload Extension Endpoint
|
|
304
|
+
|
|
305
|
+
Args:
|
|
306
|
+
extra_headers: Send extra headers
|
|
307
|
+
|
|
308
|
+
extra_query: Add additional query parameters to the request
|
|
309
|
+
|
|
310
|
+
extra_body: Add additional JSON properties to the request
|
|
311
|
+
|
|
312
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
313
|
+
"""
|
|
314
|
+
body = deepcopy_minimal({"file": file})
|
|
315
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
316
|
+
# It should be noted that the actual Content-Type header that will be
|
|
317
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
318
|
+
# multipart/form-data; boundary=---abc--
|
|
319
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
320
|
+
return await self._post(
|
|
321
|
+
"/extensions",
|
|
322
|
+
body=await async_maybe_transform(body, extension_upload_params.ExtensionUploadParams),
|
|
323
|
+
files=files,
|
|
324
|
+
options=make_request_options(
|
|
325
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
326
|
+
),
|
|
327
|
+
cast_to=ExtensionUploadResponse,
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class ExtensionsResourceWithRawResponse:
|
|
332
|
+
def __init__(self, extensions: ExtensionsResource) -> None:
|
|
333
|
+
self._extensions = extensions
|
|
334
|
+
|
|
335
|
+
self.delete = to_raw_response_wrapper(
|
|
336
|
+
extensions.delete,
|
|
337
|
+
)
|
|
338
|
+
self.all = to_raw_response_wrapper(
|
|
339
|
+
extensions.all,
|
|
340
|
+
)
|
|
341
|
+
self.get = to_raw_response_wrapper(
|
|
342
|
+
extensions.get,
|
|
343
|
+
)
|
|
344
|
+
self.upload = to_raw_response_wrapper(
|
|
345
|
+
extensions.upload,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class AsyncExtensionsResourceWithRawResponse:
|
|
350
|
+
def __init__(self, extensions: AsyncExtensionsResource) -> None:
|
|
351
|
+
self._extensions = extensions
|
|
352
|
+
|
|
353
|
+
self.delete = async_to_raw_response_wrapper(
|
|
354
|
+
extensions.delete,
|
|
355
|
+
)
|
|
356
|
+
self.all = async_to_raw_response_wrapper(
|
|
357
|
+
extensions.all,
|
|
358
|
+
)
|
|
359
|
+
self.get = async_to_raw_response_wrapper(
|
|
360
|
+
extensions.get,
|
|
361
|
+
)
|
|
362
|
+
self.upload = async_to_raw_response_wrapper(
|
|
363
|
+
extensions.upload,
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
class ExtensionsResourceWithStreamingResponse:
|
|
368
|
+
def __init__(self, extensions: ExtensionsResource) -> None:
|
|
369
|
+
self._extensions = extensions
|
|
370
|
+
|
|
371
|
+
self.delete = to_streamed_response_wrapper(
|
|
372
|
+
extensions.delete,
|
|
373
|
+
)
|
|
374
|
+
self.all = to_streamed_response_wrapper(
|
|
375
|
+
extensions.all,
|
|
376
|
+
)
|
|
377
|
+
self.get = to_streamed_response_wrapper(
|
|
378
|
+
extensions.get,
|
|
379
|
+
)
|
|
380
|
+
self.upload = to_streamed_response_wrapper(
|
|
381
|
+
extensions.upload,
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
class AsyncExtensionsResourceWithStreamingResponse:
|
|
386
|
+
def __init__(self, extensions: AsyncExtensionsResource) -> None:
|
|
387
|
+
self._extensions = extensions
|
|
388
|
+
|
|
389
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
390
|
+
extensions.delete,
|
|
391
|
+
)
|
|
392
|
+
self.all = async_to_streamed_response_wrapper(
|
|
393
|
+
extensions.all,
|
|
394
|
+
)
|
|
395
|
+
self.get = async_to_streamed_response_wrapper(
|
|
396
|
+
extensions.get,
|
|
397
|
+
)
|
|
398
|
+
self.upload = async_to_streamed_response_wrapper(
|
|
399
|
+
extensions.upload,
|
|
400
|
+
)
|