airweave-sdk 0.8.64__py3-none-any.whl → 0.8.66__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.
Files changed (46) hide show
  1. airweave/__init__.py +44 -38
  2. airweave/client.py +19 -16
  3. airweave/collections/__init__.py +3 -6
  4. airweave/collections/client.py +273 -113
  5. airweave/collections/raw_client.py +633 -94
  6. airweave/collections/types/__init__.py +2 -4
  7. airweave/core/client_wrapper.py +4 -30
  8. airweave/errors/__init__.py +10 -2
  9. airweave/errors/conflict_error.py +11 -0
  10. airweave/errors/not_found_error.py +11 -0
  11. airweave/errors/too_many_requests_error.py +11 -0
  12. airweave/errors/unprocessable_entity_error.py +1 -2
  13. airweave/{types/message_status.py → events/__init__.py} +2 -1
  14. airweave/events/client.py +919 -0
  15. airweave/events/raw_client.py +1435 -0
  16. airweave/source_connections/client.py +210 -162
  17. airweave/source_connections/raw_client.py +574 -137
  18. airweave/sources/client.py +42 -18
  19. airweave/sources/raw_client.py +118 -17
  20. airweave/types/__init__.py +33 -33
  21. airweave/types/{create_subscription_request.py → conflict_error_response.py} +9 -6
  22. airweave/types/delivery_attempt.py +61 -0
  23. airweave/types/event_message.py +55 -0
  24. airweave/types/event_message_with_attempts.py +59 -0
  25. airweave/types/{endpoint_secret_out.py → not_found_error_response.py} +9 -2
  26. airweave/types/{subscription_with_attempts_out.py → rate_limit_error_response.py} +9 -6
  27. airweave/types/recovery_task.py +35 -0
  28. airweave/types/search_request.py +13 -10
  29. airweave/types/search_response.py +6 -3
  30. airweave/types/source_connection.py +73 -18
  31. airweave/types/source_connection_job.py +65 -15
  32. airweave/types/source_connection_list_item.py +45 -10
  33. airweave/types/sync_event_payload.py +72 -0
  34. airweave/types/{patch_subscription_request.py → validation_error_detail.py} +16 -5
  35. airweave/types/validation_error_response.py +30 -0
  36. airweave/types/webhook_subscription.py +68 -0
  37. {airweave_sdk-0.8.64.dist-info → airweave_sdk-0.8.66.dist-info}/METADATA +1 -5
  38. {airweave_sdk-0.8.64.dist-info → airweave_sdk-0.8.66.dist-info}/RECORD +39 -34
  39. airweave/collections/types/search_collections_readable_id_search_post_response.py +0 -8
  40. airweave/types/collection_update.py +0 -35
  41. airweave/types/endpoint_out.py +0 -35
  42. airweave/types/message_attempt_out.py +0 -37
  43. airweave/types/message_attempt_trigger_type.py +0 -3
  44. airweave/types/message_out.py +0 -29
  45. airweave/types/message_status_text.py +0 -5
  46. {airweave_sdk-0.8.64.dist-info → airweave_sdk-0.8.66.dist-info}/WHEEL +0 -0
airweave/__init__.py CHANGED
@@ -33,23 +33,21 @@ if typing.TYPE_CHECKING:
33
33
  CheckoutSessionResponse,
34
34
  Collection,
35
35
  CollectionStatus,
36
- CollectionUpdate,
37
36
  ConfigField,
38
37
  ConfigValues,
38
+ ConflictErrorResponse,
39
39
  Connection,
40
40
  ConnectionStatus,
41
- CreateSubscriptionRequest,
42
41
  CursorConfig,
43
42
  CustomerPortalRequest,
44
43
  CustomerPortalResponse,
44
+ DeliveryAttempt,
45
45
  Destination,
46
46
  DestinationConfig,
47
47
  DestinationWithAuthenticationFields,
48
48
  DirectAuthentication,
49
49
  EmbeddingModel,
50
50
  EmbeddingModelWithAuthenticationFields,
