arbi 0.18.0__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.
- arbi/__init__.py +92 -0
- arbi/_base_client.py +2124 -0
- arbi/_client.py +442 -0
- arbi/_compat.py +219 -0
- arbi/_constants.py +14 -0
- arbi/_exceptions.py +108 -0
- arbi/_files.py +123 -0
- arbi/_models.py +872 -0
- arbi/_qs.py +150 -0
- arbi/_resource.py +43 -0
- arbi/_response.py +830 -0
- arbi/_streaming.py +333 -0
- arbi/_types.py +270 -0
- arbi/_utils/__init__.py +64 -0
- arbi/_utils/_compat.py +45 -0
- arbi/_utils/_datetime_parse.py +136 -0
- arbi/_utils/_logs.py +25 -0
- arbi/_utils/_proxy.py +65 -0
- arbi/_utils/_reflection.py +42 -0
- arbi/_utils/_resources_proxy.py +24 -0
- arbi/_utils/_streams.py +12 -0
- arbi/_utils/_sync.py +58 -0
- arbi/_utils/_transform.py +457 -0
- arbi/_utils/_typing.py +156 -0
- arbi/_utils/_utils.py +421 -0
- arbi/_version.py +4 -0
- arbi/lib/.keep +4 -0
- arbi/py.typed +0 -0
- arbi/resources/__init__.py +19 -0
- arbi/resources/api/__init__.py +145 -0
- arbi/resources/api/api.py +422 -0
- arbi/resources/api/assistant.py +312 -0
- arbi/resources/api/configs.py +533 -0
- arbi/resources/api/conversation/__init__.py +33 -0
- arbi/resources/api/conversation/conversation.py +648 -0
- arbi/resources/api/conversation/user.py +270 -0
- arbi/resources/api/document/__init__.py +33 -0
- arbi/resources/api/document/doctag.py +516 -0
- arbi/resources/api/document/document.py +929 -0
- arbi/resources/api/health.py +253 -0
- arbi/resources/api/notifications.py +478 -0
- arbi/resources/api/tag.py +409 -0
- arbi/resources/api/user/__init__.py +61 -0
- arbi/resources/api/user/contacts.py +322 -0
- arbi/resources/api/user/settings.py +283 -0
- arbi/resources/api/user/subscription.py +230 -0
- arbi/resources/api/user/user.py +943 -0
- arbi/resources/api/workspace.py +1198 -0
- arbi/types/__init__.py +8 -0
- arbi/types/api/__init__.py +94 -0
- arbi/types/api/assistant_query_params.py +95 -0
- arbi/types/api/assistant_retrieve_params.py +95 -0
- arbi/types/api/chunker_config_param.py +9 -0
- arbi/types/api/config_create_params.py +227 -0
- arbi/types/api/config_create_response.py +17 -0
- arbi/types/api/config_delete_response.py +11 -0
- arbi/types/api/config_get_versions_response.py +19 -0
- arbi/types/api/config_retrieve_response.py +234 -0
- arbi/types/api/conversation/__init__.py +8 -0
- arbi/types/api/conversation/user_add_params.py +11 -0
- arbi/types/api/conversation/user_add_response.py +11 -0
- arbi/types/api/conversation/user_remove_params.py +11 -0
- arbi/types/api/conversation/user_remove_response.py +11 -0
- arbi/types/api/conversation_delete_message_response.py +11 -0
- arbi/types/api/conversation_delete_response.py +11 -0
- arbi/types/api/conversation_retrieve_message_response.py +105 -0
- arbi/types/api/conversation_retrieve_threads_response.py +124 -0
- arbi/types/api/conversation_share_response.py +11 -0
- arbi/types/api/conversation_update_title_params.py +16 -0
- arbi/types/api/conversation_update_title_response.py +13 -0
- arbi/types/api/doc_response.py +66 -0
- arbi/types/api/document/__init__.py +11 -0
- arbi/types/api/document/doc_tag_response.py +40 -0
- arbi/types/api/document/doctag_create_params.py +35 -0
- arbi/types/api/document/doctag_create_response.py +10 -0
- arbi/types/api/document/doctag_delete_params.py +15 -0
- arbi/types/api/document/doctag_generate_params.py +22 -0
- arbi/types/api/document/doctag_generate_response.py +20 -0
- arbi/types/api/document/doctag_update_params.py +35 -0
- arbi/types/api/document_date_extractor_llm_config.py +29 -0
- arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
- arbi/types/api/document_delete_params.py +13 -0
- arbi/types/api/document_get_parsed_response.py +26 -0
- arbi/types/api/document_retrieve_params.py +16 -0
- arbi/types/api/document_retrieve_response.py +10 -0
- arbi/types/api/document_update_params.py +42 -0
- arbi/types/api/document_update_response.py +10 -0
- arbi/types/api/document_upload_from_url_params.py +26 -0
- arbi/types/api/document_upload_from_url_response.py +16 -0
- arbi/types/api/document_upload_params.py +26 -0
- arbi/types/api/document_upload_response.py +16 -0
- arbi/types/api/embedder_config.py +30 -0
- arbi/types/api/embedder_config_param.py +29 -0
- arbi/types/api/health_check_models_response.py +21 -0
- arbi/types/api/health_get_models_response.py +19 -0
- arbi/types/api/health_retrieve_status_response.py +49 -0
- arbi/types/api/model_citation_config.py +20 -0
- arbi/types/api/model_citation_config_param.py +20 -0
- arbi/types/api/notification_create_params.py +20 -0
- arbi/types/api/notification_create_response.py +47 -0
- arbi/types/api/notification_delete_params.py +13 -0
- arbi/types/api/notification_get_schemas_response.py +197 -0
- arbi/types/api/notification_list_response.py +47 -0
- arbi/types/api/notification_update_params.py +27 -0
- arbi/types/api/notification_update_response.py +47 -0
- arbi/types/api/parser_config_param.py +9 -0
- arbi/types/api/query_llm_config.py +30 -0
- arbi/types/api/query_llm_config_param.py +29 -0
- arbi/types/api/reranker_config.py +21 -0
- arbi/types/api/reranker_config_param.py +20 -0
- arbi/types/api/retriever_config.py +39 -0
- arbi/types/api/retriever_config_param.py +38 -0
- arbi/types/api/tag_create_params.py +49 -0
- arbi/types/api/tag_create_response.py +57 -0
- arbi/types/api/tag_delete_response.py +9 -0
- arbi/types/api/tag_update_params.py +22 -0
- arbi/types/api/tag_update_response.py +57 -0
- arbi/types/api/title_llm_config.py +29 -0
- arbi/types/api/title_llm_config_param.py +28 -0
- arbi/types/api/user/__init__.py +13 -0
- arbi/types/api/user/contact_create_params.py +13 -0
- arbi/types/api/user/contact_create_response.py +30 -0
- arbi/types/api/user/contact_delete_params.py +13 -0
- arbi/types/api/user/contact_list_response.py +30 -0
- arbi/types/api/user/setting_retrieve_response.py +89 -0
- arbi/types/api/user/setting_update_params.py +60 -0
- arbi/types/api/user/subscription_create_params.py +13 -0
- arbi/types/api/user/subscription_create_response.py +11 -0
- arbi/types/api/user/subscription_retrieve_response.py +48 -0
- arbi/types/api/user_change_password_params.py +18 -0
- arbi/types/api/user_change_password_response.py +11 -0
- arbi/types/api/user_check_sso_status_params.py +20 -0
- arbi/types/api/user_check_sso_status_response.py +25 -0
- arbi/types/api/user_list_products_response.py +37 -0
- arbi/types/api/user_list_workspaces_response.py +10 -0
- arbi/types/api/user_login_params.py +18 -0
- arbi/types/api/user_login_response.py +23 -0
- arbi/types/api/user_logout_response.py +9 -0
- arbi/types/api/user_register_params.py +22 -0
- arbi/types/api/user_response.py +26 -0
- arbi/types/api/user_verify_email_params.py +11 -0
- arbi/types/api/user_verify_email_response.py +9 -0
- arbi/types/api/workspace_copy_params.py +21 -0
- arbi/types/api/workspace_copy_response.py +25 -0
- arbi/types/api/workspace_create_protected_params.py +16 -0
- arbi/types/api/workspace_delete_response.py +9 -0
- arbi/types/api/workspace_get_conversations_response.py +30 -0
- arbi/types/api/workspace_get_documents_response.py +10 -0
- arbi/types/api/workspace_get_stats_response.py +17 -0
- arbi/types/api/workspace_get_tags_response.py +60 -0
- arbi/types/api/workspace_get_users_response.py +10 -0
- arbi/types/api/workspace_remove_user_params.py +11 -0
- arbi/types/api/workspace_remove_user_response.py +11 -0
- arbi/types/api/workspace_response.py +41 -0
- arbi/types/api/workspace_share_params.py +15 -0
- arbi/types/api/workspace_share_response.py +13 -0
- arbi/types/api/workspace_update_params.py +20 -0
- arbi/types/chunk.py +12 -0
- arbi/types/chunk_metadata.py +31 -0
- arbi/types/chunk_metadata_param.py +32 -0
- arbi/types/chunk_param.py +15 -0
- arbi-0.18.0.dist-info/METADATA +410 -0
- arbi-0.18.0.dist-info/RECORD +165 -0
- arbi-0.18.0.dist-info/WHEEL +4 -0
- arbi-0.18.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
8
|
+
from ...._utils import maybe_transform, strip_not_given, async_maybe_transform
|
|
9
|
+
from ...._compat import cached_property
|
|
10
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ...._response import (
|
|
12
|
+
to_raw_response_wrapper,
|
|
13
|
+
to_streamed_response_wrapper,
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
)
|
|
17
|
+
from ...._base_client import make_request_options
|
|
18
|
+
from ....types.api.user import subscription_create_params
|
|
19
|
+
from ....types.api.user.subscription_create_response import SubscriptionCreateResponse
|
|
20
|
+
from ....types.api.user.subscription_retrieve_response import SubscriptionRetrieveResponse
|
|
21
|
+
|
|
22
|
+
__all__ = ["SubscriptionResource", "AsyncSubscriptionResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SubscriptionResource(SyncAPIResource):
|
|
26
|
+
@cached_property
|
|
27
|
+
def with_raw_response(self) -> SubscriptionResourceWithRawResponse:
|
|
28
|
+
"""
|
|
29
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
30
|
+
the raw response object instead of the parsed content.
|
|
31
|
+
|
|
32
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
33
|
+
"""
|
|
34
|
+
return SubscriptionResourceWithRawResponse(self)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_streaming_response(self) -> SubscriptionResourceWithStreamingResponse:
|
|
38
|
+
"""
|
|
39
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
42
|
+
"""
|
|
43
|
+
return SubscriptionResourceWithStreamingResponse(self)
|
|
44
|
+
|
|
45
|
+
def create(
|
|
46
|
+
self,
|
|
47
|
+
*,
|
|
48
|
+
price_id: str,
|
|
49
|
+
origin: str | Omit = omit,
|
|
50
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
51
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
52
|
+
extra_headers: Headers | None = None,
|
|
53
|
+
extra_query: Query | None = None,
|
|
54
|
+
extra_body: Body | None = None,
|
|
55
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
56
|
+
) -> SubscriptionCreateResponse:
|
|
57
|
+
"""
|
|
58
|
+
Create a new Stripe checkout session for subscription purchase.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
extra_headers: Send extra headers
|
|
62
|
+
|
|
63
|
+
extra_query: Add additional query parameters to the request
|
|
64
|
+
|
|
65
|
+
extra_body: Add additional JSON properties to the request
|
|
66
|
+
|
|
67
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
68
|
+
"""
|
|
69
|
+
extra_headers = {**strip_not_given({"origin": origin}), **(extra_headers or {})}
|
|
70
|
+
return self._post(
|
|
71
|
+
"/api/user/subscription",
|
|
72
|
+
body=maybe_transform({"price_id": price_id}, subscription_create_params.SubscriptionCreateParams),
|
|
73
|
+
options=make_request_options(
|
|
74
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
75
|
+
),
|
|
76
|
+
cast_to=SubscriptionCreateResponse,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def retrieve(
|
|
80
|
+
self,
|
|
81
|
+
*,
|
|
82
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
83
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
84
|
+
extra_headers: Headers | None = None,
|
|
85
|
+
extra_query: Query | None = None,
|
|
86
|
+
extra_body: Body | None = None,
|
|
87
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
88
|
+
) -> SubscriptionRetrieveResponse:
|
|
89
|
+
"""
|
|
90
|
+
Get subscription details including Stripe portal URL for management.
|
|
91
|
+
|
|
92
|
+
Also updates subscription status based on current Stripe entitlements. This
|
|
93
|
+
ensures status is refreshed after successful payment.
|
|
94
|
+
"""
|
|
95
|
+
return self._get(
|
|
96
|
+
"/api/user/subscription",
|
|
97
|
+
options=make_request_options(
|
|
98
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
99
|
+
),
|
|
100
|
+
cast_to=SubscriptionRetrieveResponse,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class AsyncSubscriptionResource(AsyncAPIResource):
|
|
105
|
+
@cached_property
|
|
106
|
+
def with_raw_response(self) -> AsyncSubscriptionResourceWithRawResponse:
|
|
107
|
+
"""
|
|
108
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
109
|
+
the raw response object instead of the parsed content.
|
|
110
|
+
|
|
111
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
112
|
+
"""
|
|
113
|
+
return AsyncSubscriptionResourceWithRawResponse(self)
|
|
114
|
+
|
|
115
|
+
@cached_property
|
|
116
|
+
def with_streaming_response(self) -> AsyncSubscriptionResourceWithStreamingResponse:
|
|
117
|
+
"""
|
|
118
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
119
|
+
|
|
120
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
121
|
+
"""
|
|
122
|
+
return AsyncSubscriptionResourceWithStreamingResponse(self)
|
|
123
|
+
|
|
124
|
+
async def create(
|
|
125
|
+
self,
|
|
126
|
+
*,
|
|
127
|
+
price_id: str,
|
|
128
|
+
origin: str | Omit = omit,
|
|
129
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
130
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
131
|
+
extra_headers: Headers | None = None,
|
|
132
|
+
extra_query: Query | None = None,
|
|
133
|
+
extra_body: Body | None = None,
|
|
134
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
135
|
+
) -> SubscriptionCreateResponse:
|
|
136
|
+
"""
|
|
137
|
+
Create a new Stripe checkout session for subscription purchase.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
extra_headers: Send extra headers
|
|
141
|
+
|
|
142
|
+
extra_query: Add additional query parameters to the request
|
|
143
|
+
|
|
144
|
+
extra_body: Add additional JSON properties to the request
|
|
145
|
+
|
|
146
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
147
|
+
"""
|
|
148
|
+
extra_headers = {**strip_not_given({"origin": origin}), **(extra_headers or {})}
|
|
149
|
+
return await self._post(
|
|
150
|
+
"/api/user/subscription",
|
|
151
|
+
body=await async_maybe_transform(
|
|
152
|
+
{"price_id": price_id}, subscription_create_params.SubscriptionCreateParams
|
|
153
|
+
),
|
|
154
|
+
options=make_request_options(
|
|
155
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
156
|
+
),
|
|
157
|
+
cast_to=SubscriptionCreateResponse,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
async def retrieve(
|
|
161
|
+
self,
|
|
162
|
+
*,
|
|
163
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
164
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
165
|
+
extra_headers: Headers | None = None,
|
|
166
|
+
extra_query: Query | None = None,
|
|
167
|
+
extra_body: Body | None = None,
|
|
168
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
169
|
+
) -> SubscriptionRetrieveResponse:
|
|
170
|
+
"""
|
|
171
|
+
Get subscription details including Stripe portal URL for management.
|
|
172
|
+
|
|
173
|
+
Also updates subscription status based on current Stripe entitlements. This
|
|
174
|
+
ensures status is refreshed after successful payment.
|
|
175
|
+
"""
|
|
176
|
+
return await self._get(
|
|
177
|
+
"/api/user/subscription",
|
|
178
|
+
options=make_request_options(
|
|
179
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
180
|
+
),
|
|
181
|
+
cast_to=SubscriptionRetrieveResponse,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class SubscriptionResourceWithRawResponse:
|
|
186
|
+
def __init__(self, subscription: SubscriptionResource) -> None:
|
|
187
|
+
self._subscription = subscription
|
|
188
|
+
|
|
189
|
+
self.create = to_raw_response_wrapper(
|
|
190
|
+
subscription.create,
|
|
191
|
+
)
|
|
192
|
+
self.retrieve = to_raw_response_wrapper(
|
|
193
|
+
subscription.retrieve,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class AsyncSubscriptionResourceWithRawResponse:
|
|
198
|
+
def __init__(self, subscription: AsyncSubscriptionResource) -> None:
|
|
199
|
+
self._subscription = subscription
|
|
200
|
+
|
|
201
|
+
self.create = async_to_raw_response_wrapper(
|
|
202
|
+
subscription.create,
|
|
203
|
+
)
|
|
204
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
205
|
+
subscription.retrieve,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class SubscriptionResourceWithStreamingResponse:
|
|
210
|
+
def __init__(self, subscription: SubscriptionResource) -> None:
|
|
211
|
+
self._subscription = subscription
|
|
212
|
+
|
|
213
|
+
self.create = to_streamed_response_wrapper(
|
|
214
|
+
subscription.create,
|
|
215
|
+
)
|
|
216
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
217
|
+
subscription.retrieve,
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class AsyncSubscriptionResourceWithStreamingResponse:
|
|
222
|
+
def __init__(self, subscription: AsyncSubscriptionResource) -> None:
|
|
223
|
+
self._subscription = subscription
|
|
224
|
+
|
|
225
|
+
self.create = async_to_streamed_response_wrapper(
|
|
226
|
+
subscription.create,
|
|
227
|
+
)
|
|
228
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
229
|
+
subscription.retrieve,
|
|
230
|
+
)
|