airia 0.1.6__tar.gz → 0.1.8__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.
Files changed (31) hide show
  1. {airia-0.1.6 → airia-0.1.8}/PKG-INFO +2 -6
  2. {airia-0.1.6 → airia-0.1.8}/README.md +1 -5
  3. {airia-0.1.6 → airia-0.1.8}/airia/client/base_client.py +1 -1
  4. airia-0.1.8/airia/types/api/get_pipeline_config.py +150 -0
  5. {airia-0.1.6 → airia-0.1.8}/airia.egg-info/PKG-INFO +2 -6
  6. {airia-0.1.6 → airia-0.1.8}/pyproject.toml +1 -1
  7. airia-0.1.8/tests/test_get_pipeline_config.py +449 -0
  8. airia-0.1.6/airia/types/api/get_pipeline_config.py +0 -65
  9. airia-0.1.6/tests/test_get_pipeline_config.py +0 -394
  10. {airia-0.1.6 → airia-0.1.8}/LICENSE +0 -0
  11. {airia-0.1.6 → airia-0.1.8}/airia/__init__.py +0 -0
  12. {airia-0.1.6 → airia-0.1.8}/airia/client/__init__.py +0 -0
  13. {airia-0.1.6 → airia-0.1.8}/airia/client/async_client.py +0 -0
  14. {airia-0.1.6 → airia-0.1.8}/airia/client/sync_client.py +0 -0
  15. {airia-0.1.6 → airia-0.1.8}/airia/exceptions.py +0 -0
  16. {airia-0.1.6 → airia-0.1.8}/airia/logs.py +0 -0
  17. {airia-0.1.6 → airia-0.1.8}/airia/types/__init__.py +0 -0
  18. {airia-0.1.6 → airia-0.1.8}/airia/types/api/pipeline_execution.py +0 -0
  19. {airia-0.1.6 → airia-0.1.8}/airia/types/api_version.py +0 -0
  20. {airia-0.1.6 → airia-0.1.8}/airia/types/request_data.py +0 -0
  21. {airia-0.1.6 → airia-0.1.8}/airia/types/sse_messages.py +0 -0
  22. {airia-0.1.6 → airia-0.1.8}/airia/utils/sse_parser.py +0 -0
  23. {airia-0.1.6 → airia-0.1.8}/airia.egg-info/SOURCES.txt +0 -0
  24. {airia-0.1.6 → airia-0.1.8}/airia.egg-info/dependency_links.txt +0 -0
  25. {airia-0.1.6 → airia-0.1.8}/airia.egg-info/requires.txt +0 -0
  26. {airia-0.1.6 → airia-0.1.8}/airia.egg-info/top_level.txt +0 -0
  27. {airia-0.1.6 → airia-0.1.8}/setup.cfg +0 -0
  28. {airia-0.1.6 → airia-0.1.8}/tests/test_anthropic_gateway.py +0 -0
  29. {airia-0.1.6 → airia-0.1.8}/tests/test_execute_pipeline.py +0 -0
  30. {airia-0.1.6 → airia-0.1.8}/tests/test_get_active_pipelines_ids.py +0 -0
  31. {airia-0.1.6 → airia-0.1.8}/tests/test_openai_gateway.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airia
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Python SDK for Airia API
5
5
  Author-email: Airia LLC <support@airia.com>
6
6
  License: MIT
@@ -348,11 +348,7 @@ client = AiriaClient(api_key="your_api_key")
348
348
  config = client.get_pipeline_config(pipeline_id="your_pipeline_id")
349
349
 
350
350
  # Access configuration details
351
- print(f"Pipeline Name: {config.deployment_name}")
352
- print(f"Description: {config.deployment_description}")
353
- print(f"Active Version: {config.active_version.version_number}")
354
- print(f"Success Count: {config.execution_stats.success_count}")
355
- print(f"Failure Count: {config.execution_stats.failure_count}")
351
+ print(f"Pipeline Name: {config.agent.name}")
356
352
  ```
357
353
 
358
354
  ## Gateway Usage
@@ -318,11 +318,7 @@ client = AiriaClient(api_key="your_api_key")
318
318
  config = client.get_pipeline_config(pipeline_id="your_pipeline_id")
319
319
 
320
320
  # Access configuration details
321
- print(f"Pipeline Name: {config.deployment_name}")
322
- print(f"Description: {config.deployment_description}")
323
- print(f"Active Version: {config.active_version.version_number}")
324
- print(f"Success Count: {config.execution_stats.success_count}")
325
- print(f"Failure Count: {config.execution_stats.failure_count}")
321
+ print(f"Pipeline Name: {config.agent.name}")
326
322
  ```
327
323
 
328
324
  ## Gateway Usage
@@ -212,7 +212,7 @@ class AiriaBaseClient:
212
212
  raise ValueError(
213
213
  f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
214
214
  )
215
- url = urljoin(self.base_url, f"{api_version}/PipelinesConfig/{pipeline_id}")
215
+ url = urljoin(self.base_url, f"{api_version}/PipelinesConfig/export/{pipeline_id}")
216
216
  request_data = self._prepare_request(url, correlation_id=correlation_id)
217
217
 
218
218
  return request_data
