langflow-control-plane-sdk 0.0.0.dev0__py3-none-any.whl

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 (26) hide show
  1. langflow_control_plane_sdk/__init__.py +72 -0
  2. langflow_control_plane_sdk/api/__init__.py +5 -0
  3. langflow_control_plane_sdk/api/deployments_api.py +1846 -0
  4. langflow_control_plane_sdk/api_client.py +822 -0
  5. langflow_control_plane_sdk/api_response.py +21 -0
  6. langflow_control_plane_sdk/configuration.py +625 -0
  7. langflow_control_plane_sdk/exceptions.py +218 -0
  8. langflow_control_plane_sdk/models/__init__.py +28 -0
  9. langflow_control_plane_sdk/models/create_deployment.py +108 -0
  10. langflow_control_plane_sdk/models/deployment_detail.py +105 -0
  11. langflow_control_plane_sdk/models/deployment_list.py +103 -0
  12. langflow_control_plane_sdk/models/deployment_list_item.py +103 -0
  13. langflow_control_plane_sdk/models/error_body.py +96 -0
  14. langflow_control_plane_sdk/models/error_code.py +57 -0
  15. langflow_control_plane_sdk/models/error_envelope.py +92 -0
  16. langflow_control_plane_sdk/models/flow_input.py +104 -0
  17. langflow_control_plane_sdk/models/flow_payload.py +105 -0
  18. langflow_control_plane_sdk/models/flow_payload_data.py +103 -0
  19. langflow_control_plane_sdk/models/patch_deployment.py +89 -0
  20. langflow_control_plane_sdk/models/replace_deployment.py +99 -0
  21. langflow_control_plane_sdk/py.typed +0 -0
  22. langflow_control_plane_sdk/rest.py +201 -0
  23. langflow_control_plane_sdk-0.0.0.dev0.dist-info/METADATA +142 -0
  24. langflow_control_plane_sdk-0.0.0.dev0.dist-info/RECORD +26 -0
  25. langflow_control_plane_sdk-0.0.0.dev0.dist-info/WHEEL +4 -0
  26. langflow_control_plane_sdk-0.0.0.dev0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Langflow Control Plane API
