airia 0.1.38__tar.gz → 0.1.39__tar.gz
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.
- {airia-0.1.38 → airia-0.1.39}/PKG-INFO +1 -1
- airia-0.1.39/airia/client/attachments/async_attachments.py +105 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/attachments/base_attachments.py +39 -0
- airia-0.1.39/airia/client/attachments/sync_attachments.py +103 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/store/sync_store.py +1 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_vector_search/base_data_vector_search.py +3 -1
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipelines_config/async_pipelines_config.py +6 -2
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipelines_config/base_pipelines_config.py +3 -1
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipelines_config/sync_pipelines_config.py +3 -1
- airia-0.1.39/airia/types/api/attachments/__init__.py +4 -0
- airia-0.1.39/airia/types/api/attachments/get_file_url.py +19 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/data_store/store/_get_files_and_folders.py +6 -2
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/library/__init__.py +1 -1
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/models/list_models.py +3 -1
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipelines_config/export_pipeline_definition.py +42 -36
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/tools/_tools.py +3 -1
- {airia-0.1.38 → airia-0.1.39}/airia.egg-info/PKG-INFO +1 -1
- {airia-0.1.38 → airia-0.1.39}/airia.egg-info/SOURCES.txt +1 -0
- {airia-0.1.38 → airia-0.1.39}/pyproject.toml +1 -1
- airia-0.1.38/airia/client/attachments/async_attachments.py +0 -52
- airia-0.1.38/airia/client/attachments/sync_attachments.py +0 -52
- airia-0.1.38/airia/types/api/attachments/__init__.py +0 -3
- {airia-0.1.38 → airia-0.1.39}/LICENSE +0 -0
- {airia-0.1.38 → airia-0.1.39}/README.md +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/_request_handler/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/_request_handler/async_request_handler.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/_request_handler/base_request_handler.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/_request_handler/sync_request_handler.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/async_client.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/attachments/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/base_client.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/conversations/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/conversations/async_conversations.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/conversations/base_conversations.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/conversations/sync_conversations.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/async_data_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/store/async_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/store/base_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_store/sync_data_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_vector_search/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_vector_search/async_data_vector_search.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/data_vector_search/sync_data_vector_search.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/deployments/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/deployments/async_deployments.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/deployments/base_deployments.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/deployments/sync_deployments.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/library/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/library/async_library.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/library/base_library.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/library/sync_library.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/models/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/models/async_models.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/models/base_models.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/models/sync_models.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_execution/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_execution/async_pipeline_execution.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_execution/base_pipeline_execution.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_execution/sync_pipeline_execution.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_import/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_import/async_pipeline_import.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_import/base_pipeline_import.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipeline_import/sync_pipeline_import.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/pipelines_config/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/project/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/project/async_project.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/project/base_project.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/project/sync_project.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/store/async_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/store/base_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/store/sync_store.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/sync_client.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/tools/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/tools/async_tools.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/tools/base_tools.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/client/tools/sync_tools.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/constants.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/exceptions.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/logs.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/_api_version.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/_request_data.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/_structured_output.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/attachments/upload_file.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/conversations/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/conversations/_conversations.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/data_store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/data_store/store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/data_vector_search/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/data_vector_search/get_file_chunks.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/deployments/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/deployments/get_deployment.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/deployments/get_deployments.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/library/_library_models.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/models/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipeline_execution/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipeline_execution/_pipeline_execution.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipeline_execution/get_pipeline_execution.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipeline_import/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipeline_import/create_agent_from_pipeline_definition.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipelines_config/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipelines_config/get_pipeline_config.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/pipelines_config/get_pipelines_config.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/project/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/project/get_projects.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/store/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/store/get_file.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/store/get_files.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/api/tools/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/sse/__init__.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/types/sse/sse_messages.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia/utils/sse_parser.py +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia.egg-info/dependency_links.txt +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia.egg-info/requires.txt +0 -0
- {airia-0.1.38 → airia-0.1.39}/airia.egg-info/top_level.txt +0 -0
- {airia-0.1.38 → airia-0.1.39}/setup.cfg +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.attachments import AttachmentResponse, GetFileUrlResponse
|
|
5
|
+
from .._request_handler import AsyncRequestHandler
|
|
6
|
+
from .base_attachments import BaseAttachments
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AsyncAttachments(BaseAttachments):
|
|
10
|
+
def __init__(self, request_handler: AsyncRequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
async def upload_file(
|
|
14
|
+
self,
|
|
15
|
+
file_path: str,
|
|
16
|
+
correlation_id: Optional[str] = None,
|
|
17
|
+
) -> AttachmentResponse:
|
|
18
|
+
"""
|
|
19
|
+
Upload a file and get attachment information.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
file_path: Path to the file on disk
|
|
23
|
+
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
24
|
+
one will be generated automatically.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
AttachmentResponse: Response containing the attachment ID and URL.
|
|
28
|
+
|
|
29
|
+
Raises:
|
|
30
|
+
AiriaAPIError: If the API request fails with details about the error.
|
|
31
|
+
aiohttp.ClientError: For other request-related errors.
|
|
32
|
+
|
|
33
|
+
Example:
|
|
34
|
+
```python
|
|
35
|
+
async_client = AiriaAsyncClient(api_key="your_api_key")
|
|
36
|
+
|
|
37
|
+
# Upload a file
|
|
38
|
+
response = await async_client.attachments.upload_file(
|
|
39
|
+
file_path="example.jpg"
|
|
40
|
+
)
|
|
41
|
+
print(f"Uploaded attachment ID: {response.id}")
|
|
42
|
+
print(f"Attachment URL: {response.image_url}")
|
|
43
|
+
```
|
|
44
|
+
"""
|
|
45
|
+
request_data = self._pre_upload_file(
|
|
46
|
+
file_path=file_path,
|
|
47
|
+
correlation_id=correlation_id,
|
|
48
|
+
api_version=ApiVersion.V1.value,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
resp = await self._request_handler.make_request_multipart("POST", request_data)
|
|
52
|
+
return AttachmentResponse(**resp)
|
|
53
|
+
|
|
54
|
+
async def get_file_url(
|
|
55
|
+
self,
|
|
56
|
+
file_id: str,
|
|
57
|
+
correlation_id: Optional[str] = None,
|
|
58
|
+
) -> GetFileUrlResponse:
|
|
59
|
+
"""
|
|
60
|
+
Get a refreshed signed URL for an existing attachment.
|
|
61
|
+
|
|
62
|
+
This method retrieves a new time-limited signed URL for accessing
|
|
63
|
+
an attachment that was previously uploaded. Useful when the original
|
|
64
|
+
signed URL has expired or is about to expire.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
file_id: The unique identifier of the attachment
|
|
68
|
+
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
69
|
+
one will be generated automatically.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
GetFileUrlResponse: Response containing the attachment ID and refreshed signed URL.
|
|
73
|
+
|
|
74
|
+
Raises:
|
|
75
|
+
AiriaAPIError: If the API request fails with details about the error.
|
|
76
|
+
aiohttp.ClientError: For other request-related errors.
|
|
77
|
+
|
|
78
|
+
Example:
|
|
79
|
+
```python
|
|
80
|
+
async_client = AiriaAsyncClient(api_key="your_api_key")
|
|
81
|
+
|
|
82
|
+
# First, upload a file
|
|
83
|
+
upload_response = await async_client.attachments.upload_file(
|
|
84
|
+
file_path="example.jpg"
|
|
85
|
+
)
|
|
86
|
+
file_id = upload_response.id
|
|
87
|
+
|
|
88
|
+
# Later, get a refreshed URL for the same file
|
|
89
|
+
url_response = await async_client.attachments.get_file_url(
|
|
90
|
+
file_id=file_id
|
|
91
|
+
)
|
|
92
|
+
print(f"Attachment ID: {url_response.id}")
|
|
93
|
+
print(f"Refreshed URL: {url_response.signed_url}")
|
|
94
|
+
```
|
|
95
|
+
"""
|
|
96
|
+
request_data = self._pre_get_file_url(
|
|
97
|
+
file_id=file_id,
|
|
98
|
+
correlation_id=correlation_id,
|
|
99
|
+
api_version=ApiVersion.V1.value,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
resp = await self._request_handler.make_request(
|
|
103
|
+
"GET", request_data, return_json=True
|
|
104
|
+
)
|
|
105
|
+
return GetFileUrlResponse(**resp)
|
|
@@ -52,3 +52,42 @@ class BaseAttachments:
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
return request_data
|
|
55
|
+
|
|
56
|
+
def _pre_get_file_url(
|
|
57
|
+
self,
|
|
58
|
+
file_id: str,
|
|
59
|
+
correlation_id: Optional[str] = None,
|
|
60
|
+
api_version: str = ApiVersion.V1.value,
|
|
61
|
+
):
|
|
62
|
+
"""
|
|
63
|
+
Prepare request data for get file URL endpoint.
|
|
64
|
+
|
|
65
|
+
This internal method constructs the URL for refreshing a file's signed URL,
|
|
66
|
+
validating the API version and preparing all request components.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
file_id: The unique identifier of the file
|
|
70
|
+
correlation_id: Optional correlation ID for tracing
|
|
71
|
+
api_version: API version to use for the request
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
RequestData: Prepared request data for the get file URL endpoint
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
ValueError: If an invalid API version is provided
|
|
78
|
+
"""
|
|
79
|
+
if api_version not in ApiVersion.as_list():
|
|
80
|
+
raise ValueError(
|
|
81
|
+
f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
url = urljoin(
|
|
85
|
+
self._request_handler.base_url,
|
|
86
|
+
f"{api_version}/upload/refresh/{file_id}",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
request_data = self._request_handler.prepare_request(
|
|
90
|
+
url=url, payload=None, correlation_id=correlation_id
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return request_data
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.attachments import AttachmentResponse, GetFileUrlResponse
|
|
5
|
+
from .._request_handler import RequestHandler
|
|
6
|
+
from .base_attachments import BaseAttachments
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Attachments(BaseAttachments):
|
|
10
|
+
def __init__(self, request_handler: RequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
def upload_file(
|
|
14
|
+
self,
|
|
15
|
+
file_path: str,
|
|
16
|
+
correlation_id: Optional[str] = None,
|
|
17
|
+
) -> AttachmentResponse:
|
|
18
|
+
"""
|
|
19
|
+
Upload a file and get attachment information.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
file_path: Path to the file on disk
|
|
23
|
+
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
24
|
+
one will be generated automatically.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
AttachmentResponse: Response containing the attachment ID and URL.
|
|
28
|
+
|
|
29
|
+
Raises:
|
|
30
|
+
AiriaAPIError: If the API request fails with details about the error.
|
|
31
|
+
requests.RequestException: For other request-related errors.
|
|
32
|
+
|
|
33
|
+
Example:
|
|
34
|
+
```python
|
|
35
|
+
client = AiriaClient(api_key="your_api_key")
|
|
36
|
+
|
|
37
|
+
# Upload a file
|
|
38
|
+
response = client.attachments.upload_file(
|
|
39
|
+
file_path="example.jpg"
|
|
40
|
+
)
|
|
41
|
+
print(f"Uploaded attachment ID: {response.id}")
|
|
42
|
+
print(f"Attachment URL: {response.image_url}")
|
|
43
|
+
```
|
|
44
|
+
"""
|
|
45
|
+
request_data = self._pre_upload_file(
|
|
46
|
+
file_path=file_path,
|
|
47
|
+
correlation_id=correlation_id,
|
|
48
|
+
api_version=ApiVersion.V1.value,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
resp = self._request_handler.make_request_multipart("POST", request_data)
|
|
52
|
+
return AttachmentResponse(**resp)
|
|
53
|
+
|
|
54
|
+
def get_file_url(
|
|
55
|
+
self,
|
|
56
|
+
file_id: str,
|
|
57
|
+
correlation_id: Optional[str] = None,
|
|
58
|
+
) -> GetFileUrlResponse:
|
|
59
|
+
"""
|
|
60
|
+
Get a refreshed signed URL for an existing attachment.
|
|
61
|
+
|
|
62
|
+
This method retrieves a new time-limited signed URL for accessing
|
|
63
|
+
an attachment that was previously uploaded. Useful when the original
|
|
64
|
+
signed URL has expired or is about to expire.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
file_id: The unique identifier of the attachment
|
|
68
|
+
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
69
|
+
one will be generated automatically.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
GetFileUrlResponse: Response containing the attachment ID and refreshed signed URL.
|
|
73
|
+
|
|
74
|
+
Raises:
|
|
75
|
+
AiriaAPIError: If the API request fails with details about the error.
|
|
76
|
+
requests.RequestException: For other request-related errors.
|
|
77
|
+
|
|
78
|
+
Example:
|
|
79
|
+
```python
|
|
80
|
+
client = AiriaClient(api_key="your_api_key")
|
|
81
|
+
|
|
82
|
+
# First, upload a file
|
|
83
|
+
upload_response = client.attachments.upload_file(
|
|
84
|
+
file_path="example.jpg"
|
|
85
|
+
)
|
|
86
|
+
file_id = upload_response.id
|
|
87
|
+
|
|
88
|
+
# Later, get a refreshed URL for the same file
|
|
89
|
+
url_response = client.attachments.get_file_url(
|
|
90
|
+
file_id=file_id
|
|
91
|
+
)
|
|
92
|
+
print(f"Attachment ID: {url_response.id}")
|
|
93
|
+
print(f"Refreshed URL: {url_response.signed_url}")
|
|
94
|
+
```
|
|
95
|
+
"""
|
|
96
|
+
request_data = self._pre_get_file_url(
|
|
97
|
+
file_id=file_id,
|
|
98
|
+
correlation_id=correlation_id,
|
|
99
|
+
api_version=ApiVersion.V1.value,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
resp = self._request_handler.make_request("GET", request_data, return_json=True)
|
|
103
|
+
return GetFileUrlResponse(**resp)
|
|
@@ -48,7 +48,9 @@ class BaseDataVectorSearch:
|
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
request_data = self._request_handler.prepare_request(
|
|
51
|
-
url,
|
|
51
|
+
url,
|
|
52
|
+
correlation_id=correlation_id,
|
|
53
|
+
params={"pageNumber": page_number, "pageSize": page_size},
|
|
52
54
|
)
|
|
53
55
|
|
|
54
56
|
return request_data
|
|
@@ -133,7 +133,9 @@ class AsyncPipelinesConfig(BasePipelinesConfig):
|
|
|
133
133
|
sort_direction: Optional[Literal["ASC", "DESC"]] = None,
|
|
134
134
|
filter: Optional[str] = None,
|
|
135
135
|
project_id: Optional[str] = None,
|
|
136
|
-
model_credential_source_type: Optional[
|
|
136
|
+
model_credential_source_type: Optional[
|
|
137
|
+
Literal["UserProvided", "Library"]
|
|
138
|
+
] = None,
|
|
137
139
|
correlation_id: Optional[str] = None,
|
|
138
140
|
) -> GetPipelinesConfigResponse:
|
|
139
141
|
"""
|
|
@@ -267,4 +269,6 @@ class AsyncPipelinesConfig(BasePipelinesConfig):
|
|
|
267
269
|
correlation_id=correlation_id,
|
|
268
270
|
api_version=ApiVersion.V1.value,
|
|
269
271
|
)
|
|
270
|
-
await self._request_handler.make_request(
|
|
272
|
+
await self._request_handler.make_request(
|
|
273
|
+
"DELETE", request_data, return_json=False
|
|
274
|
+
)
|
|
@@ -85,7 +85,9 @@ class BasePipelinesConfig:
|
|
|
85
85
|
sort_direction: Optional[Literal["ASC", "DESC"]] = None,
|
|
86
86
|
filter: Optional[str] = None,
|
|
87
87
|
project_id: Optional[str] = None,
|
|
88
|
-
model_credential_source_type: Optional[
|
|
88
|
+
model_credential_source_type: Optional[
|
|
89
|
+
Literal["UserProvided", "Library"]
|
|
90
|
+
] = None,
|
|
89
91
|
correlation_id: Optional[str] = None,
|
|
90
92
|
api_version: str = ApiVersion.V1.value,
|
|
91
93
|
):
|
|
@@ -133,7 +133,9 @@ class PipelinesConfig(BasePipelinesConfig):
|
|
|
133
133
|
sort_direction: Optional[Literal["ASC", "DESC"]] = None,
|
|
134
134
|
filter: Optional[str] = None,
|
|
135
135
|
project_id: Optional[str] = None,
|
|
136
|
-
model_credential_source_type: Optional[
|
|
136
|
+
model_credential_source_type: Optional[
|
|
137
|
+
Literal["UserProvided", "Library"]
|
|
138
|
+
] = None,
|
|
137
139
|
correlation_id: Optional[str] = None,
|
|
138
140
|
) -> GetPipelinesConfigResponse:
|
|
139
141
|
"""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class GetFileUrlResponse(BaseModel):
|
|
7
|
+
"""Response model for getting a refreshed file URL.
|
|
8
|
+
|
|
9
|
+
This class contains the unique identifier and a refreshed signed URL
|
|
10
|
+
for an existing attachment, providing time-limited access to download
|
|
11
|
+
the attachment.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
id: The unique identifier of the attachment
|
|
15
|
+
signed_url: A refreshed signed URL of the attachment in storage
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
id: Optional[str] = None
|
|
19
|
+
signed_url: Optional[str] = Field(None, alias="signedUrl")
|
|
@@ -63,7 +63,9 @@ class FileOrFolder(BaseModel):
|
|
|
63
63
|
ingestion_processing_statuses: Optional[List[IngestionProcessingStatus]] = Field(
|
|
64
64
|
None, alias="ingestionProcessingStatuses"
|
|
65
65
|
)
|
|
66
|
-
additional_metadata_json: Optional[str] = Field(
|
|
66
|
+
additional_metadata_json: Optional[str] = Field(
|
|
67
|
+
None, alias="additionalMetadataJson"
|
|
68
|
+
)
|
|
67
69
|
|
|
68
70
|
|
|
69
71
|
class GetFilesAndFoldersResponse(BaseModel):
|
|
@@ -76,5 +78,7 @@ class GetFilesAndFoldersResponse(BaseModel):
|
|
|
76
78
|
total_count: Total number of items available (may be greater than items returned)
|
|
77
79
|
"""
|
|
78
80
|
|
|
79
|
-
files_and_folders: Optional[List[FileOrFolder]] = Field(
|
|
81
|
+
files_and_folders: Optional[List[FileOrFolder]] = Field(
|
|
82
|
+
None, alias="filesAndFolders"
|
|
83
|
+
)
|
|
80
84
|
total_count: Optional[int] = Field(None, alias="totalCount")
|
|
@@ -121,7 +121,9 @@ class ModelItem(BaseModel):
|
|
|
121
121
|
has_tool_support: bool = Field(alias="hasToolSupport")
|
|
122
122
|
has_stream_support: bool = Field(alias="hasStreamSupport")
|
|
123
123
|
library_model_id: Optional[str] = Field(None, alias="libraryModelId")
|
|
124
|
-
user_provided_details: Optional[ModelUserProvidedDetails] = Field(
|
|
124
|
+
user_provided_details: Optional[ModelUserProvidedDetails] = Field(
|
|
125
|
+
None, alias="userProvidedDetails"
|
|
126
|
+
)
|
|
125
127
|
allow_airia_credentials: bool = Field(alias="allowAiriaCredentials")
|
|
126
128
|
allow_byok_credentials: bool = Field(alias="allowBYOKCredentials")
|
|
127
129
|
price_type: str = Field(alias="priceType")
|
{airia-0.1.38 → airia-0.1.39}/airia/types/api/pipelines_config/export_pipeline_definition.py
RENAMED
|
@@ -85,9 +85,7 @@ class ExportCredentials(BaseModel):
|
|
|
85
85
|
description="Gets or sets the administrative scope.",
|
|
86
86
|
alias="administrativeScope",
|
|
87
87
|
)
|
|
88
|
-
origin: Optional[str] = Field(
|
|
89
|
-
None, description="Gets or sets the origin."
|
|
90
|
-
)
|
|
88
|
+
origin: Optional[str] = Field(None, description="Gets or sets the origin.")
|
|
91
89
|
custom_credentials: Optional[ExportCustomCredentials] = Field(
|
|
92
90
|
None,
|
|
93
91
|
description="Gets or sets the custom credentials.",
|
|
@@ -204,9 +202,7 @@ class ExportJsonFormatterStepConfiguration(BaseModel):
|
|
|
204
202
|
template: The JSON formatter template
|
|
205
203
|
"""
|
|
206
204
|
|
|
207
|
-
template: str = Field(
|
|
208
|
-
..., description="Gets the JSON formatter template."
|
|
209
|
-
)
|
|
205
|
+
template: str = Field(..., description="Gets the JSON formatter template.")
|
|
210
206
|
|
|
211
207
|
|
|
212
208
|
class ExportConditionalBranchConfigDefinition(BaseModel):
|
|
@@ -220,7 +216,7 @@ class ExportConditionalBranchConfigDefinition(BaseModel):
|
|
|
220
216
|
id: str = Field(..., description="Gets or sets the Id.")
|
|
221
217
|
label: Optional[str] = Field(
|
|
222
218
|
None,
|
|
223
|
-
description=
|
|
219
|
+
description='Gets or sets the route label (e.g., "Route 1", "High Priority").',
|
|
224
220
|
)
|
|
225
221
|
|
|
226
222
|
|
|
@@ -398,7 +394,9 @@ class ExportPipelineStep(BaseModel):
|
|
|
398
394
|
None, description="Gets or sets the code.", alias="pythonCodeBlockId"
|
|
399
395
|
)
|
|
400
396
|
approval_request_id: Optional[str] = Field(
|
|
401
|
-
None,
|
|
397
|
+
None,
|
|
398
|
+
description="Gets or sets the approval request ID.",
|
|
399
|
+
alias="approvalRequestId",
|
|
402
400
|
)
|
|
403
401
|
webhook_approval_request_id: Optional[str] = Field(
|
|
404
402
|
None,
|
|
@@ -431,7 +429,9 @@ class ExportPipelineStep(BaseModel):
|
|
|
431
429
|
description="Gets or sets the loop step configuration.",
|
|
432
430
|
alias="loopStepConfiguration",
|
|
433
431
|
)
|
|
434
|
-
json_formatter_step_configuration: Optional[
|
|
432
|
+
json_formatter_step_configuration: Optional[
|
|
433
|
+
ExportJsonFormatterStepConfiguration
|
|
434
|
+
] = Field(
|
|
435
435
|
None,
|
|
436
436
|
description="Gets or sets the JSON formatter step configuration.",
|
|
437
437
|
alias="jsonFormatterStepConfiguration",
|
|
@@ -627,9 +627,7 @@ class ExportPipeline(BaseModel):
|
|
|
627
627
|
description="Gets or sets the markdown description.",
|
|
628
628
|
alias="markdownDescription",
|
|
629
629
|
)
|
|
630
|
-
tagline: Optional[str] = Field(
|
|
631
|
-
None, description="Gets or sets the tagline."
|
|
632
|
-
)
|
|
630
|
+
tagline: Optional[str] = Field(None, description="Gets or sets the tagline.")
|
|
633
631
|
video_link: Optional[str] = Field(
|
|
634
632
|
None, description="Gets or sets the video link.", alias="videoLink"
|
|
635
633
|
)
|
|
@@ -719,7 +717,9 @@ class ExportVectorStore(BaseModel):
|
|
|
719
717
|
None, description="Gets or sets the credential ID.", alias="credentialId"
|
|
720
718
|
)
|
|
721
719
|
configuration_json: Optional[str] = Field(
|
|
722
|
-
None,
|
|
720
|
+
None,
|
|
721
|
+
description="Gets or sets the configuration JSON.",
|
|
722
|
+
alias="configurationJson",
|
|
723
723
|
)
|
|
724
724
|
sparse_vector_enabled: bool = Field(
|
|
725
725
|
...,
|
|
@@ -727,7 +727,9 @@ class ExportVectorStore(BaseModel):
|
|
|
727
727
|
alias="sparseVectorEnabled",
|
|
728
728
|
)
|
|
729
729
|
embedding_provider: str = Field(
|
|
730
|
-
...,
|
|
730
|
+
...,
|
|
731
|
+
description="Gets or sets the embedding provider.",
|
|
732
|
+
alias="embeddingProvider",
|
|
731
733
|
)
|
|
732
734
|
embedding_configuration_json: Optional[str] = Field(
|
|
733
735
|
None,
|
|
@@ -1045,9 +1047,7 @@ class ExportTool(BaseModel):
|
|
|
1045
1047
|
description="Gets or sets a value indicating what the credential type is when the tool use user based credentials.",
|
|
1046
1048
|
alias="useUserCredentialsType",
|
|
1047
1049
|
)
|
|
1048
|
-
provider: Optional[str] = Field(
|
|
1049
|
-
None, description="Gets or sets the provider."
|
|
1050
|
-
)
|
|
1050
|
+
provider: Optional[str] = Field(None, description="Gets or sets the provider.")
|
|
1051
1051
|
body_type: Optional[str] = Field(
|
|
1052
1052
|
None, description="Gets or sets the body type.", alias="bodyType"
|
|
1053
1053
|
)
|
|
@@ -1543,9 +1543,7 @@ class ExportMetadata(BaseModel):
|
|
|
1543
1543
|
readiness: Optional[str] = Field(
|
|
1544
1544
|
None, description="Gets or sets the readiness level."
|
|
1545
1545
|
)
|
|
1546
|
-
department: Optional[str] = Field(
|
|
1547
|
-
None, description="Gets or sets the department."
|
|
1548
|
-
)
|
|
1546
|
+
department: Optional[str] = Field(None, description="Gets or sets the department.")
|
|
1549
1547
|
agent_last_updated: Optional[str] = Field(
|
|
1550
1548
|
None,
|
|
1551
1549
|
description="Gets or sets the timestamp when the agent was last updated.",
|
|
@@ -1585,7 +1583,9 @@ class ExportApprovalRequest(BaseModel):
|
|
|
1585
1583
|
alias="denialDescription",
|
|
1586
1584
|
)
|
|
1587
1585
|
approved_handle_id: str = Field(
|
|
1588
|
-
...,
|
|
1586
|
+
...,
|
|
1587
|
+
description="Gets or sets the approved handle ID.",
|
|
1588
|
+
alias="approvedHandleId",
|
|
1589
1589
|
)
|
|
1590
1590
|
denied_handle_id: str = Field(
|
|
1591
1591
|
..., description="Gets or sets the denied handle ID.", alias="deniedHandleId"
|
|
@@ -1626,7 +1626,9 @@ class ExportWebhookApprovalRequest(BaseModel):
|
|
|
1626
1626
|
description="Gets or sets the optional Message to include in the webhook payload.",
|
|
1627
1627
|
)
|
|
1628
1628
|
approved_handle_id: str = Field(
|
|
1629
|
-
...,
|
|
1629
|
+
...,
|
|
1630
|
+
description="Gets the approved handle identifier.",
|
|
1631
|
+
alias="approvedHandleId",
|
|
1630
1632
|
)
|
|
1631
1633
|
denied_handle_id: str = Field(
|
|
1632
1634
|
..., description="Gets the denied handle identifier.", alias="deniedHandleId"
|
|
@@ -1694,9 +1696,13 @@ class ExportAgentCardSkill(BaseModel):
|
|
|
1694
1696
|
|
|
1695
1697
|
id: str = Field(..., description="Gets or sets the ID.")
|
|
1696
1698
|
name: str = Field(..., description="Gets or sets the name.")
|
|
1697
|
-
description: Optional[str] = Field(
|
|
1699
|
+
description: Optional[str] = Field(
|
|
1700
|
+
None, description="Gets or sets the description."
|
|
1701
|
+
)
|
|
1698
1702
|
tags: Optional[List[str]] = Field(None, description="Gets or sets the tags.")
|
|
1699
|
-
examples: Optional[List[str]] = Field(
|
|
1703
|
+
examples: Optional[List[str]] = Field(
|
|
1704
|
+
None, description="Gets or sets the examples."
|
|
1705
|
+
)
|
|
1700
1706
|
input_modes: Optional[List[str]] = Field(
|
|
1701
1707
|
None, description="Gets or sets the input modes.", alias="inputModes"
|
|
1702
1708
|
)
|
|
@@ -1736,7 +1742,9 @@ class ExportAgentCard(BaseModel):
|
|
|
1736
1742
|
)
|
|
1737
1743
|
version: str = Field(..., description="Gets or sets the version.")
|
|
1738
1744
|
documentation_url: Optional[str] = Field(
|
|
1739
|
-
None,
|
|
1745
|
+
None,
|
|
1746
|
+
description="Gets or sets the documentation URL.",
|
|
1747
|
+
alias="documentationUrl",
|
|
1740
1748
|
)
|
|
1741
1749
|
capabilities: Optional[ExportAgentCardCapabilities] = Field(
|
|
1742
1750
|
None, description="Gets or sets the capabilities."
|
|
@@ -1745,7 +1753,9 @@ class ExportAgentCard(BaseModel):
|
|
|
1745
1753
|
None, description="Gets or sets the authentication."
|
|
1746
1754
|
)
|
|
1747
1755
|
default_input_modes: List[str] = Field(
|
|
1748
|
-
...,
|
|
1756
|
+
...,
|
|
1757
|
+
description="Gets or sets the default input modes.",
|
|
1758
|
+
alias="defaultInputModes",
|
|
1749
1759
|
)
|
|
1750
1760
|
default_output_modes: List[str] = Field(
|
|
1751
1761
|
...,
|
|
@@ -1804,9 +1814,7 @@ class ExportMCPAnnotations(BaseModel):
|
|
|
1804
1814
|
description="Gets or sets a value indicating whether the tool is read-only.",
|
|
1805
1815
|
alias="readOnlyHint",
|
|
1806
1816
|
)
|
|
1807
|
-
title: Optional[str] = Field(
|
|
1808
|
-
None, description="Gets or sets the tool title."
|
|
1809
|
-
)
|
|
1817
|
+
title: Optional[str] = Field(None, description="Gets or sets the tool title.")
|
|
1810
1818
|
|
|
1811
1819
|
|
|
1812
1820
|
class ExportToolInterface(BaseModel):
|
|
@@ -1879,7 +1887,7 @@ class ExportSDKStepCredentialReference(BaseModel):
|
|
|
1879
1887
|
|
|
1880
1888
|
property_name: str = Field(
|
|
1881
1889
|
...,
|
|
1882
|
-
description=
|
|
1890
|
+
description='Gets or sets the property name in the parameters class (e.g., "CredentialId").',
|
|
1883
1891
|
alias="propertyName",
|
|
1884
1892
|
)
|
|
1885
1893
|
original_credential_id: str = Field(
|
|
@@ -1922,21 +1930,19 @@ class ExportSDKStepDefinition(BaseModel):
|
|
|
1922
1930
|
...,
|
|
1923
1931
|
description="Gets or sets the unique identifier of the SDK step.",
|
|
1924
1932
|
)
|
|
1925
|
-
name: str = Field(
|
|
1926
|
-
..., description="Gets or sets the name of the SDK step."
|
|
1927
|
-
)
|
|
1933
|
+
name: str = Field(..., description="Gets or sets the name of the SDK step.")
|
|
1928
1934
|
sdk_step_type: str = Field(
|
|
1929
1935
|
...,
|
|
1930
|
-
description=
|
|
1936
|
+
description='Gets or sets the type of SDK step (e.g., "HttpRequest", "OneDrive_ListItems").',
|
|
1931
1937
|
alias="sdkStepType",
|
|
1932
1938
|
)
|
|
1933
1939
|
category: str = Field(
|
|
1934
1940
|
...,
|
|
1935
|
-
description=
|
|
1941
|
+
description='Gets or sets the SDK step category (e.g., "Actions", "Logic").',
|
|
1936
1942
|
)
|
|
1937
1943
|
group: str = Field(
|
|
1938
1944
|
...,
|
|
1939
|
-
description=
|
|
1945
|
+
description='Gets or sets the SDK step group (e.g., "Http", "OneDrive").',
|
|
1940
1946
|
)
|
|
1941
1947
|
version: str = Field(
|
|
1942
1948
|
...,
|
|
@@ -106,7 +106,9 @@ class ToolCredential(BaseModel):
|
|
|
106
106
|
expires_on: Optional[datetime] = Field(None, alias="expiresOn")
|
|
107
107
|
administrative_scope: str = Field(alias="administrativeScope")
|
|
108
108
|
user_id: Optional[str] = Field(None, alias="userId")
|
|
109
|
-
credential_data: List[CredentialEntry] = Field(
|
|
109
|
+
credential_data: List[CredentialEntry] = Field(
|
|
110
|
+
default_factory=list, alias="credentialData"
|
|
111
|
+
)
|
|
110
112
|
custom_credentials: Optional[dict] = Field(None, alias="customCredentials")
|
|
111
113
|
custom_credentials_id: Optional[str] = Field(None, alias="customCredentialsId")
|
|
112
114
|
tenant_id: Optional[str] = Field(None, alias="tenantId")
|
|
@@ -79,6 +79,7 @@ airia/types/_request_data.py
|
|
|
79
79
|
airia/types/_structured_output.py
|
|
80
80
|
airia/types/api/__init__.py
|
|
81
81
|
airia/types/api/attachments/__init__.py
|
|
82
|
+
airia/types/api/attachments/get_file_url.py
|
|
82
83
|
airia/types/api/attachments/upload_file.py
|
|
83
84
|
airia/types/api/conversations/__init__.py
|
|
84
85
|
airia/types/api/conversations/_conversations.py
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
|
-
from ...types._api_version import ApiVersion
|
|
4
|
-
from ...types.api.attachments import AttachmentResponse
|
|
5
|
-
from .._request_handler import AsyncRequestHandler
|
|
6
|
-
from .base_attachments import BaseAttachments
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class AsyncAttachments(BaseAttachments):
|
|
10
|
-
def __init__(self, request_handler: AsyncRequestHandler):
|
|
11
|
-
super().__init__(request_handler)
|
|
12
|
-
|
|
13
|
-
async def upload_file(
|
|
14
|
-
self,
|
|
15
|
-
file_path: str,
|
|
16
|
-
correlation_id: Optional[str] = None,
|
|
17
|
-
) -> AttachmentResponse:
|
|
18
|
-
"""
|
|
19
|
-
Upload a file and get attachment information.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
file_path: Path to the file on disk
|
|
23
|
-
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
24
|
-
one will be generated automatically.
|
|
25
|
-
|
|
26
|
-
Returns:
|
|
27
|
-
AttachmentResponse: Response containing the attachment ID and URL.
|
|
28
|
-
|
|
29
|
-
Raises:
|
|
30
|
-
AiriaAPIError: If the API request fails with details about the error.
|
|
31
|
-
aiohttp.ClientError: For other request-related errors.
|
|
32
|
-
|
|
33
|
-
Example:
|
|
34
|
-
```python
|
|
35
|
-
async_client = AiriaAsyncClient(api_key="your_api_key")
|
|
36
|
-
|
|
37
|
-
# Upload a file
|
|
38
|
-
response = await async_client.attachments.upload_file(
|
|
39
|
-
file_path="example.jpg"
|
|
40
|
-
)
|
|
41
|
-
print(f"Uploaded attachment ID: {response.id}")
|
|
42
|
-
print(f"Attachment URL: {response.image_url}")
|
|
43
|
-
```
|
|
44
|
-
"""
|
|
45
|
-
request_data = self._pre_upload_file(
|
|
46
|
-
file_path=file_path,
|
|
47
|
-
correlation_id=correlation_id,
|
|
48
|
-
api_version=ApiVersion.V1.value,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
resp = await self._request_handler.make_request_multipart("POST", request_data)
|
|
52
|
-
return AttachmentResponse(**resp)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
|
-
from ...types._api_version import ApiVersion
|
|
4
|
-
from ...types.api.attachments import AttachmentResponse
|
|
5
|
-
from .._request_handler import RequestHandler
|
|
6
|
-
from .base_attachments import BaseAttachments
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Attachments(BaseAttachments):
|
|
10
|
-
def __init__(self, request_handler: RequestHandler):
|
|
11
|
-
super().__init__(request_handler)
|
|
12
|
-
|
|
13
|
-
def upload_file(
|
|
14
|
-
self,
|
|
15
|
-
file_path: str,
|
|
16
|
-
correlation_id: Optional[str] = None,
|
|
17
|
-
) -> AttachmentResponse:
|
|
18
|
-
"""
|
|
19
|
-
Upload a file and get attachment information.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
file_path: Path to the file on disk
|
|
23
|
-
correlation_id: Optional correlation ID for request tracing. If not provided,
|
|
24
|
-
one will be generated automatically.
|
|
25
|
-
|
|
26
|
-
Returns:
|
|
27
|
-
AttachmentResponse: Response containing the attachment ID and URL.
|
|
28
|
-
|
|
29
|
-
Raises:
|
|
30
|
-
AiriaAPIError: If the API request fails with details about the error.
|
|
31
|
-
requests.RequestException: For other request-related errors.
|
|
32
|
-
|
|
33
|
-
Example:
|
|
34
|
-
```python
|
|
35
|
-
client = AiriaClient(api_key="your_api_key")
|
|
36
|
-
|
|
37
|
-
# Upload a file
|
|
38
|
-
response = client.attachments.upload_file(
|
|
39
|
-
file_path="example.jpg"
|
|
40
|
-
)
|
|
41
|
-
print(f"Uploaded attachment ID: {response.id}")
|
|
42
|
-
print(f"Attachment URL: {response.image_url}")
|
|
43
|
-
```
|
|
44
|
-
"""
|
|
45
|
-
request_data = self._pre_upload_file(
|
|
46
|
-
file_path=file_path,
|
|
47
|
-
correlation_id=correlation_id,
|
|
48
|
-
api_version=ApiVersion.V1.value,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
resp = self._request_handler.make_request_multipart("POST", request_data)
|
|
52
|
-
return AttachmentResponse(**resp)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|