store
Bases: BaseStore
Source code in airia/client/store/async_store.py
delete_file(project_id, file_id, correlation_id=None)
async
Delete a file from the Airia store asynchronously.
This method deletes a specific file from the given project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_id
|
str
|
The unique identifier of the file to delete (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The file_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
Source code in airia/client/store/async_store.py
get_file(project_id, file_id, correlation_id=None)
async
Retrieve a file from the Airia store asynchronously.
This method retrieves file information, download URL, and preview information for a specific file in the given project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_id
|
str
|
The unique identifier of the file (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetFileResponse |
GetFileResponse
|
File information including metadata, download info, and preview info |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The file_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
import asyncio
from airia import AiriaAsyncClient
async def main():
client = AiriaAsyncClient(api_key="your_api_key")
# Get file information
file_info = await client.store.get_file(
project_id="your_project_id",
file_id="your_file_id"
)
# Access file metadata
if file_info.file:
print(f"File name: {file_info.file.name}")
print(f"File size: {file_info.file.size}")
print(f"Status: {file_info.file.status}")
# Access download URL
if file_info.downloadInfo:
print(f"Download URL: {file_info.downloadInfo.url}")
# Access preview information
if file_info.previewInfo:
print(f"Preview URL: {file_info.previewInfo.previewUrl}")
asyncio.run(main())
Note
The response includes three optional components: - file: File metadata and processing status - downloadInfo: Direct download URL for the file - previewInfo: Preview URL and connector information
Source code in airia/client/store/async_store.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_files(project_id, store_connector_id, correlation_id=None)
async
Retrieve all files from a store connector in the Airia store asynchronously.
This method retrieves information about all files in the specified store connector and project, including file metadata, download URLs, and processing status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetFilesResponse |
GetFilesResponse
|
List of files with metadata, download info, and total count |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The store_connector_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
import asyncio
from airia import AiriaAsyncClient
async def main():
client = AiriaAsyncClient(api_key="your_api_key")
# Get all files from a store connector
files_response = await client.store.get_files(
project_id="your_project_id",
store_connector_id="your_store_connector_id"
)
# Access files list
if files_response.files:
for file in files_response.files:
print(f"File: {file.name}, Status: {file.status}, Size: {file.size}")
# Access download URLs
if files_response.downloadInfos:
for download_info in files_response.downloadInfos:
print(f"File ID: {download_info.fileId}, URL: {download_info.url}")
# Access total count
print(f"Total files: {files_response.totalCount}")
asyncio.run(main())
Note
The response includes: - files: List of file metadata and processing status - downloadInfos: List of direct download URLs for files - totalCount: Total number of files in the store connector
Source code in airia/client/store/async_store.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
update_file(store_connector_id, store_file_id, project_id, file_path, pending_ingestion=True, correlation_id=None)
async
Update an existing file in the Airia store asynchronously.
This method updates an existing file in the specified store connector and project, with optional ingestion settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
store_file_id
|
str
|
The unique identifier of the file to update (GUID format) |
required |
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_path
|
str
|
Path to the file on disk |
required |
pending_ingestion
|
bool
|
Whether the file should be marked as pending ingestion. Default is True. |
True
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The File ID of the updated file. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The store_connector_id doesn't exist (404) - The store_file_id doesn't exist (404) - The project_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
import asyncio
from airia import AiriaAsyncClient
async def main():
client = AiriaAsyncClient(api_key="your_api_key")
# Update existing file
updated_file_id = await client.store.update_file(
store_connector_id="your_store_connector_id",
store_file_id="your_store_file_id",
project_id="your_project_id",
file_path="document.pdf"
)
asyncio.run(main())
Source code in airia/client/store/async_store.py
upload_file(store_connector_id, project_id, file_path, folder_id=None, pending_ingestion=True, correlation_id=None)
async
Upload a file to the Airia store asynchronously.
This method uploads a file to the specified store connector and project, with optional folder organization and ingestion settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_path
|
str
|
Path to the file on disk |
required |
folder_id
|
Optional[str]
|
Optional folder identifier for organizing the file (GUID format) |
None
|
pending_ingestion
|
bool
|
Whether the file should be marked as pending ingestion. Default is True. |
True
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
File |
File
|
object containing details about the uploaded file. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The store_connector_id doesn't exist (404) - The project_id doesn't exist (404) - The folder_id is invalid (400) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
import asyncio
from airia import AiriaAsyncClient
async def main():
client = AiriaAsyncClient(api_key="your_api_key")
# Upload file
uploaded_file = await client.store.upload_file(
store_connector_id="your_store_connector_id",
project_id="your_project_id",
file_path="document.pdf"
)
# Upload with folder organization
uploaded_file = await client.store.upload_file(
store_connector_id="your_store_connector_id",
project_id="your_project_id",
file_path="document.pdf",
folder_id="your_folder_id"
)
asyncio.run(main())