5
+
6
+ Manage Langflow Runtime Deployments.
7
+
8
+ The version of the OpenAPI document: 0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from langflow_control_plane_sdk.models.flow_input import FlowInput
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class ReplaceDeployment(BaseModel):
29
+ """
30
+ ReplaceDeployment
31
+ """ # noqa: E501
32
+ description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None
33
+ flows: List[FlowInput]
34
+ __properties: ClassVar[List[str]] = ["description", "flows"]
35
+
36
+ model_config = ConfigDict(
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ReplaceDeployment from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of each item in flows (list)
76
+ _items = []
77
+ if self.flows:
78
+ for _item_flows in self.flows:
79
+ if _item_flows:
80
+ _items.append(_item_flows.to_dict())
81
+ _dict['flows'] = _items
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of ReplaceDeployment from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "description": obj.get("description"),
95
+ "flows": [FlowInput.from_dict(_item) for _item in obj["flows"]] if obj.get("flows") is not None else None
96
+ })
97
+ return _obj
98
+
99
+
File without changes
@@ -0,0 +1,201 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Langflow Control Plane API
5
+
6
+ Manage Langflow Runtime Deployments.
7
+
8
+ The version of the OpenAPI document: 0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import io
16
+ import json
17
+ import re
18
+ import ssl
19
+ from typing import Optional, Union
20
+
21
+ import httpx
22
+
23
+ from langflow_control_plane_sdk.exceptions import ApiException, ApiValueError
24
+
25
+ RESTResponseType = httpx.Response
26
+
27
+ class RESTResponse(io.IOBase):
28
+
29
+ def __init__(self, resp) -> None:
30
+ self.response = resp
31
+ self.status = resp.status_code
32
+ self.reason = resp.reason_phrase
33
+ self.data = None
34
+
35
+ async def read(self):
36
+ if self.data is None:
37
+ self.data = await self.response.aread()
38
+ return self.data
39
+
40
+ @property
41
+ def headers(self):
42
+ """Returns a CIMultiDictProxy of response headers."""
43
+ return self.response.headers
44
+
45
+ def getheaders(self):
46
+ """Returns a CIMultiDictProxy of the response headers; use ``headers`` instead."""
47
+ return self.response.headers
48
+
49
+ def getheader(self, name, default=None):
50
+ """Returns a given response header; use ``headers`` instead."""
51
+ return self.response.headers.get(name, default)
52
+
53
+
54
+ class RESTClientObject:
55
+
56
+ def __init__(self, configuration) -> None:
57
+
58
+ # maxsize is number of requests to host that are allowed in parallel
59
+ self.maxsize = configuration.connection_pool_maxsize
60
+
61
+ self.ssl_context = ssl.create_default_context(
62
+ cafile=configuration.ssl_ca_cert,
63
+ cadata=configuration.ca_cert_data,
64
+ )
65
+ if configuration.cert_file:
66
+ self.ssl_context.load_cert_chain(
67
+ configuration.cert_file, keyfile=configuration.key_file
68
+ )
69
+
70
+ if not configuration.verify_ssl:
71
+ self.ssl_context.check_hostname = False
72
+ self.ssl_context.verify_mode = ssl.CERT_NONE
73
+
74
+ self.proxy = configuration.proxy
75
+ self.proxy_headers = configuration.proxy_headers
76
+
77
+ self.pool_manager: Optional[httpx.AsyncClient] = None
78
+
79
+ async def close(self):
80
+ if self.pool_manager is not None:
81
+ await self.pool_manager.aclose()
82
+
83
+ async def request(
84
+ self,
85
+ method,
86
+ url,
87
+ headers=None,
88
+ body=None,
89
+ post_params=None,
90
+ _request_timeout=None):
91
+ """Execute request
92
+
93
+ :param method: http request method
94
+ :param url: http request url
95
+ :param headers: http request headers
96
+ :param body: request json body, for `application/json`
97
+ :param post_params: request post parameters,
98
+ `application/x-www-form-urlencoded`
99
+ and `multipart/form-data`
100
+ :param _request_timeout: timeout setting for this request. If one
101
+ number provided, it will be total request
102
+ timeout. It can also be a pair (tuple) of
103
+ (connection, read) timeouts.
104
+ """
105
+ method = method.upper()
106
+ assert method in [
107
+ 'GET',
108
+ 'HEAD',
109
+ 'DELETE',
110
+ 'POST',
111
+ 'PUT',
112
+ 'PATCH',
113
+ 'OPTIONS'
114
+ ]
115
+
116
+ if post_params and body:
117
+ raise ApiValueError(
118
+ "body parameter cannot be used with post_params parameter."
119
+ )
120
+
121
+ post_params = post_params or {}
122
+ headers = headers or {}
123
+ timeout = _request_timeout or 5 * 60
124
+
125
+ if 'Content-Type' not in headers:
126
+ headers['Content-Type'] = 'application/json'
127
+
128
+ args = {
129
+ "method": method,
130
+ "url": url,
131
+ "timeout": timeout,
132
+ "headers": headers
133
+ }
134
+
135
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
136
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
137
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
138
+ if body is not None:
139
+ args["json"] = body
140
+ if body is None and post_params:
141
+ args["json"] = dict(post_params)
142
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
143
+ args["data"] = dict(post_params)
144
+ elif headers['Content-Type'] == 'multipart/form-data':
145
+ # must del headers['Content-Type'], or the correct
146
+ # Content-Type which generated by httpx
147
+ del headers['Content-Type']
148
+
149
+ files = []
150
+ data = {}
151
+ for param in post_params:
152
+ k, v = param
153
+ if isinstance(v, tuple) and len(v) == 3:
154
+ files.append((k, v))
155
+ else:
156
+ # Ensures that dict objects are serialized
157
+ if isinstance(v, dict):
158
+ v = json.dumps(v)
159
+ elif isinstance(v, int):
160
+ v = str(v)
161
+ data[k] = v
162
+
163
+ if files:
164
+ args["files"] = files
165
+ if data:
166
+ args["data"] = data
167
+
168
+ # Pass a `bytes` parameter directly in the body to support
169
+ # other content types than Json when `body` argument is provided
170
+ # in serialized form
171
+ elif isinstance(body, str) or isinstance(body, bytes):
172
+ args["data"] = body
173
+ else:
174
+ # Cannot generate the request from given parameters
175
+ msg = """Cannot prepare a request message for provided
176
+ arguments. Please check that your arguments match
177
+ declared content type."""
178
+ raise ApiException(status=0, reason=msg)
179
+
180
+ if self.pool_manager is None:
181
+ self.pool_manager = self._create_pool_manager()
182
+
183
+ r = await self.pool_manager.request(**args)
184
+ return RESTResponse(r)
185
+
186
+ def _create_pool_manager(self) -> httpx.AsyncClient:
187
+ limits = httpx.Limits(max_connections=self.maxsize)
188
+
189
+ proxy = None
190
+ if self.proxy:
191
+ proxy = httpx.Proxy(
192
+ url=self.proxy,
193
+ headers=self.proxy_headers
194
+ )
195
+
196
+ return httpx.AsyncClient(
197
+ limits=limits,
198
+ proxy=proxy,
199
+ verify=self.ssl_context,
200
+ trust_env=True
201
+ )
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.5
2
+ Name: langflow-control-plane-sdk
3
+ Version: 0.0.0.dev0
4
+ Summary: Generated async Python client for the Langflow Control Plane API
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: pydantic>=2.11
10
+ Requires-Dist: python-dateutil>=2.8.2
11
+ Requires-Dist: typing-extensions>=4.7.1
12
+ Provides-Extra: test
13
+ Requires-Dist: build>=1.2.2; extra == 'test'
14
+ Requires-Dist: pytest-asyncio>=1.1.0; extra == 'test'
15
+ Requires-Dist: pytest>=8.4.2; extra == 'test'
16
+ Requires-Dist: pyyaml>=6.0.2; extra == 'test'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Langflow Control Plane Python SDK
20
+
21
+ `langflow-control-plane-sdk` is the generated async Python 3.10+ client for the
22
+ [Langflow Control Plane OpenAPI contract](../../api/openapi.yaml). The import
23
+ package is `langflow_control_plane_sdk`, which is intentionally distinct from
24
+ the `langflow-sdk` package for Langflow's main REST API.
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ pip install langflow-control-plane-sdk
30
+ ```
31
+
32
+ Normal installs select stable releases. Use
33
+ `pip install --pre langflow-control-plane-sdk` to include development and
34
+ release-candidate builds, or install an exact version such as
35
+ `langflow-control-plane-sdk==0.1.0rc1`.
36
+
37
+ ## Configure
38
+
39
+ Set the Control Plane base URL and its temporary pass-through `x-api-key`
40
+ credential on the generated configuration:
41
+
42
+ ```python
43
+ import langflow_control_plane_sdk as control_plane
44
+
45
+ configuration = control_plane.Configuration(
46
+ host="https://control-plane.example",
47
+ api_key={"LangflowAPIKey": "replace-me"},
48
+ )
49
+ ```
50
+
51
+ The key is sent as `x-api-key`; do not log it. This pass-through authentication
52
+ scheme is temporary. A future authentication change can affect SDK users and is
53
+ therefore treated as semver-significant.
54
+
55
+ ## Async CRUD
56
+
57
+ ```python
58
+ from uuid import uuid4
59
+
60
+ import langflow_control_plane_sdk as control_plane
61
+
62
+ flow_id = uuid4()
63
+ flow = control_plane.FlowInput(
64
+ flow_id=flow_id,
65
+ author_flow_id=flow_id,
66
+ author_flow_version_id=uuid4(),
67
+ name="hello-world",
68
+ payload=control_plane.FlowPayload(
69
+ data=control_plane.FlowPayloadData(nodes=[], edges=[]),
70
+ ),
71
+ )
72
+
73
+ async with control_plane.ApiClient(configuration) as client:
74
+ deployments = control_plane.DeploymentsApi(client)
75
+ created = await deployments.create_deployment(
76
+ control_plane.CreateDeployment(slug="hello-world", flows=[flow]),
77
+ )
78
+ fetched = await deployments.get_deployment(created.id)
79
+ updated = await deployments.replace_deployment(
80
+ created.id,
81
+ control_plane.ReplaceDeployment(description="updated", flows=[flow]),
82
+ )
83
+ patched = await deployments.patch_deployment(
84
+ created.id,
85
+ control_plane.PatchDeployment(description="patched"),
86
+ )
87
+ await deployments.delete_deployment(created.id)
88
+ ```
89
+
90
+ List responses always contain `next_cursor`; it is `None` on the last page.
91
+ Pass a non-null cursor back unchanged:
92
+
93
+ ```python
94
+ async with control_plane.ApiClient(configuration) as client:
95
+ deployments = control_plane.DeploymentsApi(client)
96
+ page = await deployments.list_deployments(limit=50)
97
+ while page.next_cursor is not None:
98
+ page = await deployments.list_deployments(
99
+ cursor=page.next_cursor,
100
+ limit=50,
101
+ )
102
+ ```
103
+
104
+ Unsuccessful responses raise `ApiException`. For documented responses,
105
+ `exception.data` is a typed `ErrorEnvelope`:
106
+
107
+ ```python
108
+ try:
109
+ await deployments.get_deployment(deployment_id)
110
+ except control_plane.ApiException as exception:
111
+ if isinstance(exception.data, control_plane.ErrorEnvelope):
112
+ print(exception.data.error.code, exception.data.error.message)
113
+ raise
114
+ ```
115
+
116
+ ## Regenerate and test
117
+
118
+ Generation requires Python 3.10+, Java 11+, and the pinned generator. If Java
119
+ is unavailable, `jdk4py` can optionally provide a local JVM.
120
+
121
+ ```bash
122
+ make openapi-install
123
+ make sdk-py-install
124
+ make openapi-test
125
+ make sdk-py-generate
126
+ make sdk-py-test
127
+ make sdk-py-build
128
+ ```
129
+
130
+ When using `jdk4py`, install it in the codegen environment with
131
+ `sdk/openapi-generator/.venv/bin/python -m pip install jdk4py`.
132
+
133
+ Generated package files must not be edited by hand. Change `api/openapi.yaml`,
134
+ the generator options in the root `Makefile`, or the templates, then
135
+ regenerate them.
136
+
137
+ The checked-in SDK uses the base version `0.0.0`. Release builds apply the exact
138
+ `v`-prefixed Git tag version to a temporary build copy; the OpenAPI
139
+ `info.version` independently identifies the API contract line.
140
+
141
+ See the repository's [release guide](../../RELEASE.md) for shared service and
142
+ SDK versioning and tag formats.
@@ -0,0 +1,26 @@
1
+ langflow_control_plane_sdk/__init__.py,sha256=w8XBMoY2_V6biYKsZTsJj5I5evmXLG3k10hSPlyzlP0,2845
2
+ langflow_control_plane_sdk/api_client.py,sha256=FFEak74MSCFyGI-V760fptbdOHUnt55rZnpsrsBr6xU,28917
3
+ langflow_control_plane_sdk/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
+ langflow_control_plane_sdk/configuration.py,sha256=u7FIOs7jg1QPrHGl6hG5xmBSR2Q8HjwK15trsibEL6E,20321
5
+ langflow_control_plane_sdk/exceptions.py,sha256=SrdsCkdWyLZKEbGLRp9ybgsJGq803J2EYC6Y0RqrUTQ,6469
6
+ langflow_control_plane_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ langflow_control_plane_sdk/rest.py,sha256=cw8VYrkfzq7fiZn28lxxt3DWEi7LXRjLfh_Zy5ZiSfc,6547
8
+ langflow_control_plane_sdk/api/__init__.py,sha256=MzMhMOjURPZZjtPRM_MRk0Curcm5PBbxi-rvQTNiweE,122
9
+ langflow_control_plane_sdk/api/deployments_api.py,sha256=9zKL7uYcLkg6O67HP-jbvMckgJ4F3ytu3fVO7f3AAnk,70494
10
+ langflow_control_plane_sdk/models/__init__.py,sha256=_vyxp8E1WN6Sp_5alSZOUd1_hnsFEz3YOu5TjqWAFGM,1229
11
+ langflow_control_plane_sdk/models/create_deployment.py,sha256=i4wtp79czbVonRIfEY7lkTxdLBB5bA-ixQx1PMXHo18,3617
12
+ langflow_control_plane_sdk/models/deployment_detail.py,sha256=6QmpU7iU3AZ8iYHlBQLSawXxOOE41YrmZtlZ-Hmmv9Q,3408
13
+ langflow_control_plane_sdk/models/deployment_list.py,sha256=3nBvCblDNMNWoAK5Ar9Bdm3UAamRyL4zlvxrOO8KNoQ,3378
14
+ langflow_control_plane_sdk/models/deployment_list_item.py,sha256=fpkjBFnnamgXbhDVuZAR8fGfv059kS4jSEcDG3vcAmM,3306
15
+ langflow_control_plane_sdk/models/error_body.py,sha256=K0BAV61il3RtUQeNlNTfgv6Ru51jh-cBzZRSPneOoWA,2844
16
+ langflow_control_plane_sdk/models/error_code.py,sha256=ioxG9JrArgG0IVhXUsyk4eo7CTY7xr07wTluSMWkYdk,1693
17
+ langflow_control_plane_sdk/models/error_envelope.py,sha256=uxyBsf7zVfx0kpEv68QRFO_rDquXjE69SYpkSme3X-A,2689
18
+ langflow_control_plane_sdk/models/flow_input.py,sha256=2LgtjFrdjmDZMpMk5wAQJhuVF4tqU2YWHV3m7oUWU8M,3563
19
+ langflow_control_plane_sdk/models/flow_payload.py,sha256=uFup06TVWs9Ydzhsf8XtMFycqm0gZUiULdPi7Vt9n_E,3402
20
+ langflow_control_plane_sdk/models/flow_payload_data.py,sha256=dVTbNm0vXXvGVkY7u-GOzBtJk0shg_kg0-3u6f0uIcU,3106
21
+ langflow_control_plane_sdk/models/patch_deployment.py,sha256=hzJQ9sVH1DDdNcwI7ryMVRtJlbdPVQ_qPTB52FxwSlU,2527
22
+ langflow_control_plane_sdk/models/replace_deployment.py,sha256=M0ftSbQ_JWYliWfWcE947kw30vB7ZE8CHJY9Jjhop6k,3105
23
+ langflow_control_plane_sdk-0.0.0.dev0.dist-info/METADATA,sha256=TAEzk3Ix9xhwHrsWd4673S85CrSHJ1I0HVbABLS4AIw,4546
24
+ langflow_control_plane_sdk-0.0.0.dev0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
25
+ langflow_control_plane_sdk-0.0.0.dev0.dist-info/licenses/LICENSE,sha256=IyYhLpelP4l5uU9xaaGbKT6ipyNZI1okV4Yycrusv7A,1065
26
+ langflow_control_plane_sdk-0.0.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Langflow
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.