@@ -0,0 +1,150 @@
1
+ from typing import Any, Dict, List, Optional
2
+
3
+ from pydantic import BaseModel, Field
4
+
5
+
6
+ class Metadata(BaseModel):
7
+ id: str
8
+ export_version: str = Field(alias="exportVersion")
9
+ tagline: Optional[str] = None
10
+ agent_description: Optional[str] = Field(alias="agentDescription", default=None)
11
+ industry: Optional[str] = None
12
+ tasks: Optional[str] = None
13
+ credential_export_option: str = Field(alias="credentialExportOption")
14
+ data_source_export_option: str = Field(alias="dataSourceExportOption")
15
+ version_information: str = Field(alias="versionInformation")
16
+ state: str
17
+
18
+
19
+ class Agent(BaseModel):
20
+ name: str
21
+ execution_name: str = Field(alias="executionName")
22
+ agent_description: Optional[str] = Field(alias="agentDescription", default=None)
23
+ video_link: Optional[str] = Field(alias="videoLink", default=None)
24
+ industry: Optional[str] = None
25
+ sub_industries: List[str] = Field(alias="subIndustries", default_factory=list)
26
+ agent_details: Dict[str, Any] = Field(alias="agentDetails", default_factory=dict)
27
+ id: str
28
+ agent_icon: Optional[str] = Field(alias="agentIcon", default=None)
29
+ steps: List[Dict[str, Any]]
30
+
31
+
32
+ class PromptMessage(BaseModel):
33
+ text: str
34
+ order: int
35
+
36
+
37
+ class Prompt(BaseModel):
38
+ name: str
39
+ version_change_description: str = Field(alias="versionChangeDescription")
40
+ prompt_message_list: List[PromptMessage] = Field(alias="promptMessageList")
41
+ id: str
42
+
43
+
44
+ class CredentialData(BaseModel):
45
+ key: str
46
+ value: str
47
+
48
+
49
+ class CredentialsDefinition(BaseModel):
50
+ name: str
51
+ credential_type: str = Field(alias="credentialType")
52
+ source_type: str = Field(alias="sourceType")
53
+ credential_data_list: List[CredentialData] = Field(alias="credentialDataList")
54
+ id: str
55
+
56
+
57
+ class HeaderDefinition(BaseModel):
58
+ key: str
59
+ value: str
60
+
61
+
62
+ class ParameterDefinition(BaseModel):
63
+ name: str
64
+ parameter_type: str = Field(alias="parameterType")
65
+ parameter_description: str = Field(alias="parameterDescription")
66
+ default: str
67
+ valid_options: List[str] = Field(alias="validOptions", default_factory=list)
68
+ id: str
69
+
70
+
71
+ class Tool(BaseModel):
72
+ tool_type: str = Field(alias="toolType")
73
+ name: str
74
+ standardized_name: str = Field(alias="standardizedName")
75
+ tool_description: str = Field(alias="toolDescription")
76
+ purpose: str
77
+ api_endpoint: str = Field(alias="apiEndpoint")
78
+ credentials_definition: Optional[CredentialsDefinition] = Field(
79
+ alias="credentialsDefinition"
80
+ )
81
+ headers_definition: List[HeaderDefinition] = Field(alias="headersDefinition")
82
+ body: str
83
+ parameters_definition: List[ParameterDefinition] = Field(
84
+ alias="parametersDefinition"
85
+ )
86
+ method_type: str = Field(alias="methodType")
87
+ route_through_acc: bool = Field(alias="routeThroughACC")
88
+ use_user_credentials: bool = Field(alias="useUserCredentials")
89
+ use_user_credentials_type: str = Field(alias="useUserCredentialsType")
90
+ id: str
91
+
92
+
93
+ class Model(BaseModel):
94
+ id: str
95
+ display_name: str = Field(alias="displayName")
96
+ model_name: str = Field(alias="modelName")
97
+ prompt_id: Optional[str] = Field(alias="promptId", default=None)
98
+ system_prompt_definition: Optional[Any] = Field(
99
+ alias="systemPromptDefinition", default=None
100
+ )
101
+ url: str
102
+ input_type: str = Field(alias="inputType")
103
+ provider: str
104
+ credentials_definition: CredentialsDefinition = Field(alias="credentialsDefinition")
105
+ deployment_type: str = Field(alias="deploymentType")
106
+ source_type: str = Field(alias="sourceType")
107
+ connection_string: Optional[str] = Field(alias="connectionString", default=None)
108
+ container_name: Optional[str] = Field(alias="containerName", default=None)
109
+ deployed_key: Optional[str] = Field(alias="deployedKey", default=None)
110
+ deployed_url: Optional[str] = Field(alias="deployedUrl", default=None)
111
+ state: Optional[str] = None
112
+ uploaded_container_id: Optional[str] = Field(
113
+ alias="uploadedContainerId", default=None
114
+ )
115
+ library_model_id: Optional[str] = Field(alias="libraryModelId")
116
+ input_token_price: str = Field(alias="inputTokenPrice")
117
+ output_token_price: str = Field(alias="outputTokenPrice")
118
+ token_units: int = Field(alias="tokenUnits")
119
+ has_tool_support: bool = Field(alias="hasToolSupport")
120
+ allow_airia_credentials: bool = Field(alias="allowAiriaCredentials")
121
+ allow_byok_credentials: bool = Field(alias="allowBYOKCredentials")
122
+ author: Optional[str]
123
+ price_type: str = Field(alias="priceType")
124
+
125
+
126
+ class PythonCodeBlock(BaseModel):
127
+ id: str
128
+ code: str
129
+
130
+
131
+ class Router(BaseModel):
132
+ id: str
133
+ model_id: str = Field(alias="modelId")
134
+ model: Optional[Any] = None
135
+ router_config: Dict[str, Dict[str, Any]] = Field(alias="routerConfig")
136
+
137
+
138
+ class GetPipelineConfigResponse(BaseModel):
139
+ metadata: Metadata
140
+ agent: Agent
141
+ data_sources: Optional[List[Any]] = Field(alias="dataSources", default_factory=list)
142
+ prompts: Optional[List[Prompt]] = Field(default_factory=list)
143
+ tools: Optional[List[Tool]] = Field(default_factory=list)
144
+ models: Optional[List[Model]] = Field(default_factory=list)
145
+ memories: Optional[Any] = None
146
+ python_code_blocks: Optional[List[PythonCodeBlock]] = Field(
147
+ alias="pythonCodeBlocks", default_factory=list
148
+ )
149
+ routers: Optional[List[Router]] = Field(default_factory=list)
150
+ deployment: Optional[Any] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airia
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Python SDK for Airia API
5
5
  Author-email: Airia LLC <support@airia.com>
6
6
  License: MIT
@@ -348,11 +348,7 @@ client = AiriaClient(api_key="your_api_key")
348
348
  config = client.get_pipeline_config(pipeline_id="your_pipeline_id")
349
349
 
350
350
  # Access configuration details
