airia 0.1.14__tar.gz → 0.1.15__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.14 → airia-0.1.15}/PKG-INFO +1 -1
- {airia-0.1.14 → airia-0.1.15}/airia/client/async_client.py +2 -0
- airia-0.1.15/airia/client/deployments/__init__.py +11 -0
- airia-0.1.15/airia/client/deployments/async_deployments.py +112 -0
- airia-0.1.15/airia/client/deployments/base_deployments.py +95 -0
- airia-0.1.15/airia/client/deployments/sync_deployments.py +112 -0
- airia-0.1.15/airia/client/pipelines_config/async_pipelines_config.py +65 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipelines_config/base_pipelines_config.py +1 -33
- airia-0.1.15/airia/client/pipelines_config/sync_pipelines_config.py +65 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/sync_client.py +2 -0
- airia-0.1.15/airia/types/api/conversations/__init__.py +13 -0
- airia-0.1.15/airia/types/api/deployments/__init__.py +26 -0
- airia-0.1.15/airia/types/api/deployments/get_deployment.py +106 -0
- airia-0.1.15/airia/types/api/deployments/get_deployments.py +224 -0
- airia-0.1.15/airia/types/api/pipelines_config/__init__.py +35 -0
- airia-0.1.15/airia/types/api/pipelines_config/get_pipeline_config.py +554 -0
- airia-0.1.15/airia/types/api/project/__init__.py +3 -0
- airia-0.1.15/airia/types/api/store/__init__.py +19 -0
- airia-0.1.15/airia/types/sse/sse_messages.py +767 -0
- {airia-0.1.14 → airia-0.1.15}/airia.egg-info/PKG-INFO +1 -1
- {airia-0.1.14 → airia-0.1.15}/airia.egg-info/SOURCES.txt +7 -0
- {airia-0.1.14 → airia-0.1.15}/pyproject.toml +1 -1
- airia-0.1.14/airia/client/pipelines_config/async_pipelines_config.py +0 -127
- airia-0.1.14/airia/client/pipelines_config/sync_pipelines_config.py +0 -127
- airia-0.1.14/airia/types/api/conversations/__init__.py +0 -3
- airia-0.1.14/airia/types/api/pipelines_config/__init__.py +0 -3
- airia-0.1.14/airia/types/api/pipelines_config/get_pipeline_config.py +0 -401
- airia-0.1.14/airia/types/api/project/__init__.py +0 -3
- airia-0.1.14/airia/types/api/store/__init__.py +0 -4
- airia-0.1.14/airia/types/sse/sse_messages.py +0 -485
- {airia-0.1.14 → airia-0.1.15}/LICENSE +0 -0
- {airia-0.1.14 → airia-0.1.15}/README.md +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/_request_handler/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/_request_handler/async_request_handler.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/_request_handler/base_request_handler.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/_request_handler/sync_request_handler.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/base_client.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/conversations/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/conversations/async_conversations.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/conversations/base_conversations.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/conversations/sync_conversations.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipeline_execution/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipeline_execution/async_pipeline_execution.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipeline_execution/base_pipeline_execution.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipeline_execution/sync_pipeline_execution.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/pipelines_config/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/project/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/project/async_project.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/project/base_project.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/project/sync_project.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/store/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/store/async_store.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/store/base_store.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/client/store/sync_store.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/constants.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/exceptions.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/logs.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/_api_version.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/_request_data.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/conversations/_conversations.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/pipeline_execution/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/pipeline_execution/_pipeline_execution.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/project/get_projects.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/store/get_file.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/api/store/get_files.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/types/sse/__init__.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia/utils/sse_parser.py +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia.egg-info/dependency_links.txt +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia.egg-info/requires.txt +0 -0
- {airia-0.1.14 → airia-0.1.15}/airia.egg-info/top_level.txt +0 -0
- {airia-0.1.14 → airia-0.1.15}/setup.cfg +0 -0
|
@@ -11,6 +11,7 @@ from ..constants import (
|
|
|
11
11
|
from ._request_handler import AsyncRequestHandler
|
|
12
12
|
from .base_client import AiriaBaseClient
|
|
13
13
|
from .conversations import AsyncConversations
|
|
14
|
+
from .deployments import AsyncDeployments
|
|
14
15
|
from .pipeline_execution import AsyncPipelineExecution
|
|
15
16
|
from .pipelines_config import AsyncPipelinesConfig
|
|
16
17
|
from .project import AsyncProject
|
|
@@ -62,6 +63,7 @@ class AiriaAsyncClient(AiriaBaseClient):
|
|
|
62
63
|
self.project = AsyncProject(self._request_handler)
|
|
63
64
|
self.conversations = AsyncConversations(self._request_handler)
|
|
64
65
|
self.store = AsyncStore(self._request_handler)
|
|
66
|
+
self.deployments = AsyncDeployments(self._request_handler)
|
|
65
67
|
|
|
66
68
|
@classmethod
|
|
67
69
|
def with_openai_gateway(
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Deployment management client modules.
|
|
3
|
+
|
|
4
|
+
This module provides synchronous and asynchronous client interfaces for
|
|
5
|
+
deployment-related operations in the Airia platform.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .async_deployments import AsyncDeployments
|
|
9
|
+
from .sync_deployments import Deployments
|
|
10
|
+
|
|
11
|
+
__all__ = ["AsyncDeployments", "Deployments"]
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.deployments import GetDeploymentResponse, GetDeploymentsResponse
|
|
5
|
+
from .._request_handler import AsyncRequestHandler
|
|
6
|
+
from .base_deployments import BaseDeployments
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AsyncDeployments(BaseDeployments):
|
|
10
|
+
def __init__(self, request_handler: AsyncRequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
async def get_deployments(
|
|
14
|
+
self,
|
|
15
|
+
tags: Optional[List[str]] = None,
|
|
16
|
+
is_recommended: Optional[bool] = None,
|
|
17
|
+
project_id: Optional[str] = None,
|
|
18
|
+
correlation_id: Optional[str] = None,
|
|
19
|
+
api_version: str = ApiVersion.V2.value,
|
|
20
|
+
) -> GetDeploymentsResponse:
|
|
21
|
+
"""
|
|
22
|
+
Retrieve a paged list of deployments asynchronously.
|
|
23
|
+
|
|
24
|
+
This method fetches deployments from the Airia platform with optional filtering
|
|
25
|
+
by tags and recommendation status. The response includes detailed information
|
|
26
|
+
about each deployment including associated pipelines, data sources, and user prompts.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
tags: Optional list of tags to filter deployments by
|
|
30
|
+
is_recommended: Optional filter by recommended status
|
|
31
|
+
project_id: Optional filter by project id
|
|
32
|
+
correlation_id: Optional correlation ID for request tracing
|
|
33
|
+
api_version: API version to use (defaults to V2)
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
GetDeploymentsResponse: Paged response containing deployment items and total count
|
|
37
|
+
|
|
38
|
+
Raises:
|
|
39
|
+
AiriaAPIError: If the API request fails
|
|
40
|
+
ValueError: If an invalid API version is provided
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
```python
|
|
44
|
+
client = AiriaAsyncClient(api_key="your-api-key")
|
|
45
|
+
deployments = await client.deployments.get_deployments(
|
|
46
|
+
tags=["production", "nlp"],
|
|
47
|
+
is_recommended=True
|
|
48
|
+
)
|
|
49
|
+
print(f"Found {deployments.total_count} deployments")
|
|
50
|
+
for deployment in deployments.items:
|
|
51
|
+
print(f"- {deployment.deployment_name}")
|
|
52
|
+
```
|
|
53
|
+
"""
|
|
54
|
+
request_data = self._pre_get_deployments(
|
|
55
|
+
tags=tags,
|
|
56
|
+
is_recommended=is_recommended,
|
|
57
|
+
correlation_id=correlation_id,
|
|
58
|
+
api_version=api_version,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
response = await self._request_handler.make_request("GET", request_data)
|
|
62
|
+
|
|
63
|
+
if project_id is not None:
|
|
64
|
+
response["items"] = [
|
|
65
|
+
item for item in response["items"] if item["projectId"] == project_id
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
return GetDeploymentsResponse(**response)
|
|
69
|
+
|
|
70
|
+
async def get_deployment(
|
|
71
|
+
self,
|
|
72
|
+
deployment_id: str,
|
|
73
|
+
correlation_id: Optional[str] = None,
|
|
74
|
+
api_version: str = ApiVersion.V1.value,
|
|
75
|
+
) -> GetDeploymentResponse:
|
|
76
|
+
"""
|
|
77
|
+
Retrieve a single deployment by ID asynchronously.
|
|
78
|
+
|
|
79
|
+
This method fetches a specific deployment from the Airia platform using its
|
|
80
|
+
unique identifier. The response includes complete information about the deployment
|
|
81
|
+
including associated pipelines, data sources, user prompts, and configuration settings.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
deployment_id: The unique identifier of the deployment to retrieve
|
|
85
|
+
correlation_id: Optional correlation ID for request tracing
|
|
86
|
+
api_version: API version to use (defaults to V1)
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
GetDeploymentResponse: Complete deployment information
|
|
90
|
+
|
|
91
|
+
Raises:
|
|
92
|
+
AiriaAPIError: If the API request fails or deployment is not found
|
|
93
|
+
ValueError: If an invalid API version is provided
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
```python
|
|
97
|
+
client = AiriaAsyncClient(api_key="your-api-key")
|
|
98
|
+
deployment = await client.deployments.get_deployment("deployment-id-123")
|
|
99
|
+
print(f"Deployment: {deployment.deployment_name}")
|
|
100
|
+
print(f"Description: {deployment.description}")
|
|
101
|
+
print(f"Project: {deployment.project_id}")
|
|
102
|
+
```
|
|
103
|
+
"""
|
|
104
|
+
request_data = self._pre_get_deployment(
|
|
105
|
+
deployment_id=deployment_id,
|
|
106
|
+
correlation_id=correlation_id,
|
|
107
|
+
api_version=api_version,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = await self._request_handler.make_request("GET", request_data)
|
|
111
|
+
|
|
112
|
+
return GetDeploymentResponse(**response)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from typing import List, Optional, Union
|
|
2
|
+
from urllib.parse import urljoin
|
|
3
|
+
|
|
4
|
+
from ...types._api_version import ApiVersion
|
|
5
|
+
from .._request_handler import AsyncRequestHandler, RequestHandler
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BaseDeployments:
|
|
9
|
+
def __init__(self, request_handler: Union[RequestHandler, AsyncRequestHandler]):
|
|
10
|
+
self._request_handler = request_handler
|
|
11
|
+
|
|
12
|
+
def _pre_get_deployments(
|
|
13
|
+
self,
|
|
14
|
+
tags: Optional[List[str]] = None,
|
|
15
|
+
is_recommended: Optional[bool] = None,
|
|
16
|
+
correlation_id: Optional[str] = None,
|
|
17
|
+
api_version: str = ApiVersion.V2.value,
|
|
18
|
+
):
|
|
19
|
+
"""
|
|
20
|
+
Prepare request data for retrieving deployments.
|
|
21
|
+
|
|
22
|
+
This internal method constructs the URL and query parameters for deployment
|
|
23
|
+
retrieval requests, including optional filtering by tags and recommendation status.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
tags: Optional list of tags to filter deployments by
|
|
27
|
+
is_recommended: Optional filter by recommended status
|
|
28
|
+
correlation_id: Optional correlation ID for tracing
|
|
29
|
+
api_version: API version to use for the request
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
RequestData: Prepared request data for the deployments endpoint
|
|
33
|
+
|
|
34
|
+
Raises:
|
|
35
|
+
ValueError: If an invalid API version is provided
|
|
36
|
+
"""
|
|
37
|
+
if api_version not in ApiVersion.as_list():
|
|
38
|
+
raise ValueError(
|
|
39
|
+
f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
url = urljoin(
|
|
43
|
+
self._request_handler.base_url, f"{api_version}/Deployments/paged"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Build query parameters
|
|
47
|
+
params = {}
|
|
48
|
+
if tags is not None:
|
|
49
|
+
params["tags"] = tags
|
|
50
|
+
if is_recommended is not None:
|
|
51
|
+
params["isRecommended"] = is_recommended
|
|
52
|
+
|
|
53
|
+
request_data = self._request_handler.prepare_request(
|
|
54
|
+
url=url, params=params, correlation_id=correlation_id
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
return request_data
|
|
58
|
+
|
|
59
|
+
def _pre_get_deployment(
|
|
60
|
+
self,
|
|
61
|
+
deployment_id: str,
|
|
62
|
+
correlation_id: Optional[str] = None,
|
|
63
|
+
api_version: str = ApiVersion.V1.value,
|
|
64
|
+
):
|
|
65
|
+
"""
|
|
66
|
+
Prepare request data for retrieving a single deployment.
|
|
67
|
+
|
|
68
|
+
This internal method constructs the URL for deployment retrieval
|
|
69
|
+
by ID using the specified API version.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
deployment_id: The unique identifier of the deployment to retrieve
|
|
73
|
+
correlation_id: Optional correlation ID for tracing
|
|
74
|
+
api_version: API version to use for the request
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
RequestData: Prepared request data for the deployment endpoint
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
ValueError: If an invalid API version is provided
|
|
81
|
+
"""
|
|
82
|
+
if api_version not in ApiVersion.as_list():
|
|
83
|
+
raise ValueError(
|
|
84
|
+
f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
url = urljoin(
|
|
88
|
+
self._request_handler.base_url, f"{api_version}/Deployments/{deployment_id}"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
request_data = self._request_handler.prepare_request(
|
|
92
|
+
url=url, correlation_id=correlation_id
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return request_data
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.deployments import GetDeploymentResponse, GetDeploymentsResponse
|
|
5
|
+
from .._request_handler import RequestHandler
|
|
6
|
+
from .base_deployments import BaseDeployments
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Deployments(BaseDeployments):
|
|
10
|
+
def __init__(self, request_handler: RequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
def get_deployments(
|
|
14
|
+
self,
|
|
15
|
+
tags: Optional[List[str]] = None,
|
|
16
|
+
is_recommended: Optional[bool] = None,
|
|
17
|
+
project_id: Optional[str] = None,
|
|
18
|
+
correlation_id: Optional[str] = None,
|
|
19
|
+
api_version: str = ApiVersion.V2.value,
|
|
20
|
+
) -> GetDeploymentsResponse:
|
|
21
|
+
"""
|
|
22
|
+
Retrieve a paged list of deployments.
|
|
23
|
+
|
|
24
|
+
This method fetches deployments from the Airia platform with optional filtering
|
|
25
|
+
by tags and recommendation status. The response includes detailed information
|
|
26
|
+
about each deployment including associated pipelines, data sources, and user prompts.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
tags: Optional list of tags to filter deployments by
|
|
30
|
+
is_recommended: Optional filter by recommended status
|
|
31
|
+
project_id: Optional filter by project id
|
|
32
|
+
correlation_id: Optional correlation ID for request tracing
|
|
33
|
+
api_version: API version to use (defaults to V2)
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
GetDeploymentsResponse: Paged response containing deployment items and total count
|
|
37
|
+
|
|
38
|
+
Raises:
|
|
39
|
+
AiriaAPIError: If the API request fails
|
|
40
|
+
ValueError: If an invalid API version is provided
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
```python
|
|
44
|
+
client = AiriaClient(api_key="your-api-key")
|
|
45
|
+
deployments = client.deployments.get_deployments(
|
|
46
|
+
tags=["production", "nlp"],
|
|
47
|
+
is_recommended=True
|
|
48
|
+
)
|
|
49
|
+
print(f"Found {deployments.total_count} deployments")
|
|
50
|
+
for deployment in deployments.items:
|
|
51
|
+
print(f"- {deployment.deployment_name}")
|
|
52
|
+
```
|
|
53
|
+
"""
|
|
54
|
+
request_data = self._pre_get_deployments(
|
|
55
|
+
tags=tags,
|
|
56
|
+
is_recommended=is_recommended,
|
|
57
|
+
correlation_id=correlation_id,
|
|
58
|
+
api_version=api_version,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
response = self._request_handler.make_request("GET", request_data)
|
|
62
|
+
|
|
63
|
+
if project_id is not None:
|
|
64
|
+
response["items"] = [
|
|
65
|
+
item for item in response["items"] if item["projectId"] == project_id
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
return GetDeploymentsResponse(**response)
|
|
69
|
+
|
|
70
|
+
def get_deployment(
|
|
71
|
+
self,
|
|
72
|
+
deployment_id: str,
|
|
73
|
+
correlation_id: Optional[str] = None,
|
|
74
|
+
api_version: str = ApiVersion.V1.value,
|
|
75
|
+
) -> GetDeploymentResponse:
|
|
76
|
+
"""
|
|
77
|
+
Retrieve a single deployment by ID.
|
|
78
|
+
|
|
79
|
+
This method fetches a specific deployment from the Airia platform using its
|
|
80
|
+
unique identifier. The response includes complete information about the deployment
|
|
81
|
+
including associated pipelines, data sources, user prompts, and configuration settings.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
deployment_id: The unique identifier of the deployment to retrieve
|
|
85
|
+
correlation_id: Optional correlation ID for request tracing
|
|
86
|
+
api_version: API version to use (defaults to V1)
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
GetDeploymentResponse: Complete deployment information
|
|
90
|
+
|
|
91
|
+
Raises:
|
|
92
|
+
AiriaAPIError: If the API request fails or deployment is not found
|
|
93
|
+
ValueError: If an invalid API version is provided
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
```python
|
|
97
|
+
client = AiriaClient(api_key="your-api-key")
|
|
98
|
+
deployment = client.deployments.get_deployment("deployment-id-123")
|
|
99
|
+
print(f"Deployment: {deployment.deployment_name}")
|
|
100
|
+
print(f"Description: {deployment.description}")
|
|
101
|
+
print(f"Project: {deployment.project_id}")
|
|
102
|
+
```
|
|
103
|
+
"""
|
|
104
|
+
request_data = self._pre_get_deployment(
|
|
105
|
+
deployment_id=deployment_id,
|
|
106
|
+
correlation_id=correlation_id,
|
|
107
|
+
api_version=api_version,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = self._request_handler.make_request("GET", request_data)
|
|
111
|
+
|
|
112
|
+
return GetDeploymentResponse(**response)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.pipelines_config import PipelineConfigResponse
|
|
5
|
+
from .._request_handler import AsyncRequestHandler
|
|
6
|
+
from .base_pipelines_config import BasePipelinesConfig
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AsyncPipelinesConfig(BasePipelinesConfig):
|
|
10
|
+
def __init__(self, request_handler: AsyncRequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
async def get_pipeline_config(
|
|
14
|
+
self, pipeline_id: str, correlation_id: Optional[str] = None
|
|
15
|
+
) -> PipelineConfigResponse:
|
|
16
|
+
"""
|
|
17
|
+
Retrieve configuration details for a specific pipeline.
|
|
18
|
+
|
|
19
|
+
This method fetches comprehensive information about a pipeline including its
|
|
20
|
+
deployment details, execution statistics, version information, and metadata.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
pipeline_id (str): The unique identifier of the pipeline to retrieve
|
|
24
|
+
configuration for.
|
|
25
|
+
correlation_id (str, optional): A unique identifier for request tracing
|
|
26
|
+
and logging. If not provided, one will be automatically generated.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
PipelineConfigResponse: A response object containing the pipeline
|
|
30
|
+
configuration.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
AiriaAPIError: If the API request fails, including cases where:
|
|
34
|
+
- The pipeline_id doesn't exist (404)
|
|
35
|
+
- Authentication fails (401)
|
|
36
|
+
- Access is forbidden (403)
|
|
37
|
+
- Server errors (5xx)
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
```python
|
|
41
|
+
from airia import AiriaAsyncClient
|
|
42
|
+
|
|
43
|
+
client = AiriaAsyncClient(api_key="your_api_key")
|
|
44
|
+
|
|
45
|
+
# Get pipeline configuration
|
|
46
|
+
config = await client.pipelines_config.get_pipeline_config(
|
|
47
|
+
pipeline_id="your_pipeline_id"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
print(f"Pipeline: {config.agent.name}")
|
|
51
|
+
print(f"Description: {config.agent.agent_description}")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Note:
|
|
55
|
+
This method only retrieves configuration information and does not
|
|
56
|
+
execute the pipeline. Use execute_pipeline() to run the pipeline.
|
|
57
|
+
"""
|
|
58
|
+
request_data = self._pre_get_pipeline_config(
|
|
59
|
+
pipeline_id=pipeline_id,
|
|
60
|
+
correlation_id=correlation_id,
|
|
61
|
+
api_version=ApiVersion.V1.value,
|
|
62
|
+
)
|
|
63
|
+
resp = await self._request_handler.make_request("GET", request_data)
|
|
64
|
+
|
|
65
|
+
return PipelineConfigResponse(**resp)
|
|
@@ -9,38 +9,6 @@ class BasePipelinesConfig:
|
|
|
9
9
|
def __init__(self, request_handler: Union[RequestHandler, AsyncRequestHandler]):
|
|
10
10
|
self._request_handler = request_handler
|
|
11
11
|
|
|
12
|
-
def _pre_get_active_pipelines_ids(
|
|
13
|
-
self,
|
|
14
|
-
project_id: Optional[str] = None,
|
|
15
|
-
correlation_id: Optional[str] = None,
|
|
16
|
-
api_version: str = ApiVersion.V1.value,
|
|
17
|
-
):
|
|
18
|
-
"""
|
|
19
|
-
Prepare request data for getting active pipelines IDs.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
project_id: ID of the project to get configuration for
|
|
23
|
-
correlation_id: Optional correlation ID for tracing
|
|
24
|
-
api_version: API version to use for the request
|
|
25
|
-
|
|
26
|
-
Returns:
|
|
27
|
-
RequestData: Prepared request data for the pipeline config endpoint
|
|
28
|
-
|
|
29
|
-
Raises:
|
|
30
|
-
ValueError: If an invalid API version is provided
|
|
31
|
-
"""
|
|
32
|
-
if api_version not in ApiVersion.as_list():
|
|
33
|
-
raise ValueError(
|
|
34
|
-
f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
|
|
35
|
-
)
|
|
36
|
-
url = urljoin(self._request_handler.base_url, f"{api_version}/PipelinesConfig")
|
|
37
|
-
params = {"projectId": project_id} if project_id is not None else None
|
|
38
|
-
request_data = self._request_handler.prepare_request(
|
|
39
|
-
url, params=params, correlation_id=correlation_id
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
return request_data
|
|
43
|
-
|
|
44
12
|
def _pre_get_pipeline_config(
|
|
45
13
|
self,
|
|
46
14
|
pipeline_id: str,
|
|
@@ -67,7 +35,7 @@ class BasePipelinesConfig:
|
|
|
67
35
|
)
|
|
68
36
|
url = urljoin(
|
|
69
37
|
self._request_handler.base_url,
|
|
70
|
-
f"{api_version}/PipelinesConfig/
|
|
38
|
+
f"{api_version}/PipelinesConfig/{pipeline_id}",
|
|
71
39
|
)
|
|
72
40
|
request_data = self._request_handler.prepare_request(
|
|
73
41
|
url, correlation_id=correlation_id
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from ...types._api_version import ApiVersion
|
|
4
|
+
from ...types.api.pipelines_config import PipelineConfigResponse
|
|
5
|
+
from .._request_handler import RequestHandler
|
|
6
|
+
from .base_pipelines_config import BasePipelinesConfig
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PipelinesConfig(BasePipelinesConfig):
|
|
10
|
+
def __init__(self, request_handler: RequestHandler):
|
|
11
|
+
super().__init__(request_handler)
|
|
12
|
+
|
|
13
|
+
def get_pipeline_config(
|
|
14
|
+
self, pipeline_id: str, correlation_id: Optional[str] = None
|
|
15
|
+
) -> PipelineConfigResponse:
|
|
16
|
+
"""
|
|
17
|
+
Retrieve configuration details for a specific pipeline.
|
|
18
|
+
|
|
19
|
+
This method fetches comprehensive information about a pipeline including its
|
|
20
|
+
deployment details, execution statistics, version information, and metadata.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
pipeline_id (str): The unique identifier of the pipeline to retrieve
|
|
24
|
+
configuration for.
|
|
25
|
+
correlation_id (str, optional): A unique identifier for request tracing
|
|
26
|
+
and logging. If not provided, one will be automatically generated.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
PipelineConfigResponse: A response object containing the pipeline
|
|
30
|
+
configuration.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
AiriaAPIError: If the API request fails, including cases where:
|
|
34
|
+
- The pipeline_id doesn't exist (404)
|
|
35
|
+
- Authentication fails (401)
|
|
36
|
+
- Access is forbidden (403)
|
|
37
|
+
- Server errors (5xx)
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
```python
|
|
41
|
+
from airia import AiriaClient
|
|
42
|
+
|
|
43
|
+
client = AiriaClient(api_key="your_api_key")
|
|
44
|
+
|
|
45
|
+
# Get pipeline configuration
|
|
46
|
+
config = client.pipelines_config.get_pipeline_config(
|
|
47
|
+
pipeline_id="your_pipeline_id"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
print(f"Pipeline: {config.agent.name}")
|
|
51
|
+
print(f"Description: {config.agent.agent_description}")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Note:
|
|
55
|
+
This method only retrieves configuration information and does not
|
|
56
|
+
execute the pipeline. Use execute_pipeline() to run the pipeline.
|
|
57
|
+
"""
|
|
58
|
+
request_data = self._pre_get_pipeline_config(
|
|
59
|
+
pipeline_id=pipeline_id,
|
|
60
|
+
correlation_id=correlation_id,
|
|
61
|
+
api_version=ApiVersion.V1.value,
|
|
62
|
+
)
|
|
63
|
+
resp = self._request_handler.make_request("GET", request_data)
|
|
64
|
+
|
|
65
|
+
return PipelineConfigResponse(**resp)
|
|
@@ -11,6 +11,7 @@ from ..constants import (
|
|
|
11
11
|
from ._request_handler import RequestHandler
|
|
12
12
|
from .base_client import AiriaBaseClient
|
|
13
13
|
from .conversations import Conversations
|
|
14
|
+
from .deployments import Deployments
|
|
14
15
|
from .pipeline_execution import PipelineExecution
|
|
15
16
|
from .pipelines_config import PipelinesConfig
|
|
16
17
|
from .project import Project
|
|
@@ -62,6 +63,7 @@ class AiriaClient(AiriaBaseClient):
|
|
|
62
63
|
self.project = Project(self._request_handler)
|
|
63
64
|
self.conversations = Conversations(self._request_handler)
|
|
64
65
|
self.store = Store(self._request_handler)
|
|
66
|
+
self.deployments = Deployments(self._request_handler)
|
|
65
67
|
|
|
66
68
|
@classmethod
|
|
67
69
|
def with_openai_gateway(
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from ._conversations import (
|
|
2
|
+
ConversationMessage,
|
|
3
|
+
CreateConversationResponse,
|
|
4
|
+
GetConversationResponse,
|
|
5
|
+
PolicyRedaction,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"CreateConversationResponse",
|
|
10
|
+
"GetConversationResponse",
|
|
11
|
+
"ConversationMessage",
|
|
12
|
+
"PolicyRedaction",
|
|
13
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API types for deployment management.
|
|
3
|
+
|
|
4
|
+
This module exports all deployment-related response models and types
|
|
5
|
+
used by the deployments API endpoints.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .get_deployment import GetDeploymentResponse
|
|
9
|
+
from .get_deployments import (
|
|
10
|
+
AboutDeploymentMetadata,
|
|
11
|
+
DataSource,
|
|
12
|
+
DeploymentItem,
|
|
13
|
+
GetDeploymentsResponse,
|
|
14
|
+
Project,
|
|
15
|
+
UserPrompt,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"AboutDeploymentMetadata",
|
|
20
|
+
"DataSource",
|
|
21
|
+
"DeploymentItem",
|
|
22
|
+
"GetDeploymentResponse",
|
|
23
|
+
"GetDeploymentsResponse",
|
|
24
|
+
"Project",
|
|
25
|
+
"UserPrompt",
|
|
26
|
+
]
|