airia 0.1.27__py3-none-any.whl → 0.1.28__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.
@@ -94,3 +94,63 @@ class AsyncModels(BaseModels):
94
94
  return []
95
95
 
96
96
  return [ModelItem(**item) for item in resp["items"]]
97
+
98
+ async def delete_model(
99
+ self,
100
+ model_id: str,
101
+ correlation_id: Optional[str] = None,
102
+ ) -> None:
103
+ """
104
+ Delete a model by its ID.
105
+
106
+ This method permanently deletes a model from the Airia platform. Once deleted,
107
+ the model cannot be recovered. Only models that the authenticated user has
108
+ permission to delete can be removed.
109
+
110
+ Args:
111
+ model_id (str): The unique identifier of the model to delete.
112
+ correlation_id (str, optional): A unique identifier for request tracing
113
+ and logging. If not provided, one will be automatically generated.
114
+
115
+ Returns:
116
+ None
117
+
118
+ Raises:
119
+ AiriaAPIError: If the API request fails, including cases where:
120
+ - Model not found (404)
121
+ - Authentication fails (401)
122
+ - Access is forbidden (403)
123
+ - Server errors (5xx)
124
+
125
+ Example:
126
+ ```python
127
+ from airia import AiriaAsyncClient
128
+
129
+ client = AiriaAsyncClient(api_key="your_api_key")
130
+
131
+ # Delete a specific model
132
+ await client.models.delete_model(
133
+ model_id="12345678-1234-1234-1234-123456789abc"
134
+ )
135
+ print("Model deleted successfully")
136
+
137
+ # Delete with correlation ID for tracking
138
+ await client.models.delete_model(
139
+ model_id="12345678-1234-1234-1234-123456789abc",
140
+ correlation_id="my-correlation-id"
141
+ )
142
+ ```
143
+
144
+ Note:
145
+ This operation is irreversible. Ensure you have the correct model ID
146
+ before calling this method. You must have delete permissions for the
147
+ specified model.
148
+ """
149
+ request_data = self._pre_delete_model(
150
+ model_id=model_id,
151
+ correlation_id=correlation_id,
152
+ api_version=ApiVersion.V1.value,
153
+ )
154
+ await self._request_handler.make_request(
155
+ "DELETE", request_data, return_json=False
156
+ )
@@ -66,3 +66,37 @@ class BaseModels:
66
66
  )
67
67
 
68
68
  return request_data
69
+
70
+ def _pre_delete_model(
71
+ self,
72
+ model_id: str,
73
+ correlation_id: Optional[str] = None,
74
+ api_version: str = ApiVersion.V1.value,
75
+ ):
76
+ """
77
+ Prepare request data for deleting a model.
78
+
79
+ Args:
80
+ model_id: The ID of the model to delete
81
+ correlation_id: Optional correlation ID for tracing
82
+ api_version: API version to use for the request
83
+
84
+ Returns:
85
+ RequestData: Prepared request data for the delete endpoint
86
+
87
+ Raises:
88
+ ValueError: If an invalid API version is provided
89
+ """
90
+ if api_version not in ApiVersion.as_list():
91
+ raise ValueError(
92
+ f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
93
+ )
94
+
95
+ url = urljoin(
96
+ self._request_handler.base_url,
97
+ f"{api_version}/Models/{model_id}",
98
+ )
99
+ request_data = self._request_handler.prepare_request(
100
+ url, correlation_id=correlation_id
101
+ )
102
+ return request_data
@@ -94,3 +94,61 @@ class Models(BaseModels):
94
94
  return []
95
95
 
96
96
  return [ModelItem(**item) for item in resp["items"]]