351
- print(f"Pipeline Name: {config.deployment_name}")
352
- print(f"Description: {config.deployment_description}")
353
- print(f"Active Version: {config.active_version.version_number}")
354
- print(f"Success Count: {config.execution_stats.success_count}")
355
- print(f"Failure Count: {config.execution_stats.failure_count}")
351
+ print(f"Pipeline Name: {config.agent.name}")
356
352
  ```
357
353
 
358
354
  ## Gateway Usage
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "airia"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  description = "Python SDK for Airia API"
9
9
  license = { text = "MIT" }
10
10
  authors = [{ name = "Airia LLC", email = "support@airia.com" }]
@@ -0,0 +1,449 @@
1
+ from unittest.mock import patch
2
+
3
+ import pytest
4
+ import pytest_asyncio
5
+ from dotenv import load_dotenv
6
+
7
+ from airia import AiriaAPIError, AiriaAsyncClient, AiriaClient
8
+ from airia.types import GetPipelineConfigResponse
9
+
10
+ # Load environment variables for testing
11
+ load_dotenv()
12
+ PYTHON_PIPELINE = "0134da17-c5a5-4730-a576-92f8eaf0926f"
13
+
14
+
15
+ @pytest.fixture
16
+ def sync_client():
17
+ return AiriaClient(log_requests=True)
18
+
19
+
20
+ @pytest_asyncio.fixture
21
+ async def async_client():
22
+ return AiriaAsyncClient(log_requests=True)
23
+
24
+
25
+ # Mock response data for testing
26
+ MOCK_PIPELINE_CONFIG_RESPONSE = {
27
+ "metadata": {
28
+ "id": "17554b31-2370-4d2d-91de-4fe4805b9ef9",
29
+ "exportVersion": "20250612041452_AddAiInternalMcpServerActionsToUsage",
30
+ "tagline": "",
31
+ "agentDescription": "",
32
+ "industry": "",
33
+ "tasks": "",
34
+ "credentialExportOption": "Placeholder",
35
+ "dataSourceExportOption": "Placeholder",
36
+ "versionInformation": "7.00",
37
+ "state": "Preview",
38
+ },
39
+ "agent": {
40
+ "name": "Omni Agent - Test Agent to be Described",
41
+ "executionName": "untitled_agent_%281%29",
42
+ "agentDescription": "",
43
+ "videoLink": None,
44
+ "industry": None,
45
+ "subIndustries": [],
46
+ "agentDetails": {},
47
+ "id": "17554b31-2370-4d2d-91de-4fe4805b9ef9",
48
+ "agentIcon": None,
49
+ "steps": [
50
+ {
51
+ "id": "1d180b16-d097-45e8-bf3a-031a4c4b959d",
52
+ "stepType": "pythonStep",
53
+ "position": {"x": "12", "y": "378"},
54
+ "handles": [
55
+ {
56
+ "uuid": "c75a1538-8ff5-4abb-acfd-d0554738e34f",
57
+ "type": "target",
58
+ "label": "",
59
+ "tooltip": "",
60
+ "x": 87,
61
+ "y": -3,
62
+ },
63
+ {
64
+ "uuid": "9734a974-9d0c-486b-b00d-aa2135c62bbc",
65
+ "type": "source",
66
+ "label": "",
67
+ "tooltip": "",
68
+ "x": 87,
69
+ "y": 53.299988,
70
+ },
71
+ ],
72
+ "dependenciesObject": [
73
+ {
74
+ "parentId": "f896b741-87d5-49de-92f9-881677da1dca",
75
+ "parentHandleId": "7099c54b-ebd1-46a4-b1b8-602ccbbab1d5",
76
+ "handleId": "c75a1538-8ff5-4abb-acfd-d0554738e34f",
77
+ }
78
+ ],
79
+ "pythonCodeBlockId": "1d180b16-d097-45e8-bf3a-031a4c4b959d",
80
+ "stepTitle": "Python Code",
81
+ },
82
+ {
83
+ "id": "5a03ca6c-8b1c-4cee-bad2-32507e767e41",
84
+ "stepType": "outputStep",
85
+ "position": {"x": "507", "y": "790"},
86
+ "handles": [
87
+ {
88
+ "uuid": "04c6e2b3-b430-45bb-9bff-bb9e5b0ecdbb",
89
+ "type": "target",
90
+ "label": "",
91
+ "tooltip": "",
92
+ "x": 57,
93
+ "y": -3,
94
+ }
95
+ ],
96
+ "dependenciesObject": [
97
+ {
98
+ "parentId": "ac6467bf-999d-4aab-a747-73fa0c96b01e",
99
+ "parentHandleId": "36ddab85-8bdd-433b-9516-35391bc363da",
100
+ "handleId": "04c6e2b3-b430-45bb-9bff-bb9e5b0ecdbb",
101
+ }
102
+ ],
103
+ "stepTitle": "Output",
104
+ },
105
+ {
106
+ "id": "9f6f9f66-712f-497d-bffd-3fe2823bd7ab",
107
+ "stepType": "inputStep",
108
+ "position": {"x": "483", "y": "12"},
109
+ "handles": [
110
+ {
111
+ "uuid": "64b87a80-7e5c-47c5-8819-a2b0f780e600",
112
+ "type": "source",
113
+ "label": "",
114
+ "tooltip": "",
115
+ "x": 69,
116
+ "y": 39.300003,
117
+ }
118
+ ],
119
+ "dependenciesObject": [],
120
+ "stepTitle": "Input",
121
+ },
122
+ {
123
+ "id": "ac6467bf-999d-4aab-a747-73fa0c96b01e",
124
+ "stepType": "AIOperation",
125
+ "position": {"x": "447", "y": "584"},
126
+ "handles": [
127
+ {
128
+ "uuid": "36ddab85-8bdd-433b-9516-35391bc363da",
129
+ "type": "source",
130
+ "label": "",
131
+ "tooltip": "",
132
+ "x": 87,
133
+ "y": 62.69998,
134
+ },
135
+ {
136
+ "uuid": "9921db77-05b9-4129-8a18-0c55a2ac038d",
137
+ "type": "target",
138
+ "label": "",
139
+ "tooltip": "",
140
+ "x": 87,
141
+ "y": -3,
142
+ },
143
+ ],
144
+ "dependenciesObject": [
145
+ {
146
+ "parentId": "1d180b16-d097-45e8-bf3a-031a4c4b959d",
147
+ "parentHandleId": "9734a974-9d0c-486b-b00d-aa2135c62bbc",
148
+ "handleId": "9921db77-05b9-4129-8a18-0c55a2ac038d",
149
+ },
150
+ {
151
+ "parentId": "ddd98da0-e1c7-42c1-abdf-8c4bf86d6fc2",
152
+ "parentHandleId": "a8988cf5-03ba-427c-9793-60173b7ab23d",
153
+ "handleId": "9921db77-05b9-4129-8a18-0c55a2ac038d",
154
+ },
155
+ {
156
+ "parentId": "f896b741-87d5-49de-92f9-881677da1dca",
157
+ "parentHandleId": "7099c54b-ebd1-46a4-b1b8-602ccbbab1d5",
158
+ "handleId": "9921db77-05b9-4129-8a18-0c55a2ac038d",
159
+ },
160
+ ],
161
+ "temperature": 0.7,
162
+ "includeDateTimeContext": False,
163
+ "promptId": "cfce7cf4-0ba3-47fd-9376-1138fd44ad45",
164
+ "modelId": "4c511bda-95f6-4717-b210-0b9b4e331720",
165
+ "toolIds": ["01976577-2452-7d96-815b-d590e7f16364"],
166
+ "toolParams": {},
167
+ "stepTitle": "AI Model 1",
168
+ },
169
+ {
170
+ "id": "ddd98da0-e1c7-42c1-abdf-8c4bf86d6fc2",
171
+ "stepType": "dataSearch",
172
+ "position": {"x": "447", "y": "360"},
173
+ "handles": [
174
+ {
175
+ "uuid": "a8988cf5-03ba-427c-9793-60173b7ab23d",
176
+ "type": "source",
177
+ "label": "",
178
+ "tooltip": "",
179
+ "x": 87,
180
+ "y": 71.29999,
181
+ },
182
+ {
183
+ "uuid": "427c9f8b-3b7d-4a52-a76f-9ce23548caac",
184
+ "type": "target",
185
+ "label": "",
186
+ "tooltip": "",
187
+ "x": 87,
188
+ "y": -3,
189
+ },
190
+ ],
191
+ "dependenciesObject": [
192
+ {
193
+ "parentId": "f896b741-87d5-49de-92f9-881677da1dca",
194
+ "parentHandleId": "7099c54b-ebd1-46a4-b1b8-602ccbbab1d5",
195
+ "handleId": "427c9f8b-3b7d-4a52-a76f-9ce23548caac",
196
+ }
197
+ ],
198
+ "dataSourceId": "01976170-1aa6-7900-8b6d-238bb32caa35",
199
+ "topK": 5,
200
+ "relevanceThreshold": 20,
201
+ "neighboringChunksCount": 1,
202
+ "hybridSearchAlpha": 0.5,
203
+ "databaseType": "",
204
+ "stepTitle": "Data Source",
205
+ },
206
+ {
207
+ "id": "f896b741-87d5-49de-92f9-881677da1dca",
208
+ "stepType": "routerStep",
209
+ "position": {"x": "447", "y": "172"},
210
+ "handles": [
211
+ {
212
+ "uuid": "8f4953a3-fe39-4b4c-bfbd-31ea473862f5",
213
+ "type": "target",
214
+ "label": "",
215
+ "tooltip": "",
216
+ "x": 87,
217
+ "y": -3,
218
+ },
219
+ {
220
+ "uuid": "7099c54b-ebd1-46a4-b1b8-602ccbbab1d5",
221
+ "type": "source",
222
+ "label": "Route 1",
223
+ "tooltip": "",
224
+ "x": 87,
225
+ "y": 53.299988,
226
+ },
227
+ ],
228
+ "dependenciesObject": [
229
+ {
230
+ "parentId": "9f6f9f66-712f-497d-bffd-3fe2823bd7ab",
231
+ "parentHandleId": "64b87a80-7e5c-47c5-8819-a2b0f780e600",
232
+ "handleId": "8f4953a3-fe39-4b4c-bfbd-31ea473862f5",
233
+ }
234
+ ],
235
+ "stepTitle": "Router",
236
+ },
237
+ ],
238
+ },
239
+ "dataSources": [],
240
+ "prompts": [
241
+ {
242
+ "name": "Helpful Agent",
243
+ "versionChangeDescription": "Initial version",
244
+ "promptMessageList": [{"text": "You are a helpful agent.", "order": 0}],
245
+ "id": "cfce7cf4-0ba3-47fd-9376-1138fd44ad45",
246
+ }
247
+ ],
248
+ "tools": [
249
+ {
250
+ "toolType": "YoutubeSearch",
251
+ "name": "Search Youtube",
252
+ "standardizedName": "search_youtube",
253
+ "toolDescription": "Search YouTube for videos on a specific subject",
254
+ "purpose": "To search YouTube for videos on a specific subject",
255
+ "apiEndpoint": "https://www.googleapis.com/youtube/v3/search?part=snippet&q=<Subject/>&maxResults=<maxResults/>",
256
+ "credentialsDefinition": {
257
+ "name": "YoutubeSearch",
258
+ "credentialType": "Youtube",
259
+ "sourceType": "library",
260
+ "credentialDataList": [
261
+ {"key": "youtubeApiKey", "value": "**placeholder**"}
262
+ ],
263
+ "id": "4be7b206-c5be-405e-af59-ba292cd68bd9",
264
+ },
265
+ "headersDefinition": [{"key": "Accept", "value": "application/json"}],
266
+ "body": "",
267
+ "parametersDefinition": [
268
+ {
269
+ "name": "Subject",
270
+ "parameterType": "string",
271
+ "parameterDescription": "The subject to search for",
272
+ "default": "",
273
+ "validOptions": [],
274
+ "id": "00000000-0000-0000-0000-000000000000",
275
+ },
276
+ {
277
+ "name": "maxResults",
278
+ "parameterType": "integer",
279
+ "parameterDescription": "The maximum number of results to return. If no values is provided from the user the default value is 5. If a value requested is less than 5 set it to 5.",
280
+ "default": "",
281
+ "validOptions": [],
282
+ "id": "00000000-0000-0000-0000-000000000000",
283
+ },
284
+ ],
285
+ "methodType": "GET",
286
+ "routeThroughACC": False,
287
+ "useUserCredentials": False,
288
+ "useUserCredentialsType": "YoutubeKey",
289
+ "id": "01976577-2452-7d96-815b-d590e7f16364",
290
+ }
291
+ ],
292
+ "models": [
293
+ {
294
+ "id": "4c511bda-95f6-4717-b210-0b9b4e331720",
295
+ "displayName": "GPT 4.1",
296
+ "modelName": "gpt-4.1-2025-04-14",
297
+ "promptId": None,
298
+ "systemPromptDefinition": None,
299
+ "url": "https://api.openai.com/v1/chat/completions",
300
+ "inputType": "image",
301
+ "provider": "OpenAI",
302
+ "credentialsDefinition": {
303
+ "name": "OpenAI",
304
+ "credentialType": "OpenAI",
305
+ "sourceType": "library",
306
+ "credentialDataList": [
307
+ {"key": "openaiApiKey", "value": "**placeholder**"}
308
+ ],
309
+ "id": "580e51d7-b4b0-410c-86ff-11e34cee1242",
310
+ },
311
+ "deploymentType": "marketplace",
312
+ "sourceType": "library",
313
+ "connectionString": None,
314
+ "containerName": None,
315
+ "deployedKey": None,
316
+ "deployedUrl": None,
317
+ "state": None,
318
+ "uploadedContainerId": None,
319
+ "libraryModelId": "7e9a1b22-3c5f-4a57-a9d4-8b6d1e5f8a27",
320
+ "inputTokenPrice": "0.00000206",
321
+ "outputTokenPrice": "0.00000824",
322
+ "tokenUnits": 1000,
323
+ "hasToolSupport": True,
324
+ "allowAiriaCredentials": True,
325
+ "allowBYOKCredentials": True,
326
+ "author": "OpenAI",
327
+ "priceType": "AITextOutputModelPrice",
328
+ }
329
+ ],
330
+ "memories": None,
331
+ "pythonCodeBlocks": [
332
+ {
333
+ "id": "1d180b16-d097-45e8-bf3a-031a4c4b959d",
334
+ "code": "output = \"Always start your response with 'Let's do this!'\"",
335
+ }
336
+ ],
337
+ "routers": [
338
+ {
339
+ "id": "f896b741-87d5-49de-92f9-881677da1dca",
340
+ "modelId": "2e005300-b320-40ff-af41-b641486b559c",
341
+ "model": None,
342
+ "routerConfig": {
343
+ "7099c54b-ebd1-46a4-b1b8-602ccbbab1d5": {
344
+ "id": "00000000-0000-0000-0000-000000000000",
345
+ "prompt": "",
346
+ "isDefault": True,
347
+ }
348
+ },
349
+ }
350
+ ],
351
+ "deployment": None,
352
+ }
353
+
354
+
355
+ class TestSyncGetPipelineConfig:
356
+ """Test cases for synchronous get_pipeline_config method."""
357
+
358
+ def test_get_pipeline_config_success(self, sync_client: AiriaClient):
359
+ """Test successful pipeline configuration retrieval."""
360
+ response = sync_client.get_pipeline_config(pipeline_id=PYTHON_PIPELINE)
361
+ # Verify the response is properly typed
362
+ assert isinstance(response, GetPipelineConfigResponse)
363
+
364
+ def test_get_pipeline_config_with_custom_api_version(
365
+ self, sync_client: AiriaClient
366
+ ):
367
+ """Test pipeline configuration retrieval with custom API version."""
368
+ with patch.object(sync_client, "_make_request") as mock_request:
369
+ mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
370
+
371
+ response = sync_client.get_pipeline_config(
372
+ pipeline_id="test-pipeline-123", api_version="v1"
373
+ )
374
+
375
+ assert isinstance(response, GetPipelineConfigResponse)
376
+
377
+ def test_get_pipeline_config_with_correlation_id(self, sync_client: AiriaClient):
378
+ """Test pipeline configuration retrieval with custom correlation ID."""
379
+ with patch.object(sync_client, "_make_request") as mock_request:
380
+ mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
381
+
382
+ custom_correlation_id = "test-correlation-123"
383
+ response = sync_client.get_pipeline_config(
384
+ pipeline_id="test-pipeline-123", correlation_id=custom_correlation_id
385
+ )
386
+
387
+ assert isinstance(response, GetPipelineConfigResponse)
388
+
389
+ def test_get_pipeline_config_invalid_api_version(self, sync_client: AiriaClient):
390
+ """Test that invalid API version raises ValueError."""
391
+ with pytest.raises(ValueError, match="Invalid API version"):
392
+ sync_client.get_pipeline_config(
393
+ pipeline_id="test-pipeline-123", api_version="invalid_version"
394
+ )
395
+
396
+ def test_get_pipeline_config_api_error(self, sync_client: AiriaClient):
397
+ """Test handling of API errors."""
398
+ with patch.object(sync_client, "_make_request") as mock_request:
399
+ mock_request.side_effect = AiriaAPIError(
400
+ status_code=404, message="Pipeline not found"
401
+ )
402
+
403
+ with pytest.raises(AiriaAPIError) as exc_info:
404
+ sync_client.get_pipeline_config(pipeline_id="nonexistent-pipeline")
405
+
406
+ assert exc_info.value.status_code == 404
407
+ assert "Pipeline not found" in str(exc_info.value)
408
+
409
+
410
+ class TestAsyncGetPipelineConfig:
411
+ """Test cases for asynchronous get_pipeline_config method."""
412
+
413
+ @pytest.mark.asyncio
414
+ async def test_get_pipeline_config_success(self, async_client: AiriaAsyncClient):
415
+ """Test successful asynchronous pipeline configuration retrieval."""
416
+ response = await async_client.get_pipeline_config(pipeline_id=PYTHON_PIPELINE)
417
+
418
+ # Verify the response is properly typed
419
+ assert isinstance(response, GetPipelineConfigResponse)
420
+
421
+ @pytest.mark.asyncio
422
+ async def test_get_pipeline_config_with_custom_params(
423
+ self, async_client: AiriaAsyncClient
424
+ ):
425
+ """Test asynchronous pipeline configuration retrieval with custom parameters."""
426
+ with patch.object(async_client, "_make_request") as mock_request:
427
+ mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
428
+
429
+ response = await async_client.get_pipeline_config(
430
+ pipeline_id="test-pipeline-123",
431
+ api_version="v1",
432
+ correlation_id="async-test-correlation",
433
+ )
434
+
435
+ assert isinstance(response, GetPipelineConfigResponse)
436
+
437
+ @pytest.mark.asyncio
438
+ async def test_get_pipeline_config_api_error(self, async_client: AiriaAsyncClient):
439
+ """Test handling of API errors in async context."""
440
+ with patch.object(async_client, "_make_request") as mock_request:
441
+ mock_request.side_effect = AiriaAPIError(
442
+ status_code=403, message="Access forbidden"
443
+ )
444
+
445
+ with pytest.raises(AiriaAPIError) as exc_info:
446
+ await async_client.get_pipeline_config(pipeline_id="forbidden-pipeline")
447
+
448
+ assert exc_info.value.status_code == 403
449
+ assert "Access forbidden" in str(exc_info.value)
@@ -1,65 +0,0 @@
1
- from datetime import datetime
2
- from typing import Any, Dict, List, Optional
3
-
4
- from pydantic import BaseModel, Field
5
-
6
-
7
- class Version(BaseModel):
8
- pipeline_id: str = Field(alias="pipelineId")
9
- major_version: int = Field(alias="majorVersion")
10
- minor_version: int = Field(alias="minorVersion")
11
- version_number: str = Field(alias="versionNumber")
12
- is_draft_version: bool = Field(alias="isDraftVersion")
13
- is_latest: bool = Field(alias="isLatest")
14
- steps: Optional[List[Dict[str, Any]]] = None
15
- alignment: str
16
- id: str
17
- tenant_id: str = Field(alias="tenantId")
18
- project_id: str = Field(alias="projectId")
19
- created_at: datetime = Field(alias="createdAt")
20
- updated_at: datetime = Field(alias="updatedAt")
21
- user_id: str = Field(alias="userId")
22
-
23
-
24
- class ExecutionStats(BaseModel):
25
- success_count: int = Field(alias="successCount")
26
- failure_count: int = Field(alias="failureCount")
27
-
28
-
29
- class GetPipelineConfigResponse(BaseModel):
30
- deployment_id: Optional[str] = Field(alias="deploymentId")
31
- deployment_name: Optional[str] = Field(alias="deploymentName")
32
- deployment_description: Optional[str] = Field(alias="deploymentDescription")
33
- user_keys: Dict[str, Any] = Field(alias="userKeys")
34
- group_keys: Dict[str, Any] = Field(alias="groupKeys")
35
- agent_icon: Optional[str] = Field(alias="agentIcon")
36
- external: bool
37
- active_version_id: str = Field(alias="activeVersionId")
38
- name: str
39
- execution_name: str = Field(alias="executionName")
40
- description: str
41
- video_link: Optional[str] = Field(alias="videoLink")
42
- agent_icon_id: Optional[str] = Field(alias="agentIconId")
43
- versions: List[Version]
44
- execution_stats: ExecutionStats = Field(alias="executionStats")
45
- industry: Optional[str]
46
- sub_industries: List[str] = Field(alias="subIndustries")
47
- agent_details: Dict[str, Any] = Field(alias="agentDetails")
48
- agent_details_tags: List[str] = Field(alias="agentDetailsTags")
49
- active_version: Version = Field(alias="activeVersion")
50
- backup_pipeline_id: Optional[str] = Field(alias="backupPipelineId")
51
- deployment: Optional[Any]
52
- library_agent_id: Optional[str] = Field(alias="libraryAgentId")
53
- library_imported_hash: Optional[str] = Field(alias="libraryImportedHash")
54
- library_imported_version: Optional[str] = Field(alias="libraryImportedVersion")
55
- is_deleted: Optional[bool] = Field(alias="isDeleted")
56
- agent_trigger: Optional[Any] = Field(alias="agentTrigger")
57
- api_key_id: Optional[str] = Field(alias="apiKeyId")
58
- is_seeded: bool = Field(alias="isSeeded")
59
- behaviours: List[Any]
60
- id: str
61
- tenant_id: str = Field(alias="tenantId")
62
- project_id: str = Field(alias="projectId")
63
- created_at: datetime = Field(alias="createdAt")
64
- updated_at: datetime = Field(alias="updatedAt")
65
- user_id: str = Field(alias="userId")
@@ -1,394 +0,0 @@
1
- from unittest.mock import patch
2
-
3
- import pytest
4
- import pytest_asyncio
5
- from dotenv import load_dotenv
6
-
7
- from airia import AiriaAPIError, AiriaAsyncClient, AiriaClient
8
- from airia.types import GetPipelineConfigResponse
9
-
10
- # Load environment variables for testing
11
- load_dotenv()
12
- PYTHON_PIPELINE = "0134da17-c5a5-4730-a576-92f8eaf0926f"
13
-
14
-
15
- @pytest.fixture
16
- def sync_client():
17
- return AiriaClient(log_requests=True)
18
-
19
-
20
- @pytest_asyncio.fixture
21
- async def async_client():
22
- return AiriaAsyncClient(log_requests=True)
23
-
24
-
25
- # Mock response data for testing
26
- MOCK_PIPELINE_CONFIG_RESPONSE = {
27
- "deploymentId": None,
28
- "deploymentName": None,
29
- "deploymentDescription": None,
30
- "userKeys": {},
31
- "groupKeys": {},
32
- "agentIcon": None,
33
- "external": False,
34
- "activeVersionId": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
35
- "name": "Python Block Test",
36
- "executionName": "python_block_test",
37
- "description": "",
38
- "videoLink": None,
39
- "agentIconId": None,
40
- "versions": [
41
- {
42
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
43
- "majorVersion": 1,
44
- "minorVersion": 0,
45
- "versionNumber": "1.00",
46
- "isDraftVersion": False,
47
- "isLatest": False,
48
- "steps": None,
49
- "alignment": "Horizontal",
50
- "id": "1756d834-4c2a-4271-beff-b6a1b8b4737f",
51
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
52
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
53
- "createdAt": "2025-03-26T20:33:31.9410340Z",
54
- "updatedAt": "2025-03-26T22:37:25.8345390Z",
55
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
56
- },
57
- {
58
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
59
- "majorVersion": 2,
60
- "minorVersion": 0,
61
- "versionNumber": "2.00",
62
- "isDraftVersion": False,
63
- "isLatest": False,
64
- "steps": None,
65
- "alignment": "Horizontal",
66
- "id": "0ac78be5-182c-4350-b5a9-128fb8904ded",
67
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
68
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
69
- "createdAt": "2025-03-26T22:37:25.8318150Z",
70
- "updatedAt": "2025-03-26T22:40:49.4444470Z",
71
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
72
- },
73
- {
74
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
75
- "majorVersion": 3,
76
- "minorVersion": 0,
77
- "versionNumber": "3.00",
78
- "isDraftVersion": False,
79
- "isLatest": False,
80
- "steps": None,
81
- "alignment": "Horizontal",
82
- "id": "8b4cff91-22c9-4f49-8d56-c7679e97d896",
83
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
84
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
85
- "createdAt": "2025-03-26T22:40:49.4406740Z",
86
- "updatedAt": "2025-03-26T22:50:14.2888930Z",
87
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
88
- },
89
- {
90
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
91
- "majorVersion": 4,
92
- "minorVersion": 0,
93
- "versionNumber": "4.00",
94
- "isDraftVersion": False,
95
- "isLatest": False,
96
- "steps": None,
97
- "alignment": "Horizontal",
98
- "id": "a51ab51f-f680-46fe-bb92-9ccdf35d05ab",
99
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
100
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
101
- "createdAt": "2025-03-26T22:50:53.2168600Z",
102
- "updatedAt": "2025-03-26T23:52:29.1746240Z",
103
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
104
- },
105
- {
106
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
107
- "majorVersion": 5,
108
- "minorVersion": 0,
109
- "versionNumber": "5.00",
110
- "isDraftVersion": False,
111
- "isLatest": True,
112
- "steps": None,
113
- "alignment": "Horizontal",
114
- "id": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
115
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
116
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
117
- "createdAt": "2025-03-26T23:52:29.1722390Z",
118
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
119
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
120
- },
121
- ],
122
- "executionStats": {"successCount": 1039, "failureCount": 1},
123
- "industry": None,
124
- "subIndustries": [],
125
- "agentDetails": {},
126
- "agentDetailsTags": [],
127
- "activeVersion": {
128
- "pipelineId": "0134da17-c5a5-4730-a576-92f8eaf0926f",
129
- "majorVersion": 5,
130
- "minorVersion": 0,
131
- "versionNumber": "5.00",
132
- "isDraftVersion": False,
133
- "isLatest": True,
134
- "steps": [
135
- {
136
- "code": '"""\nThis Block processes input data and client context to produce an output.\n\nAvailable Variables:\n- input (str): Input from previous steps.\n- client_data (dict): Contains user context with the following keys:\n - user_id (str): The user\'s unique identifier.\n - conversation_id (str): The conversation\'s unique identifier.\n - user_input (str): The user\'s input text.\n - user_roles (List[str]): The user\'s roles.\n - user_groups (List[str]): The user\'s groups.\n - images (List[str]): An array of image URLs.\n - additional_info (List[Any]): an array of objects containing additional information passed to the agent.\n - step_inputs (List[Any]): The inputs for the current step.\n - files (List[str]): The files associated with the request. \n- execution_parameters (dict): Contains the following keys:\n - execution_id (str): The unique identifier for the execution.\n - step_results_by_type (dict): A dictionary containing the results of the previous steps, ordered by completion, with the following keys:\n - model (List[Any]): The results of the model steps.\n - data_source (List[Any]): The results of the data search steps.\n - memory_load (List[Any]): The results of the memory load steps.\n - memory_store (List[Any]): The results of the memory store steps. \n - python (List[Any]): The results of the python steps.\n - router (List[Any]): The results of the router steps.\n - tool_action (List[Any]): The results of the tool action steps.\n - agent (List[Any]): The results of the agent steps.\n \nReturns:\n- output (str): The processed output, initially set to the input value.\n"""\n\n# Your code here\noutput = input # Assign your output to this variable\n\nif len(client_data["images"]) > 0:\n output = f\'{len(client_data["images"])} images\'\n\nif len(client_data["files"]) > 0:\n output = f\'{len(client_data["files"])} files\'\n\nif len(client_data["additional_info"]) > 0:\n output = str(client_data["additional_info"])\n',
137
- "stepType": "pythonStep",
138
- "position": None,
139
- "positionId": "a8c9cfa0-6313-4f1b-a28b-cdd2350b05d3",
140
- "handles": [
141
- {
142
- "pipelineStepId": "48c1e273-e1ba-47df-a713-35eee1c2d7d7",
143
- "uuid": "198db5b2-75d6-4fe1-92d9-b347207449a4",
144
- "type": "source",
145
- "label": "",
146
- "tooltip": "",
147
- "x": 255.9375,
148
- "y": 47.738647,
149
- "id": "95f413c2-0e3f-47c5-af31-38549dd72bef",
150
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
151
- "projectId": "00000000-0000-0000-0000-000000000000",
152
- "createdAt": "2025-03-26T23:52:29.1722350Z",
153
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
154
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
155
- },
156
- {
157
- "pipelineStepId": "48c1e273-e1ba-47df-a713-35eee1c2d7d7",
158
- "uuid": "ca16a5b9-f32e-454d-873d-1e9efa0ce167",
159
- "type": "target",
160
- "label": "",
161
- "tooltip": "",
162
- "x": -5.4454956,
163
- "y": 47.738647,
164
- "id": "fc0b1989-1e49-4e3c-8f22-094426513669",
165
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
166
- "projectId": "00000000-0000-0000-0000-000000000000",
167
- "createdAt": "2025-03-26T23:52:29.1722360Z",
168
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
169
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
170
- },
171
- ],
172
- "dependenciesObject": [
173
- {
174
- "pipelineStepId": "48c1e273-e1ba-47df-a713-35eee1c2d7d7",
175
- "parentId": "ae8b9ff8-7f95-4b62-9fde-2c7127448a10",
176
- "parentHandleId": "b81a7e4e-3e55-4797-889d-a4f6015cab9b",
177
- "handleId": "ca16a5b9-f32e-454d-873d-1e9efa0ce167",
178
- "id": "e59f33f2-33c8-4b04-a2cd-3df416979771",
179
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
180
- "projectId": "00000000-0000-0000-0000-000000000000",
181
- "createdAt": "2025-03-26T23:52:29.1722330Z",
182
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
183
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
184
- }
185
- ],
186
- "pipelineVersionId": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
187
- "stepTitle": "Python Code",
188
- "id": "48c1e273-e1ba-47df-a713-35eee1c2d7d7",
189
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
190
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
191
- "createdAt": "2025-03-26T20:33:31.9370040Z",
192
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
193
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
194
- },
195
- {
196
- "stepType": "outputStep",
197
- "position": None,
198
- "positionId": "fef7c865-1b6e-4896-b1c4-7d89fbfad260",
199
- "handles": [
200
- {
201
- "pipelineStepId": "a0f14314-602d-46d8-b6be-d350865231c9",
202
- "uuid": "b5de5347-6897-4414-ae3c-0d4f513f6461",
203
- "type": "target",
204
- "label": "",
205
- "tooltip": "",
206
- "x": -5.4453125,
207
- "y": 32.491364,
208
- "id": "95be20fa-a8d0-40a8-9047-20cb7546c8e7",
209
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
210
- "projectId": "00000000-0000-0000-0000-000000000000",
211
- "createdAt": "2025-03-26T23:52:29.1722320Z",
212
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
213
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
214
- }
215
- ],
216
- "dependenciesObject": [
217
- {
218
- "pipelineStepId": "a0f14314-602d-46d8-b6be-d350865231c9",
219
- "parentId": "48c1e273-e1ba-47df-a713-35eee1c2d7d7",
220
- "parentHandleId": "198db5b2-75d6-4fe1-92d9-b347207449a4",
221
- "handleId": "b5de5347-6897-4414-ae3c-0d4f513f6461",
222
- "id": "c11e97cf-994d-479a-97da-195a60c3bef0",
223
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
224
- "projectId": "00000000-0000-0000-0000-000000000000",
225
- "createdAt": "2025-03-26T23:52:29.1722290Z",
226
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
227
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
228
- }
229
- ],
230
- "pipelineVersionId": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
231
- "stepTitle": "Output",
232
- "id": "a0f14314-602d-46d8-b6be-d350865231c9",
233
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
234
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
235
- "createdAt": "2025-03-26T20:33:31.9369710Z",
236
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
237
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
238
- },
239
- {
240
- "inputVariables": [],
241
- "inputTemplate": None,
242
- "stepType": "inputStep",
243
- "position": None,
244
- "positionId": "b7e17fb7-1ee4-42e3-803b-6d3053673f23",
245
- "handles": [
246
- {
247
- "pipelineStepId": "ae8b9ff8-7f95-4b62-9fde-2c7127448a10",
248
- "uuid": "b81a7e4e-3e55-4797-889d-a4f6015cab9b",
249
- "type": "source",
250
- "label": "",
251
- "tooltip": "",
252
- "x": 255.93744,
253
- "y": 32.491364,
254
- "id": "b6be5af9-7534-450f-850b-14cb7ad654bf",
255
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
256
- "projectId": "00000000-0000-0000-0000-000000000000",
257
- "createdAt": "2025-03-26T23:52:29.1722380Z",
258
- "updatedAt": "2025-03-26T23:52:29.1746240Z",
259
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
260
- }
261
- ],
262
- "dependenciesObject": [],
263
- "pipelineVersionId": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
264
- "stepTitle": "Input",
265
- "id": "ae8b9ff8-7f95-4b62-9fde-2c7127448a10",
266
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
267
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
268
- "createdAt": "2025-03-26T20:33:31.9369340Z",
269
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
270
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
271
- },
272
- ],
273
- "alignment": "Horizontal",
274
- "id": "6e98f6ae-d666-4db0-9495-b5b40e45b482",
275
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
276
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
277
- "createdAt": "2025-03-26T23:52:29.1722390Z",
278
- "updatedAt": "2025-03-26T23:52:29.1746230Z",
279
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
280
- },
281
- "backupPipelineId": None,
282
- "deployment": None,
283
- "libraryAgentId": None,
284
- "libraryImportedHash": None,
285
- "libraryImportedVersion": None,
286
- "isDeleted": None,
287
- "agentTrigger": None,
288
- "apiKeyId": None,
289
- "isSeeded": False,
290
- "behaviours": [],
291
- "id": "0134da17-c5a5-4730-a576-92f8eaf0926f",
292
- "tenantId": "2ce49ae0-c3ff-421a-91b7-830d0c73b348",
293
- "projectId": "01948f99-f78a-7415-a187-b250c6e04458",
294
- "createdAt": "2025-03-26T20:33:31.9410260Z",
295
- "updatedAt": "2025-03-26T23:52:31.1933780Z",
296
- "userId": "9f7e215f-5563-414e-9635-570efa078c35",
297
- }
298
-
299
-
300
- class TestSyncGetPipelineConfig:
301
- """Test cases for synchronous get_pipeline_config method."""
302
-
303
- def test_get_pipeline_config_success(self, sync_client: AiriaClient):
304
- """Test successful pipeline configuration retrieval."""
305
- response = sync_client.get_pipeline_config(pipeline_id=PYTHON_PIPELINE)
306
- # Verify the response is properly typed
307
- assert isinstance(response, GetPipelineConfigResponse)
308
-
309
- def test_get_pipeline_config_with_custom_api_version(
310
- self, sync_client: AiriaClient
311
- ):
312
- """Test pipeline configuration retrieval with custom API version."""
313
- with patch.object(sync_client, "_make_request") as mock_request:
314
- mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
315
-
316
- response = sync_client.get_pipeline_config(
317
- pipeline_id="test-pipeline-123", api_version="v1"
318
- )
319
-
320
- assert isinstance(response, GetPipelineConfigResponse)
321
-
322
- def test_get_pipeline_config_with_correlation_id(self, sync_client: AiriaClient):
323
- """Test pipeline configuration retrieval with custom correlation ID."""
324
- with patch.object(sync_client, "_make_request") as mock_request:
325
- mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
326
-
327
- custom_correlation_id = "test-correlation-123"
328
- response = sync_client.get_pipeline_config(
329
- pipeline_id="test-pipeline-123", correlation_id=custom_correlation_id
330
- )
331
-
332
- assert isinstance(response, GetPipelineConfigResponse)
333
-
334
- def test_get_pipeline_config_invalid_api_version(self, sync_client: AiriaClient):
335
- """Test that invalid API version raises ValueError."""
336
- with pytest.raises(ValueError, match="Invalid API version"):
337
- sync_client.get_pipeline_config(
338
- pipeline_id="test-pipeline-123", api_version="invalid_version"
339
- )
340
-
341
- def test_get_pipeline_config_api_error(self, sync_client: AiriaClient):
342
- """Test handling of API errors."""
343
- with patch.object(sync_client, "_make_request") as mock_request:
344
- mock_request.side_effect = AiriaAPIError(
345
- status_code=404, message="Pipeline not found"
346
- )
347
-
348
- with pytest.raises(AiriaAPIError) as exc_info:
349
- sync_client.get_pipeline_config(pipeline_id="nonexistent-pipeline")
350
-
351
- assert exc_info.value.status_code == 404
352
- assert "Pipeline not found" in str(exc_info.value)
353
-
354
-
355
- class TestAsyncGetPipelineConfig:
356
- """Test cases for asynchronous get_pipeline_config method."""
357
-
358
- @pytest.mark.asyncio
359
- async def test_get_pipeline_config_success(self, async_client: AiriaAsyncClient):
360
- """Test successful asynchronous pipeline configuration retrieval."""
361
- response = await async_client.get_pipeline_config(pipeline_id=PYTHON_PIPELINE)
362
-
363
- # Verify the response is properly typed
364
- assert isinstance(response, GetPipelineConfigResponse)
365
-
366
- @pytest.mark.asyncio
367
- async def test_get_pipeline_config_with_custom_params(
368
- self, async_client: AiriaAsyncClient
369
- ):
370
- """Test asynchronous pipeline configuration retrieval with custom parameters."""
371
- with patch.object(async_client, "_make_request") as mock_request:
372
- mock_request.return_value = MOCK_PIPELINE_CONFIG_RESPONSE
373
-
374
- response = await async_client.get_pipeline_config(
375
- pipeline_id="test-pipeline-123",
376
- api_version="v1",
377
- correlation_id="async-test-correlation",
378
- )
379
-
380
- assert isinstance(response, GetPipelineConfigResponse)
381
-
382
- @pytest.mark.asyncio
383
- async def test_get_pipeline_config_api_error(self, async_client: AiriaAsyncClient):
384
- """Test handling of API errors in async context."""
385
- with patch.object(async_client, "_make_request") as mock_request:
386
- mock_request.side_effect = AiriaAPIError(
387
- status_code=403, message="Access forbidden"
388
- )
389
-
390
- with pytest.raises(AiriaAPIError) as exc_info:
391
- await async_client.get_pipeline_config(pipeline_id="forbidden-pipeline")
392
-
393
- assert exc_info.value.status_code == 403
394
- assert "Access forbidden" in str(exc_info.value)
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