51
- EndpointOut,
52
- EndpointSecretOut,
53
51
  EntityCount,
54
52
  EntityCountWithDefinition,
55
53
  EntityDefinition,
@@ -59,6 +57,8 @@ if typing.TYPE_CHECKING:
59
57
  EntitySummary,
60
58
  EntityType,
61
59
  EntityTypeStats,
60
+ EventMessage,
61
+ EventMessageWithAttempts,
62
62
  EventType,
63
63
  FeatureFlag,
64
64
  Fields,
@@ -73,13 +73,9 @@ if typing.TYPE_CHECKING:
73
73
  LegacySearchRequestSearchMethod,
74
74
  LegacySearchResponse,
75
75
  MemberResponse,
76
- MessageAttemptOut,
77
- MessageAttemptTriggerType,
78
- MessageOut,
79
76
  MessageResponse,
80
- MessageStatus,
81
- MessageStatusText,
82
77
  MinuteLevelScheduleConfig,
78
+ NotFoundErrorResponse,
83
79
  OAuthBrowserAuthentication,
84
80
  OAuthTokenAuthentication,
85
81
  OAuthType,
@@ -88,8 +84,9 @@ if typing.TYPE_CHECKING:
88
84
  OrganizationCreate,
89
85
  OrganizationMetrics,
90
86
  OrganizationWithRole,
91
- PatchSubscriptionRequest,
92
87
  QueryExpansionStrategy,
88
+ RateLimitErrorResponse,
89
+ RecoveryTask,
93
90
  ResponseType,
94
91
  RetrievalStrategy,
95
92
  S3ConfigRequest,
@@ -111,11 +108,11 @@ if typing.TYPE_CHECKING:
111
108
  SourceRateLimitResponse,
112
109
  SourceRateLimitUpdateRequest,
113
110
  SubscriptionInfo,
114
- SubscriptionWithAttemptsOut,
115
111
  Sync,
116
112
  SyncConfig,
117
113
  SyncCreate,
118
114
  SyncDetails,
115
+ SyncEventPayload,
119
116
  SyncJob,
120
117
  SyncJobDetails,
121
118
  SyncJobStatus,
@@ -132,12 +129,15 @@ if typing.TYPE_CHECKING:
132
129
  UserCreate,
133
130
  UserOrganization,
134
131
  ValidationError,
132
+ ValidationErrorDetail,
135
133
  ValidationErrorLocItem,
134
+ ValidationErrorResponse,
135
+ WebhookSubscription,
136
136
  )
137
- from .errors import UnprocessableEntityError
138
- from . import collections, source_connections, sources
137
+ from .errors import ConflictError, NotFoundError, TooManyRequestsError, UnprocessableEntityError
138
+ from . import collections, events, source_connections, sources
139
139
  from .client import AirweaveSDK, AsyncAirweaveSDK
140
- from .collections import SearchCollectionsReadableIdSearchPostRequest, SearchCollectionsReadableIdSearchPostResponse
140
+ from .collections import SearchCollectionsReadableIdSearchPostRequest
141
141
  from .environment import AirweaveSDKEnvironment
142
142
  from .source_connections import Authentication
143
143
  from .version import __version__