97
+
98
+ def delete_model(
99
+ self,
100
+ model_id: str,
101
+ correlation_id: Optional[str] = None,
102
+ ) -> None:
103
+ """
104
+ Delete a model by its ID.
105
+
106
+ This method permanently deletes a model from the Airia platform. Once deleted,
107
+ the model cannot be recovered. Only models that the authenticated user has
108
+ permission to delete can be removed.
109
+
110
+ Args:
111
+ model_id (str): The unique identifier of the model to delete.
112
+ correlation_id (str, optional): A unique identifier for request tracing
113
+ and logging. If not provided, one will be automatically generated.
114
+
115
+ Returns:
116
+ None
117
+
118
+ Raises:
119
+ AiriaAPIError: If the API request fails, including cases where:
120
+ - Model not found (404)
121
+ - Authentication fails (401)
122
+ - Access is forbidden (403)
123
+ - Server errors (5xx)
124
+
125
+ Example:
126
+ ```python
127
+ from airia import AiriaClient
128
+
129
+ client = AiriaClient(api_key="your_api_key")
130
+
131
+ # Delete a specific model
132
+ client.models.delete_model(
133
+ model_id="12345678-1234-1234-1234-123456789abc"
134
+ )
135
+ print("Model deleted successfully")
136
+
137
+ # Delete with correlation ID for tracking
138
+ client.models.delete_model(
139
+ model_id="12345678-1234-1234-1234-123456789abc",
140
+ correlation_id="my-correlation-id"
141
+ )
142
+ ```
143
+
144
+ Note:
145
+ This operation is irreversible. Ensure you have the correct model ID
146
+ before calling this method. You must have delete permissions for the
147
+ specified model.
148
+ """
149
+ request_data = self._pre_delete_model(
150
+ model_id=model_id,
151
+ correlation_id=correlation_id,
152
+ api_version=ApiVersion.V1.value,
153
+ )
154
+ self._request_handler.make_request("DELETE", request_data, return_json=False)
@@ -63,6 +63,18 @@ class ToolCredentialSettings(BaseModel):
63
63
  )
64
64
 
65
65
 
66
+ class CredentialEntry(BaseModel):
67
+ """Represents a deserialized object for each entry of a credential.
68
+
69
+ Attributes:
70
+ key: The property name of the API Key for credentials data
71
+ value: The value of the credential
72
+ """
73
+
74
+ key: str
75
+ value: str
76
+
77
+
66
78
  class ToolCredential(BaseModel):
67
79
  """Tool credential information.
68
80
 
@@ -77,6 +89,11 @@ class ToolCredential(BaseModel):
77
89
  expires_on: When the credential expires
78
90
  administrative_scope: Scope of the credential (e.g., "Tenant")
79
91
  user_id: ID of the user who owns the credential
92
+ credential_data: List of credential entries
93
+ custom_credentials: Custom credentials data
94
+ custom_credentials_id: ID of custom credentials
95
+ tenant_id: ID of the tenant this credential belongs to
96
+ origin: Origin of the credential (Platform or Chat)
80
97
  """
81
98
 
82
99
  id: str
@@ -89,6 +106,11 @@ class ToolCredential(BaseModel):
89
106
  expires_on: Optional[datetime] = Field(None, alias="expiresOn")
90
107
  administrative_scope: str = Field(alias="administrativeScope")
91
108
  user_id: Optional[str] = Field(None, alias="userId")
109
+ credential_data: List[CredentialEntry] = Field(default_factory=list, alias="credentialData")
110
+ custom_credentials: Optional[dict] = Field(None, alias="customCredentials")
111
+ custom_credentials_id: Optional[str] = Field(None, alias="customCredentialsId")
112
+ tenant_id: Optional[str] = Field(None, alias="tenantId")
113
+ origin: str
92
114
 
93
115
 
