airia 0.1.15__tar.gz → 0.1.17__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 (77) hide show
  1. {airia-0.1.15 → airia-0.1.17}/PKG-INFO +1 -1
  2. {airia-0.1.15 → airia-0.1.17}/airia/client/_request_handler/base_request_handler.py +1 -1
  3. {airia-0.1.15 → airia-0.1.17}/airia/client/async_client.py +2 -0
  4. airia-0.1.17/airia/client/data_vector_search/__init__.py +4 -0
  5. airia-0.1.17/airia/client/data_vector_search/async_data_vector_search.py +74 -0
  6. airia-0.1.15/airia/client/pipelines_config/base_pipelines_config.py → airia-0.1.17/airia/client/data_vector_search/base_data_vector_search.py +14 -8
  7. airia-0.1.17/airia/client/data_vector_search/sync_data_vector_search.py +68 -0
  8. airia-0.1.17/airia/client/pipelines_config/async_pipelines_config.py +125 -0
  9. airia-0.1.17/airia/client/pipelines_config/base_pipelines_config.py +78 -0
  10. airia-0.1.17/airia/client/pipelines_config/sync_pipelines_config.py +125 -0
  11. {airia-0.1.15 → airia-0.1.17}/airia/client/sync_client.py +2 -0
  12. airia-0.1.17/airia/types/api/data_vector_search/__init__.py +3 -0
  13. airia-0.1.17/airia/types/api/data_vector_search/get_file_chunks.py +45 -0
  14. airia-0.1.17/airia/types/api/pipelines_config/__init__.py +87 -0
  15. airia-0.1.17/airia/types/api/pipelines_config/export_pipeline_definition.py +940 -0
  16. {airia-0.1.15 → airia-0.1.17}/airia.egg-info/PKG-INFO +1 -1
  17. {airia-0.1.15 → airia-0.1.17}/airia.egg-info/SOURCES.txt +7 -0
  18. {airia-0.1.15 → airia-0.1.17}/pyproject.toml +1 -1
  19. airia-0.1.15/airia/client/pipelines_config/async_pipelines_config.py +0 -65
  20. airia-0.1.15/airia/client/pipelines_config/sync_pipelines_config.py +0 -65
  21. airia-0.1.15/airia/types/api/pipelines_config/__init__.py +0 -35
  22. {airia-0.1.15 → airia-0.1.17}/LICENSE +0 -0
  23. {airia-0.1.15 → airia-0.1.17}/README.md +0 -0
  24. {airia-0.1.15 → airia-0.1.17}/airia/__init__.py +0 -0
  25. {airia-0.1.15 → airia-0.1.17}/airia/client/__init__.py +0 -0
  26. {airia-0.1.15 → airia-0.1.17}/airia/client/_request_handler/__init__.py +0 -0
  27. {airia-0.1.15 → airia-0.1.17}/airia/client/_request_handler/async_request_handler.py +0 -0
  28. {airia-0.1.15 → airia-0.1.17}/airia/client/_request_handler/sync_request_handler.py +0 -0
  29. {airia-0.1.15 → airia-0.1.17}/airia/client/base_client.py +0 -0
  30. {airia-0.1.15 → airia-0.1.17}/airia/client/conversations/__init__.py +0 -0
  31. {airia-0.1.15 → airia-0.1.17}/airia/client/conversations/async_conversations.py +0 -0
  32. {airia-0.1.15 → airia-0.1.17}/airia/client/conversations/base_conversations.py +0 -0
  33. {airia-0.1.15 → airia-0.1.17}/airia/client/conversations/sync_conversations.py +0 -0
  34. {airia-0.1.15 → airia-0.1.17}/airia/client/deployments/__init__.py +0 -0
  35. {airia-0.1.15 → airia-0.1.17}/airia/client/deployments/async_deployments.py +0 -0
  36. {airia-0.1.15 → airia-0.1.17}/airia/client/deployments/base_deployments.py +0 -0
  37. {airia-0.1.15 → airia-0.1.17}/airia/client/deployments/sync_deployments.py +0 -0
  38. {airia-0.1.15 → airia-0.1.17}/airia/client/pipeline_execution/__init__.py +0 -0
  39. {airia-0.1.15 → airia-0.1.17}/airia/client/pipeline_execution/async_pipeline_execution.py +0 -0
  40. {airia-0.1.15 → airia-0.1.17}/airia/client/pipeline_execution/base_pipeline_execution.py +0 -0
  41. {airia-0.1.15 → airia-0.1.17}/airia/client/pipeline_execution/sync_pipeline_execution.py +0 -0
  42. {airia-0.1.15 → airia-0.1.17}/airia/client/pipelines_config/__init__.py +0 -0
  43. {airia-0.1.15 → airia-0.1.17}/airia/client/project/__init__.py +0 -0
  44. {airia-0.1.15 → airia-0.1.17}/airia/client/project/async_project.py +0 -0
  45. {airia-0.1.15 → airia-0.1.17}/airia/client/project/base_project.py +0 -0
  46. {airia-0.1.15 → airia-0.1.17}/airia/client/project/sync_project.py +0 -0
  47. {airia-0.1.15 → airia-0.1.17}/airia/client/store/__init__.py +0 -0
  48. {airia-0.1.15 → airia-0.1.17}/airia/client/store/async_store.py +0 -0
  49. {airia-0.1.15 → airia-0.1.17}/airia/client/store/base_store.py +0 -0
  50. {airia-0.1.15 → airia-0.1.17}/airia/client/store/sync_store.py +0 -0
  51. {airia-0.1.15 → airia-0.1.17}/airia/constants.py +0 -0
  52. {airia-0.1.15 → airia-0.1.17}/airia/exceptions.py +0 -0
  53. {airia-0.1.15 → airia-0.1.17}/airia/logs.py +0 -0
  54. {airia-0.1.15 → airia-0.1.17}/airia/types/__init__.py +0 -0
  55. {airia-0.1.15 → airia-0.1.17}/airia/types/_api_version.py +0 -0
  56. {airia-0.1.15 → airia-0.1.17}/airia/types/_request_data.py +0 -0
  57. {airia-0.1.15 → airia-0.1.17}/airia/types/api/__init__.py +0 -0
  58. {airia-0.1.15 → airia-0.1.17}/airia/types/api/conversations/__init__.py +0 -0
  59. {airia-0.1.15 → airia-0.1.17}/airia/types/api/conversations/_conversations.py +0 -0
  60. {airia-0.1.15 → airia-0.1.17}/airia/types/api/deployments/__init__.py +0 -0
  61. {airia-0.1.15 → airia-0.1.17}/airia/types/api/deployments/get_deployment.py +0 -0
  62. {airia-0.1.15 → airia-0.1.17}/airia/types/api/deployments/get_deployments.py +0 -0
  63. {airia-0.1.15 → airia-0.1.17}/airia/types/api/pipeline_execution/__init__.py +0 -0
  64. {airia-0.1.15 → airia-0.1.17}/airia/types/api/pipeline_execution/_pipeline_execution.py +0 -0
  65. {airia-0.1.15 → airia-0.1.17}/airia/types/api/pipelines_config/get_pipeline_config.py +0 -0
  66. {airia-0.1.15 → airia-0.1.17}/airia/types/api/project/__init__.py +0 -0
  67. {airia-0.1.15 → airia-0.1.17}/airia/types/api/project/get_projects.py +0 -0
  68. {airia-0.1.15 → airia-0.1.17}/airia/types/api/store/__init__.py +0 -0
  69. {airia-0.1.15 → airia-0.1.17}/airia/types/api/store/get_file.py +0 -0
  70. {airia-0.1.15 → airia-0.1.17}/airia/types/api/store/get_files.py +0 -0
  71. {airia-0.1.15 → airia-0.1.17}/airia/types/sse/__init__.py +0 -0
  72. {airia-0.1.15 → airia-0.1.17}/airia/types/sse/sse_messages.py +0 -0
  73. {airia-0.1.15 → airia-0.1.17}/airia/utils/sse_parser.py +0 -0
  74. {airia-0.1.15 → airia-0.1.17}/airia.egg-info/dependency_links.txt +0 -0
  75. {airia-0.1.15 → airia-0.1.17}/airia.egg-info/requires.txt +0 -0
  76. {airia-0.1.15 → airia-0.1.17}/airia.egg-info/top_level.txt +0 -0
  77. {airia-0.1.15 → airia-0.1.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airia
3
- Version: 0.1.15
3
+ Version: 0.1.17
4
4
  Summary: Python SDK for Airia API
5
5
  Author-email: Airia LLC <support@airia.com>
6
6
  License: MIT
@@ -89,7 +89,7 @@ class BaseRequestHandler:
89
89
  log_payload = json.dumps(log_payload)
90
90
 
91
91
  self.logger.info(
92
- f"API Request: POST {url}\n"
92
+ f"URL: {url}\n"
93
93
  f"Headers: {json.dumps(log_headers)}\n"
94
94
  f"Payload: {log_payload}\n"
95
95
  f"Files: {log_files}\n"
@@ -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 .data_vector_search import AsyncDataVectorSearch
14
15
  from .deployments import AsyncDeployments
15
16
  from .pipeline_execution import AsyncPipelineExecution
16
17
  from .pipelines_config import AsyncPipelinesConfig
@@ -64,6 +65,7 @@ class AiriaAsyncClient(AiriaBaseClient):
64
65
  self.conversations = AsyncConversations(self._request_handler)
65
66
  self.store = AsyncStore(self._request_handler)
66
67
  self.deployments = AsyncDeployments(self._request_handler)
68
+ self.data_vector_search = AsyncDataVectorSearch(self._request_handler)
67
69
 
68
70
  @classmethod
69
71
  def with_openai_gateway(
@@ -0,0 +1,4 @@
1
+ from .async_data_vector_search import AsyncDataVectorSearch
2
+ from .sync_data_vector_search import DataVectorSearch
3
+
4
+ __all__ = ["DataVectorSearch", "AsyncDataVectorSearch"]
@@ -0,0 +1,74 @@
1
+ from typing import Optional
2
+
3
+ from ...types._api_version import ApiVersion
4
+ from ...types.api.data_vector_search import GetFileChunksResponse
5
+ from .._request_handler import AsyncRequestHandler
6
+ from .base_data_vector_search import BaseDataVectorSearch
7
+
8
+
9
+ class AsyncDataVectorSearch(BaseDataVectorSearch):
10
+ def __init__(self, request_handler: AsyncRequestHandler):
11
+ super().__init__(request_handler)
12
+
13
+ async def get_file_chunks(
14
+ self, data_store_id: str, file_id: str, correlation_id: Optional[str] = None
15
+ ) -> GetFileChunksResponse:
16
+ """
17
+ Retrieve chunks from a specific file in a data store.
18
+
19
+ This method retrieves chunks from a file in the specified data store.
20
+
21
+ Args:
22
+ data_store_id: The unique identifier of the data store (GUID format)
23
+ file_id: The unique identifier of the file (GUID format)
24
+ correlation_id: Optional correlation ID for request tracing
25
+
26
+ Returns:
27
+ GetFileChunksResponse: Object containing the chunks and pagination information
28
+
29
+ Raises:
30
+ AiriaAPIError: If the API request fails, including cases where:
31
+ - The data_store_id doesn't exist (404)
32
+ - The file_id doesn't exist (404)
33
+ - Authentication fails (401)
34
+ - Access is forbidden (403)
35
+ - Server errors (5xx)
36
+ ValueError: If required parameters are missing or invalid
37
+
38
+ Example:
39
+ ```python
40
+ from airia import AiriaAsyncClient
41
+ import asyncio
42
+
43
+ async def main():
44
+ client = AiriaAsyncClient(api_key="your_api_key")
45
+
46
+ # Get file chunks with default pagination
47
+ chunks_response = await client.data_vector_search.get_file_chunks(
48
+ data_store_id="your_data_store_id",
49
+ file_id="your_file_id"
50
+ )
51
+
52
+ # Access the chunks
53
+ for chunk in chunks_response.chunks:
54
+ print(f"Chunk: {chunk.chunk}")
55
+ print(f"Document: {chunk.document_name}")
56
+ if chunk.score is not None:
57
+ print(f"Score: {chunk.score}")
58
+
59
+ await client.close()
60
+
61
+ asyncio.run(main())
62
+ ```
63
+ """
64
+ request_data = self._pre_get_file_chunks(
65
+ data_store_id=data_store_id,
66
+ file_id=file_id,
67
+ correlation_id=correlation_id,
68
+ api_version=ApiVersion.V1.value,
69
+ )
70
+
71
+ response = await self._request_handler.make_request(
72
+ "GET", request_data, return_json=True
73
+ )
74
+ return GetFileChunksResponse(**response)
@@ -5,26 +5,30 @@ from ...types._api_version import ApiVersion
5
5
  from .._request_handler import AsyncRequestHandler, RequestHandler
6
6
 
7
7
 
8
- class BasePipelinesConfig:
8
+ class BaseDataVectorSearch:
9
9
  def __init__(self, request_handler: Union[RequestHandler, AsyncRequestHandler]):
10
10
  self._request_handler = request_handler
11
11
 
12
- def _pre_get_pipeline_config(
12
+ def _pre_get_file_chunks(
13
13
  self,
14
- pipeline_id: str,
14
+ data_store_id: str,
15
+ file_id: str,
15
16
  correlation_id: Optional[str] = None,
16
17
  api_version: str = ApiVersion.V1.value,
17
18
  ):
18
19
  """
19
- Prepare request data for getting pipeline configuration endpoint.
20
+ Prepare request data for get file chunks endpoint.
21
+
22
+ This internal method constructs the URL for file chunks retrieval requests.
20
23
 
21
24
  Args:
22
- pipeline_id: ID of the pipeline to get configuration for
25
+ data_store_id: ID of the data store
26
+ file_id: ID of the file
23
27
  correlation_id: Optional correlation ID for tracing
24
28
  api_version: API version to use for the request
25
29
 
26
30
  Returns:
27
- RequestData: Prepared request data for the pipeline config endpoint
31
+ RequestData: Prepared request data for the get file chunks endpoint
28
32
 
29
33
  Raises:
30
34
  ValueError: If an invalid API version is provided
@@ -33,12 +37,14 @@ class BasePipelinesConfig:
33
37
  raise ValueError(
34
38
  f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
35
39
  )
40
+
36
41
  url = urljoin(
37
42
  self._request_handler.base_url,
38
- f"{api_version}/PipelinesConfig/{pipeline_id}",
43
+ f"{api_version}/DataVectorSearch/chunks/{data_store_id}/{file_id}",
39
44
  )
45
+
40
46
  request_data = self._request_handler.prepare_request(
41
- url, correlation_id=correlation_id
47
+ url, correlation_id=correlation_id, params={"pageNumber": 1, "pageSize": 50}
42
48
  )
43
49
 
44
50
  return request_data
@@ -0,0 +1,68 @@
1
+ from typing import Optional
2
+
3
+ from ...types._api_version import ApiVersion
4
+ from ...types.api.data_vector_search import GetFileChunksResponse
5
+ from .._request_handler import RequestHandler
6
+ from .base_data_vector_search import BaseDataVectorSearch
7
+
8
+
9
+ class DataVectorSearch(BaseDataVectorSearch):
10
+ def __init__(self, request_handler: RequestHandler):
11
+ super().__init__(request_handler)
12
+
13
+ def get_file_chunks(
14
+ self, data_store_id: str, file_id: str, correlation_id: Optional[str] = None
15
+ ) -> GetFileChunksResponse:
16
+ """
17
+ Retrieve chunks from a specific file in a data store.
18
+
19
+ This method retrieves chunks from a file in the specified data store.
20
+
21
+ Args:
22
+ data_store_id: The unique identifier of the data store (GUID format)
23
+ file_id: The unique identifier of the file (GUID format)
24
+ correlation_id: Optional correlation ID for request tracing
25
+
26
+ Returns:
27
+ GetFileChunksResponse: Object containing the chunks and pagination information
28
+
29
+ Raises:
30
+ AiriaAPIError: If the API request fails, including cases where:
31
+ - The data_store_id doesn't exist (404)
32
+ - The file_id doesn't exist (404)
33
+ - Authentication fails (401)
34
+ - Access is forbidden (403)
35
+ - Server errors (5xx)
36
+ ValueError: If required parameters are missing or invalid
37
+
38
+ Example:
39
+ ```python
40
+ from airia import AiriaClient
41
+
42
+ client = AiriaClient(api_key="your_api_key")
43
+
44
+ # Get file chunks with default pagination
45
+ chunks_response = client.data_vector_search.get_file_chunks(
46
+ data_store_id="your_data_store_id",
47
+ file_id="your_file_id"
48
+ )
49
+
50
+ # Access the chunks
51
+ for chunk in chunks_response.chunks:
52
+ print(f"Chunk: {chunk.chunk}")
53
+ print(f"Document: {chunk.document_name}")
54
+ if chunk.score is not None:
55
+ print(f"Score: {chunk.score}")
56
+ ```
57
+ """
58
+ request_data = self._pre_get_file_chunks(
59
+ data_store_id=data_store_id,
60
+ file_id=file_id,
61
+ correlation_id=correlation_id,
62
+ api_version=ApiVersion.V1.value,
63
+ )
64
+
65
+ response = self._request_handler.make_request(
66
+ "GET", request_data, return_json=True
67
+ )
68
+ return GetFileChunksResponse(**response)
@@ -0,0 +1,125 @@
1
+ from typing import Optional
2
+
3
+ from ...types._api_version import ApiVersion
4
+ from ...types.api.pipelines_config import (
5
+ PipelineConfigResponse,
6
+ ExportPipelineDefinitionResponse,
7
+ )
8
+ from .._request_handler import AsyncRequestHandler
9
+ from .base_pipelines_config import BasePipelinesConfig
10
+
11
+
12
+ class AsyncPipelinesConfig(BasePipelinesConfig):
13
+ def __init__(self, request_handler: AsyncRequestHandler):
14
+ super().__init__(request_handler)
15
+
16
+ async def get_pipeline_config(
17
+ self, pipeline_id: str, correlation_id: Optional[str] = None
18
+ ) -> PipelineConfigResponse:
19
+ """
20
+ Retrieve configuration details for a specific pipeline.
21
+
22
+ This method fetches comprehensive information about a pipeline including its
23
+ deployment details, execution statistics, version information, and metadata.
24
+
25
+ Args:
26
+ pipeline_id (str): The unique identifier of the pipeline to retrieve
27
+ configuration for.
28
+ correlation_id (str, optional): A unique identifier for request tracing
29
+ and logging. If not provided, one will be automatically generated.
30
+
31
+ Returns:
32
+ PipelineConfigResponse: A response object containing the pipeline
33
+ configuration.
34
+
35
+ Raises:
36
+ AiriaAPIError: If the API request fails, including cases where:
37
+ - The pipeline_id doesn't exist (404)
38
+ - Authentication fails (401)
39
+ - Access is forbidden (403)
40
+ - Server errors (5xx)
41
+
42
+ Example:
43
+ ```python
44
+ from airia import AiriaAsyncClient
45
+
46
+ client = AiriaAsyncClient(api_key="your_api_key")
47
+
48
+ # Get pipeline configuration
49
+ config = await client.pipelines_config.get_pipeline_config(
50
+ pipeline_id="your_pipeline_id"
51
+ )
52
+
53
+ print(f"Pipeline: {config.agent.name}")
54
+ print(f"Description: {config.agent.agent_description}")
55
+ ```
56
+
57
+ Note:
58
+ This method only retrieves configuration information and does not
59
+ execute the pipeline. Use execute_pipeline() to run the pipeline.
60
+ """
61
+ request_data = self._pre_get_pipeline_config(
62
+ pipeline_id=pipeline_id,
63
+ correlation_id=correlation_id,
64
+ api_version=ApiVersion.V1.value,
65
+ )
66
+ resp = await self._request_handler.make_request("GET", request_data)
67
+
68
+ return PipelineConfigResponse(**resp)
69
+
70
+ async def export_pipeline_definition(
71
+ self, pipeline_id: str, correlation_id: Optional[str] = None
72
+ ) -> ExportPipelineDefinitionResponse:
73
+ """
74
+ Export the complete definition of a pipeline including all its components.
75
+
76
+ This method retrieves a comprehensive export of a pipeline definition including
77
+ metadata, agent configuration, data sources, prompts, tools, models, memories,
78
+ Python code blocks, routers, and deployment information.
79
+
80
+ Args:
81
+ pipeline_id (str): The unique identifier of the pipeline to export
82
+ definition for.
83
+ correlation_id (str, optional): A unique identifier for request tracing
84
+ and logging. If not provided, one will be automatically generated.
85
+
86
+ Returns:
87
+ ExportPipelineDefinitionResponse: A response object containing the complete
88
+ pipeline definition export.
89
+
90
+ Raises:
91
+ AiriaAPIError: If the API request fails, including cases where:
92
+ - The pipeline_id doesn't exist (404)
93
+ - Authentication fails (401)
94
+ - Access is forbidden (403)
95
+ - Server errors (5xx)
96
+
97
+ Example:
98
+ ```python
99
+ from airia import AiriaAsyncClient
100
+
101
+ client = AiriaAsyncClient(api_key="your_api_key")
102
+
103
+ # Export pipeline definition
104
+ export = await client.pipelines_config.export_pipeline_definition(
105
+ pipeline_id="your_pipeline_id"
106
+ )
107
+
108
+ print(f"Pipeline: {export.agent.name}")
109
+ print(f"Export version: {export.metadata.export_version}")
110
+ print(f"Data sources: {len(export.data_sources or [])}")
111
+ print(f"Tools: {len(export.tools or [])}")
112
+ ```
113
+
114
+ Note:
115
+ This method exports the complete pipeline definition which can be used
116
+ for backup, version control, or importing into other environments.
117
+ """
118
+ request_data = self._pre_export_pipeline_definition(
119
+ pipeline_id=pipeline_id,
120
+ correlation_id=correlation_id,
121
+ api_version=ApiVersion.V1.value,
122
+ )
123
+ resp = await self._request_handler.make_request("GET", request_data)
124
+
125
+ return ExportPipelineDefinitionResponse(**resp)
@@ -0,0 +1,78 @@
1
+ from typing import 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 BasePipelinesConfig:
9
+ def __init__(self, request_handler: Union[RequestHandler, AsyncRequestHandler]):
10
+ self._request_handler = request_handler
11
+
12
+ def _pre_get_pipeline_config(
13
+ self,
14
+ pipeline_id: str,
15
+ correlation_id: Optional[str] = None,
16
+ api_version: str = ApiVersion.V1.value,
17
+ ):
18
+ """
19
+ Prepare request data for getting pipeline configuration endpoint.
20
+
21
+ Args:
22
+ pipeline_id: ID of the pipeline 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(
37
+ self._request_handler.base_url,
38
+ f"{api_version}/PipelinesConfig/{pipeline_id}",
39
+ )
40
+ request_data = self._request_handler.prepare_request(
41
+ url, correlation_id=correlation_id
42
+ )
43
+
44
+ return request_data
45
+
46
+ def _pre_export_pipeline_definition(
47
+ self,
48
+ pipeline_id: str,
49
+ correlation_id: Optional[str] = None,
50
+ api_version: str = ApiVersion.V1.value,
51
+ ):
52
+ """
53
+ Prepare request data for exporting pipeline definition endpoint.
54
+
55
+ Args:
56
+ pipeline_id: ID of the pipeline to export definition for
57
+ correlation_id: Optional correlation ID for tracing
58
+ api_version: API version to use for the request
59
+
60
+ Returns:
61
+ RequestData: Prepared request data for the export pipeline definition endpoint
62
+
63
+ Raises:
64
+ ValueError: If an invalid API version is provided
65
+ """
66
+ if api_version not in ApiVersion.as_list():
67
+ raise ValueError(
68
+ f"Invalid API version: {api_version}. Valid versions are: {', '.join(ApiVersion.as_list())}"
69
+ )
70
+ url = urljoin(
71
+ self._request_handler.base_url,
72
+ f"{api_version}/PipelinesConfig/export/{pipeline_id}",
73
+ )
74
+ request_data = self._request_handler.prepare_request(
75
+ url, correlation_id=correlation_id
76
+ )
77
+
78
+ return request_data
@@ -0,0 +1,125 @@
1
+ from typing import Optional
2
+
3
+ from ...types._api_version import ApiVersion
4
+ from ...types.api.pipelines_config import (
5
+ PipelineConfigResponse,
6
+ ExportPipelineDefinitionResponse,
7
+ )
8
+ from .._request_handler import RequestHandler
9
+ from .base_pipelines_config import BasePipelinesConfig
10
+
11
+
12
+ class PipelinesConfig(BasePipelinesConfig):
13
+ def __init__(self, request_handler: RequestHandler):
14
+ super().__init__(request_handler)
15
+
16
+ def get_pipeline_config(
17
+ self, pipeline_id: str, correlation_id: Optional[str] = None
18
+ ) -> PipelineConfigResponse:
19
+ """
20
+ Retrieve configuration details for a specific pipeline.
21
+
22
+ This method fetches comprehensive information about a pipeline including its
23
+ deployment details, execution statistics, version information, and metadata.
24
+
25
+ Args:
26
+ pipeline_id (str): The unique identifier of the pipeline to retrieve
27
+ configuration for.
28
+ correlation_id (str, optional): A unique identifier for request tracing
29
+ and logging. If not provided, one will be automatically generated.
30
+
31
+ Returns:
32
+ PipelineConfigResponse: A response object containing the pipeline
33
+ configuration.
34
+
35
+ Raises:
36
+ AiriaAPIError: If the API request fails, including cases where:
37
+ - The pipeline_id doesn't exist (404)
38
+ - Authentication fails (401)
39
+ - Access is forbidden (403)
40
+ - Server errors (5xx)
41
+
42
+ Example:
43
+ ```python
44
+ from airia import AiriaClient
45
+
46
+ client = AiriaClient(api_key="your_api_key")
47
+
48
+ # Get pipeline configuration
49
+ config = client.pipelines_config.get_pipeline_config(
50
+ pipeline_id="your_pipeline_id"
51
+ )
52
+
53
+ print(f"Pipeline: {config.agent.name}")
54
+ print(f"Description: {config.agent.agent_description}")
55
+ ```
56
+
57
+ Note:
58
+ This method only retrieves configuration information and does not
59
+ execute the pipeline. Use execute_pipeline() to run the pipeline.
60
+ """
61
+ request_data = self._pre_get_pipeline_config(
62
+ pipeline_id=pipeline_id,
63
+ correlation_id=correlation_id,
64
+ api_version=ApiVersion.V1.value,
65
+ )
66
+ resp = self._request_handler.make_request("GET", request_data)
67
+
68
+ return PipelineConfigResponse(**resp)
69
+
70
+ def export_pipeline_definition(
71
+ self, pipeline_id: str, correlation_id: Optional[str] = None
72
+ ) -> ExportPipelineDefinitionResponse:
73
+ """
74
+ Export the complete definition of a pipeline including all its components.
75
+
76
+ This method retrieves a comprehensive export of a pipeline definition including
77
+ metadata, agent configuration, data sources, prompts, tools, models, memories,
78
+ Python code blocks, routers, and deployment information.
79
+
80
+ Args:
81
+ pipeline_id (str): The unique identifier of the pipeline to export
82
+ definition for.
83
+ correlation_id (str, optional): A unique identifier for request tracing
84
+ and logging. If not provided, one will be automatically generated.
85
+
86
+ Returns:
87
+ ExportPipelineDefinitionResponse: A response object containing the complete
88
+ pipeline definition export.
89
+
90
+ Raises:
91
+ AiriaAPIError: If the API request fails, including cases where:
92
+ - The pipeline_id doesn't exist (404)
93
+ - Authentication fails (401)
94
+ - Access is forbidden (403)
95
+ - Server errors (5xx)
96
+
97
+ Example:
98
+ ```python
99
+ from airia import AiriaClient
100
+
101
+ client = AiriaClient(api_key="your_api_key")
102
+
103
+ # Export pipeline definition
104
+ export = client.pipelines_config.export_pipeline_definition(
105
+ pipeline_id="your_pipeline_id"
106
+ )
107
+
108
+ print(f"Pipeline: {export.agent.name}")
109
+ print(f"Export version: {export.metadata.export_version}")
110
+ print(f"Data sources: {len(export.data_sources or [])}")
111
+ print(f"Tools: {len(export.tools or [])}")
112
+ ```
113
+
114
+ Note:
115
+ This method exports the complete pipeline definition which can be used
116
+ for backup, version control, or importing into other environments.
117
+ """
118
+ request_data = self._pre_export_pipeline_definition(
119
+ pipeline_id=pipeline_id,
120
+ correlation_id=correlation_id,
121
+ api_version=ApiVersion.V1.value,
122
+ )
123
+ resp = self._request_handler.make_request("GET", request_data)
124
+
125
+ return ExportPipelineDefinitionResponse(**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 .data_vector_search import DataVectorSearch
14
15
  from .deployments import Deployments
15
16
  from .pipeline_execution import PipelineExecution
16
17
  from .pipelines_config import PipelinesConfig
@@ -64,6 +65,7 @@ class AiriaClient(AiriaBaseClient):
64
65
  self.conversations = Conversations(self._request_handler)
65
66
  self.store = Store(self._request_handler)
66
67
  self.deployments = Deployments(self._request_handler)
68
+ self.data_vector_search = DataVectorSearch(self._request_handler)
67
69
 
68
70
  @classmethod
69
71
  def with_openai_gateway(
@@ -0,0 +1,3 @@
1
+ from .get_file_chunks import GetFileChunksResponse, FileChunk
2
+
3
+ __all__ = ["GetFileChunksResponse", "FileChunk"]
@@ -0,0 +1,45 @@
1
+ from typing import List, Optional
2
+
3
+ from pydantic import BaseModel, Field
4
+
5
+
6
+ class FileChunk(BaseModel):
7
+ """Represents a chunk of a file with score and metadata.
8
+
9
+ Attributes:
10
+ path: Path of the chunk
11
+ score: Optional relevance score for the chunk
12
+ chunk: The text content of the chunk
13
+ sequence_number: Optional sequence number of the chunk in the document
14
+ document_id: Unique identifier of the document (GUID format)
15
+ document_name: Name of the document
16
+ """
17
+
18
+ path: Optional[str] = None
19
+ score: Optional[float] = None
20
+ chunk: str
21
+ sequence_number: Optional[int] = Field(None, alias="sequenceNumber")
22
+ document_id: Optional[str] = Field(None, alias="documentId")
23
+ document_name: Optional[str] = Field(None, alias="documentName")
24
+
25
+
26
+ class GetFileChunksResponse(BaseModel):
27
+ """Response model for file chunks retrieval.
28
+
29
+ Attributes:
30
+ data_store_id: The data store identifier (GUID format)
31
+ file_id: The file identifier (GUID format)
32
+ chunks: List of chunks from the file
33
+ page_number: Current page number
34
+ page_size: Page size used for pagination
35
+ total_count: Total count of chunks
36
+ total_pages: Total number of pages
37
+ """
38
+
39
+ data_store_id: Optional[str] = Field(None, alias="dataStoreId")
40
+ file_id: Optional[str] = Field(None, alias="fileId")
41
+ chunks: List[FileChunk]
42
+ page_number: int = Field(alias="pageNumber")
43
+ page_size: int = Field(alias="pageSize")
44
+ total_count: int = Field(alias="totalCount")
45
+ total_pages: int = Field(alias="totalPages")