@@ -172,23 +172,22 @@ _dynamic_imports: typing.Dict[str, str] = {
172
172
  "CheckoutSessionResponse": ".types",
173
173
  "Collection": ".types",
174
174
  "CollectionStatus": ".types",
175
- "CollectionUpdate": ".types",
176
175
  "ConfigField": ".types",
177
176
  "ConfigValues": ".types",
177
+ "ConflictError": ".errors",
178
+ "ConflictErrorResponse": ".types",
178
179
  "Connection": ".types",
179
180
  "ConnectionStatus": ".types",
180
- "CreateSubscriptionRequest": ".types",
181
181
  "CursorConfig": ".types",
182
182
  "CustomerPortalRequest": ".types",
183
183
  "CustomerPortalResponse": ".types",
184
+ "DeliveryAttempt": ".types",
184
185
  "Destination": ".types",
185
186
  "DestinationConfig": ".types",
186
187
  "DestinationWithAuthenticationFields": ".types",
187
188
  "DirectAuthentication": ".types",
188
189
  "EmbeddingModel": ".types",
189
190
  "EmbeddingModelWithAuthenticationFields": ".types",
190
- "EndpointOut": ".types",
191
- "EndpointSecretOut": ".types",
192
191
  "EntityCount": ".types",
193
192
  "EntityCountWithDefinition": ".types",
194
193
  "EntityDefinition": ".types",
@@ -198,6 +197,8 @@ _dynamic_imports: typing.Dict[str, str] = {
198
197
  "EntitySummary": ".types",
199
198
  "EntityType": ".types",
200
199
  "EntityTypeStats": ".types",
200
+ "EventMessage": ".types",
201
+ "EventMessageWithAttempts": ".types",
201
202
  "EventType": ".types",
202
203
  "FeatureFlag": ".types",
203
204
  "Fields": ".types",
@@ -212,13 +213,10 @@ _dynamic_imports: typing.Dict[str, str] = {
212
213
  "LegacySearchRequestSearchMethod": ".types",
213
214
  "LegacySearchResponse": ".types",
214
215
  "MemberResponse": ".types",
215
- "MessageAttemptOut": ".types",
216
- "MessageAttemptTriggerType": ".types",
217
- "MessageOut": ".types",
218
216
  "MessageResponse": ".types",
219
- "MessageStatus": ".types",
220
- "MessageStatusText": ".types",
221
217
  "MinuteLevelScheduleConfig": ".types",
218
+ "NotFoundError": ".errors",
219
+ "NotFoundErrorResponse": ".types",
222
220
  "OAuthBrowserAuthentication": ".types",
223
221
  "OAuthTokenAuthentication": ".types",
224
222
  "OAuthType": ".types",
@@ -227,8 +225,9 @@ _dynamic_imports: typing.Dict[str, str] = {
227
225
  "OrganizationCreate": ".types",
228
226
  "OrganizationMetrics": ".types",
229
227
  "OrganizationWithRole": ".types",
230
- "PatchSubscriptionRequest": ".types",
231
228
  "QueryExpansionStrategy": ".types",
229
+ "RateLimitErrorResponse": ".types",
230
+ "RecoveryTask": ".types",
232
231
  "ResponseType": ".types",
233
232
  "RetrievalStrategy": ".types",
234
233
  "S3ConfigRequest": ".types",
@@ -237,7 +236,6 @@ _dynamic_imports: typing.Dict[str, str] = {
237
236
  "ScheduleDetails": ".types",
238
237
  "ScheduleResponse": ".types",
239
238
  "SearchCollectionsReadableIdSearchPostRequest": ".collections",
240
- "SearchCollectionsReadableIdSearchPostResponse": ".collections",
241
239
  "SearchRequest": ".types",
242
240
  "SearchResponse": ".types",
243
241
  "SearchStatus": ".types",
@@ -252,16 +250,17 @@ _dynamic_imports: typing.Dict[str, str] = {
252
250
  "SourceRateLimitResponse": ".types",
253
251
  "SourceRateLimitUpdateRequest": ".types",
254
252
  "SubscriptionInfo": ".types",
255
- "SubscriptionWithAttemptsOut": ".types",
256
253
  "Sync": ".types",
257
254
  "SyncConfig": ".types",
258
255
  "SyncCreate": ".types",
259
256
  "SyncDetails": ".types",
257
+ "SyncEventPayload": ".types",
260
258
  "SyncJob": ".types",
261
259
  "SyncJobDetails": ".types",
262
260
  "SyncJobStatus": ".types",
263
261
  "SyncStatus": ".types",
264
262
  "SyncUpdate": ".types",
263
+ "TooManyRequestsError": ".errors",
265
264
  "Transformer": ".types",
266
265
  "TransformerCreate": ".types",
267
266
  "TransformerUpdate": ".types",
@@ -274,9 +273,13 @@ _dynamic_imports: typing.Dict[str, str] = {
274
273
  "UserCreate": ".types",
275
274
  "UserOrganization": ".types",
276
275
  "ValidationError": ".types",
276
+ "ValidationErrorDetail": ".types",
277
277
  "ValidationErrorLocItem": ".types",
278
+ "ValidationErrorResponse": ".types",
279
+ "WebhookSubscription": ".types",
278
280
  "__version__": ".version",
279
281
  "collections": ".collections",
282
+ "events": ".events",
280
283
  "source_connections": ".source_connections",
281
284
  "sources": ".sources",
282
285
  }
@@ -334,23 +337,22 @@ __all__ = [
334
337
  "CheckoutSessionResponse",
335
338
  "Collection",
336
339
  "CollectionStatus",
337
- "CollectionUpdate",
338
340
  "ConfigField",
339
341
  "ConfigValues",
342
+ "ConflictError",
343
+ "ConflictErrorResponse",
340
344
  "Connection",
341
345
  "ConnectionStatus",
342
- "CreateSubscriptionRequest",
343
346
  "CursorConfig",
344
347
  "CustomerPortalRequest",
345
348
  "CustomerPortalResponse",
349
+ "DeliveryAttempt",
346
350
  "Destination",
347
351
  "DestinationConfig",
348
352
  "DestinationWithAuthenticationFields",
349
353
  "DirectAuthentication",
350
354
  "EmbeddingModel",
351
355
  "EmbeddingModelWithAuthenticationFields",
352
- "EndpointOut",
353
- "EndpointSecretOut",
354
356
  "EntityCount",
355
357
  "EntityCountWithDefinition",
356
358
  "EntityDefinition",
@@ -360,6 +362,8 @@ __all__ = [
360
362
  "EntitySummary",
361
363
  "EntityType",
362
364
  "EntityTypeStats",
365
+ "EventMessage",
366
+ "EventMessageWithAttempts",
363
367
  "EventType",
364
368
  "FeatureFlag",
365
369
  "Fields",
@@ -374,13 +378,10 @@ __all__ = [
374
378
  "LegacySearchRequestSearchMethod",
375
379
  "LegacySearchResponse",
376
380
  "MemberResponse",
377
- "MessageAttemptOut",
378
- "MessageAttemptTriggerType",
379
- "MessageOut",
380
381
  "MessageResponse",
381
- "MessageStatus",
382
- "MessageStatusText",
383
382
  "MinuteLevelScheduleConfig",
383
+ "NotFoundError",
384
+ "NotFoundErrorResponse",
384
385
  "OAuthBrowserAuthentication",
385
386
  "OAuthTokenAuthentication",
386
387
  "OAuthType",
@@ -389,8 +390,9 @@ __all__ = [
389
390
  "OrganizationCreate",
390
391
  "OrganizationMetrics",
391
392
  "OrganizationWithRole",
392
- "PatchSubscriptionRequest",
393
393
  "QueryExpansionStrategy",
394
+ "RateLimitErrorResponse",
395
+ "RecoveryTask",
394
396
  "ResponseType",
395
397
  "RetrievalStrategy",
396
398
  "S3ConfigRequest",
@@ -399,7 +401,6 @@ __all__ = [
399
401
  "ScheduleDetails",
400
402
  "ScheduleResponse",
401
403
  "SearchCollectionsReadableIdSearchPostRequest",
402
- "SearchCollectionsReadableIdSearchPostResponse",
403
404
  "SearchRequest",
404
405
  "SearchResponse",
405
406
  "SearchStatus",
@@ -414,16 +415,17 @@ __all__ = [
414
415
  "SourceRateLimitResponse",
415
416
  "SourceRateLimitUpdateRequest",
416
417
  "SubscriptionInfo",
417
- "SubscriptionWithAttemptsOut",
418
418
  "Sync",
419
419
  "SyncConfig",
420
420
  "SyncCreate",
421
421
  "SyncDetails",
422
+ "SyncEventPayload",
422
423
  "SyncJob",
423
424
  "SyncJobDetails",
424
425
  "SyncJobStatus",
425
426
  "SyncStatus",
426
427
  "SyncUpdate",
428
+ "TooManyRequestsError",
427
429
  "Transformer",
428
430
  "TransformerCreate",
429
431
  "TransformerUpdate",
@@ -436,9 +438,13 @@ __all__ = [
436
438
  "UserCreate",
437
439
  "UserOrganization",
438
440
  "ValidationError",
441
+ "ValidationErrorDetail",
439
442
  "ValidationErrorLocItem",
443
+ "ValidationErrorResponse",
444
+ "WebhookSubscription",
440
445
  "__version__",
441
446
  "collections",
447
+ "events",
442
448
  "source_connections",
443
449
  "sources",
444
450
  ]
airweave/client.py CHANGED
@@ -10,6 +10,7 @@ from .environment import AirweaveSDKEnvironment
10
10
 
11
11
  if typing.TYPE_CHECKING:
12
12
  from .collections.client import AsyncCollectionsClient, CollectionsClient
13
+ from .events.client import AsyncEventsClient, EventsClient
13
14
  from .source_connections.client import AsyncSourceConnectionsClient, SourceConnectionsClient
14
15
  from .sources.client import AsyncSourcesClient, SourcesClient
15
16
 
@@ -32,8 +33,6 @@ class AirweaveSDK:
32
33
 
33
34
 
34
35
 
35
- framework_name : typing.Optional[str]
36
- framework_version : typing.Optional[str]
37
36
  api_key : str
38
37
  headers : typing.Optional[typing.Dict[str, str]]
39
38
  Additional headers to send with every request.
@@ -52,8 +51,6 @@ class AirweaveSDK:
52
51
  from airweave import AirweaveSDK
53
52
 
54
53
  client = AirweaveSDK(
55
- framework_name="YOUR_FRAMEWORK_NAME",
56
- framework_version="YOUR_FRAMEWORK_VERSION",
57
54
  api_key="YOUR_API_KEY",
58
55
  )
59
56
  """
@@ -63,8 +60,6 @@ class AirweaveSDK:
63
60
  *,
64
61
  base_url: typing.Optional[str] = None,
65
62
  environment: AirweaveSDKEnvironment = AirweaveSDKEnvironment.PRODUCTION,
66
- framework_name: typing.Optional[str] = None,
67
- framework_version: typing.Optional[str] = None,
68
63
  api_key: str,
69
64
  headers: typing.Optional[typing.Dict[str, str]] = None,
70
65
  timeout: typing.Optional[float] = None,
@@ -76,8 +71,6 @@ class AirweaveSDK:
76
71
  )
77
72
  self._client_wrapper = SyncClientWrapper(
78
73
  base_url=_get_base_url(base_url=base_url, environment=environment),
79
- framework_name=framework_name,
80
- framework_version=framework_version,
81
74
  api_key=api_key,
82
75
  headers=headers,
83
76
  httpx_client=httpx_client
@@ -90,6 +83,7 @@ class AirweaveSDK:
90
83
  self._sources: typing.Optional[SourcesClient] = None
91
84
  self._collections: typing.Optional[CollectionsClient] = None
92
85
  self._source_connections: typing.Optional[SourceConnectionsClient] = None
86
+ self._events: typing.Optional[EventsClient] = None
93
87
 
94
88
  @property
95
89
  def sources(self):
@@ -115,6 +109,14 @@ class AirweaveSDK:
115
109
  self._source_connections = SourceConnectionsClient(client_wrapper=self._client_wrapper)
116
110
  return self._source_connections
117
111
 
112
+ @property
113
+ def events(self):
114
+ if self._events is None:
115
+ from .events.client import EventsClient # noqa: E402
116
+
117
+ self._events = EventsClient(client_wrapper=self._client_wrapper)
118
+ return self._events
119
+
118
120
 
119
121
  class AsyncAirweaveSDK:
120
122
  """
@@ -134,8 +136,6 @@ class AsyncAirweaveSDK:
134
136
 
135
137
 
136
138
 
137
- framework_name : typing.Optional[str]
138
- framework_version : typing.Optional[str]
139
139
  api_key : str
140
140
  headers : typing.Optional[typing.Dict[str, str]]
141
141
  Additional headers to send with every request.
@@ -154,8 +154,6 @@ class AsyncAirweaveSDK:
154
154
  from airweave import AsyncAirweaveSDK
155
155
 
156
156
  client = AsyncAirweaveSDK(
157
- framework_name="YOUR_FRAMEWORK_NAME",
158
- framework_version="YOUR_FRAMEWORK_VERSION",
159
157
  api_key="YOUR_API_KEY",
160
158
  )
161
159
  """
@@ -165,8 +163,6 @@ class AsyncAirweaveSDK:
165
163
  *,
166
164
  base_url: typing.Optional[str] = None,
167
165
  environment: AirweaveSDKEnvironment = AirweaveSDKEnvironment.PRODUCTION,
168
- framework_name: typing.Optional[str] = None,
169
- framework_version: typing.Optional[str] = None,
170
166
  api_key: str,
171
167
  headers: typing.Optional[typing.Dict[str, str]] = None,
172
168
  timeout: typing.Optional[float] = None,
@@ -178,8 +174,6 @@ class AsyncAirweaveSDK:
178
174
  )
179
175
  self._client_wrapper = AsyncClientWrapper(
180
176
  base_url=_get_base_url(base_url=base_url, environment=environment),
181
- framework_name=framework_name,
182
- framework_version=framework_version,
183
177
  api_key=api_key,
184
178
  headers=headers,
185
179
  httpx_client=httpx_client
@@ -192,6 +186,7 @@ class AsyncAirweaveSDK:
192
186
  self._sources: typing.Optional[AsyncSourcesClient] = None
193
187
  self._collections: typing.Optional[AsyncCollectionsClient] = None
194
188
  self._source_connections: typing.Optional[AsyncSourceConnectionsClient] = None
189
+ self._events: typing.Optional[AsyncEventsClient] = None
195
190
 
196
191
  @property
197
192
  def sources(self):
@@ -217,6 +212,14 @@ class AsyncAirweaveSDK:
217
212
  self._source_connections = AsyncSourceConnectionsClient(client_wrapper=self._client_wrapper)
218
213
  return self._source_connections
219
214
 
215
+ @property
216
+ def events(self):
217
+ if self._events is None:
218
+ from .events.client import AsyncEventsClient # noqa: E402
219
+
220
+ self._events = AsyncEventsClient(client_wrapper=self._client_wrapper)
221
+ return self._events
222
+
220
223
 
221
224
  def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AirweaveSDKEnvironment) -> str:
222
225
  if base_url is not None:
@@ -6,11 +6,8 @@ import typing
6
6
  from importlib import import_module
7
7
 
8
8
  if typing.TYPE_CHECKING:
9
- from .types import SearchCollectionsReadableIdSearchPostRequest, SearchCollectionsReadableIdSearchPostResponse
10
- _dynamic_imports: typing.Dict[str, str] = {
11
- "SearchCollectionsReadableIdSearchPostRequest": ".types",
12
- "SearchCollectionsReadableIdSearchPostResponse": ".types",
13
- }
9
+ from .types import SearchCollectionsReadableIdSearchPostRequest
10
+ _dynamic_imports: typing.Dict[str, str] = {"SearchCollectionsReadableIdSearchPostRequest": ".types"}
14
11
 
15
12
 
16
13
  def __getattr__(attr_name: str) -> typing.Any:
@@ -34,4 +31,4 @@ def __dir__():
34
31
  return sorted(lazy_attrs)
35
32
 
36
33
 
37
- __all__ = ["SearchCollectionsReadableIdSearchPostRequest", "SearchCollectionsReadableIdSearchPostResponse"]
34
+ __all__ = ["SearchCollectionsReadableIdSearchPostRequest"]