94
116
  class ToolCredentials(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airia
3
- Version: 0.1.27
3
+ Version: 0.1.28
4
4
  Summary: Python SDK for Airia API
5
5
  Author-email: Airia LLC <support@airia.com>
6
6
  License: MIT
@@ -31,9 +31,9 @@ airia/client/library/async_library.py,sha256=fRG3eUxZkXDMnDTAt18KxD1LQMC5VB6cssW
31
31
  airia/client/library/base_library.py,sha256=VkcWr25fp2es2sRB97tORQmtAi59NZ6YRzwLymlQHIk,4664
32
32
  airia/client/library/sync_library.py,sha256=u_oBscUTYRNcsDbxCgpx_UvY5UAGgum2DW7eWt8y_i8,4191
33
33
  airia/client/models/__init__.py,sha256=YbxGLwMb7RQKfPo_2L_O_W9j8Szwnb0vtWiUNxkScfs,107
34
- airia/client/models/async_models.py,sha256=kcFywYQr4Ni1_eSH3dnC3ZVfDoHIAJZDb94Zsegt3pQ,3797
35
- airia/client/models/base_models.py,sha256=rBXPK3f5YPn1ntkmXNdHyMlzYpOH5d3CA0hHvQM1GTI,2361
36
- airia/client/models/sync_models.py,sha256=O_nD2bD9N3EIWz6nCt5KUQaRmIGaBhrLs006B-1d65U,3748
34
+ airia/client/models/async_models.py,sha256=gwW3tWwzSZ9_3JmGlwryY48w9KrFXoLET6Jpsj0hX0I,5853
35
+ airia/client/models/base_models.py,sha256=FchsA7P-Fc7fxzlN88jJ3BEVXPWDcIHSzci6wtSArqg,3439
36
+ airia/client/models/sync_models.py,sha256=FQLM4xCoxcBk1NuLf6z7jVVejlDKx5KpMRBz2tQm71o,5748
37
37
  airia/client/pipeline_execution/__init__.py,sha256=7qEZsPRTLySC71zlwYioBuJs6B4BwRCgFL3TQyFWXmc,175
38
38
  airia/client/pipeline_execution/async_pipeline_execution.py,sha256=alglTaHtWEipJx56WOUdV8MNhpOmo4GuhCXI9wkv7Mw,18022
39
39
  airia/client/pipeline_execution/base_pipeline_execution.py,sha256=fVGG__zHPpKLZdcwOL3GYmEyjCC7V4GZVuZ4CagGRP4,9608
@@ -89,12 +89,12 @@ airia/types/api/store/__init__.py,sha256=BgViwV_SHE9cxtilPnA2xWRk6MkAbxYxansmGeZ
89
89
  airia/types/api/store/get_file.py,sha256=Li3CpWUktQruNeoKSTlHJPXzNMaysG_Zy-fXGji8zs8,6174
90
90
  airia/types/api/store/get_files.py,sha256=v22zmOuTSFqzrS73L5JL_FgBeF5a5wutv1nK4IHAoW0,700
91
91
  airia/types/api/tools/__init__.py,sha256=r4jcHknQcLIb3jVkGR5lcmuapHqln7-rot3EBCNmZtI,146
92
- airia/types/api/tools/_tools.py,sha256=M8nVRqhTpdbIzPs2z4Pi11BFtOnbgtNk3_RnDyViM_M,8348
92
+ airia/types/api/tools/_tools.py,sha256=PSJYFok7yQdE4it55iQmbryFzKN54nT6N161X1Rkp5U,9241
93
93
  airia/types/sse/__init__.py,sha256=KWnNTfsQnthfrU128pUX6ounvSS7DvjC-Y21FE-OdMk,1863
94
94
  airia/types/sse/sse_messages.py,sha256=asq9KG5plT2XSgQMz-Nqo0WcKlXvE8UT3E-WLhCegPk,30244
95
95
  airia/utils/sse_parser.py,sha256=XCTkuaroYWaVQOgBq8VpbseQYSAVruF69AvKUwZQKTA,4251
96
- airia-0.1.27.dist-info/licenses/LICENSE,sha256=R3ClUMMKPRItIcZ0svzyj2taZZnFYw568YDNzN9KQ1Q,1066
97
- airia-0.1.27.dist-info/METADATA,sha256=F_fbsYlh5Av4u2zFd10Yx3CFTYYeplBWx2tIZK9cdU8,4506
98
- airia-0.1.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- airia-0.1.27.dist-info/top_level.txt,sha256=qUQEKfs_hdOYTwjKj1JZbRhS5YeXDNaKQaVTrzabS6w,6
100
- airia-0.1.27.dist-info/RECORD,,
96
+ airia-0.1.28.dist-info/licenses/LICENSE,sha256=R3ClUMMKPRItIcZ0svzyj2taZZnFYw568YDNzN9KQ1Q,1066
97
+ airia-0.1.28.dist-info/METADATA,sha256=tkuWRE4s9Kg47iYeR-_dSLepobeNr3WGHMrG-sApsyI,4506
98
+ airia-0.1.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ airia-0.1.28.dist-info/top_level.txt,sha256=qUQEKfs_hdOYTwjKj1JZbRhS5YeXDNaKQaVTrzabS6w,6
100
+ airia-0.1.28.dist-info/RECORD,,
File without changes