openapi-haystack 0.1.0__py3-none-any.whl → 2.0.0__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.
- haystack_integrations/components/connectors/openapi/openapi.py +15 -5
- {openapi_haystack-0.1.0.dist-info → openapi_haystack-2.0.0.dist-info}/METADATA +6 -4
- {openapi_haystack-0.1.0.dist-info → openapi_haystack-2.0.0.dist-info}/RECORD +5 -5
- {openapi_haystack-0.1.0.dist-info → openapi_haystack-2.0.0.dist-info}/WHEEL +1 -1
- {openapi_haystack-0.1.0.dist-info → openapi_haystack-2.0.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -61,11 +61,18 @@ class OpenAPIConnector:
|
|
|
61
61
|
self.credentials = credentials
|
|
62
62
|
self.service_kwargs = service_kwargs or {}
|
|
63
63
|
|
|
64
|
-
self.client =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
self.client: OpenAPIClient | None = None
|
|
65
|
+
|
|
66
|
+
def warm_up(self) -> None:
|
|
67
|
+
"""
|
|
68
|
+
Initialize the OpenAPI client.
|
|
69
|
+
"""
|
|
70
|
+
if self.client is None:
|
|
71
|
+
self.client = OpenAPIClient.from_spec(
|
|
72
|
+
openapi_spec=self.openapi_spec,
|
|
73
|
+
credentials=self.credentials.resolve_value() if self.credentials else None,
|
|
74
|
+
**self.service_kwargs,
|
|
75
|
+
)
|
|
69
76
|
|
|
70
77
|
def to_dict(self) -> dict[str, Any]:
|
|
71
78
|
"""
|
|
@@ -91,6 +98,9 @@ class OpenAPIConnector:
|
|
|
91
98
|
:param arguments: Optional parameters for the endpoint (query, path, or body parameters)
|
|
92
99
|
:return: Dictionary containing the service response
|
|
93
100
|
"""
|
|
101
|
+
self.warm_up()
|
|
102
|
+
assert self.client is not None # noqa: S101
|
|
103
|
+
|
|
94
104
|
payload = {"name": operation_id, "arguments": arguments or {}}
|
|
95
105
|
|
|
96
106
|
# Invoke the endpoint using openapi-llm client
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: openapi-haystack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Haystack integration for openapi
|
|
5
5
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/openapi#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
|
|
@@ -12,14 +12,14 @@ Keywords: api,connector,function-calling,haystack,openapi,rest
|
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
14
|
Classifier: Programming Language :: Python
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
21
21
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
22
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
23
|
Requires-Dist: haystack-ai>=2.23.0
|
|
24
24
|
Requires-Dist: openapi-llm>=0.4.1
|
|
25
25
|
Requires-Dist: openapi3>=1.8.2
|
|
@@ -38,3 +38,5 @@ Description-Content-Type: text/markdown
|
|
|
38
38
|
## Contributing
|
|
39
39
|
|
|
40
40
|
Refer to the general [Contribution Guidelines](https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md).
|
|
41
|
+
|
|
42
|
+
To run integration tests locally, you need to export the `OPENAI_API_KEY` environment variable.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
haystack_integrations/components/connectors/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
haystack_integrations/components/connectors/openapi/__init__.py,sha256=n2wOErOeajviZ404v1SjBSSD6hsUW0chCLLYjuVwTKA,260
|
|
3
|
-
haystack_integrations/components/connectors/openapi/openapi.py,sha256=
|
|
3
|
+
haystack_integrations/components/connectors/openapi/openapi.py,sha256=hUKoIumyZoQ8w8KHw2RZg4mg5SwrpMqTk7IuP9qJW08,4114
|
|
4
4
|
haystack_integrations/components/connectors/openapi/openapi_service.py,sha256=_QChS7DmOy2ErVyM4Ln7MfuCpu8TAMJhY1ti2x5dKhY,18598
|
|
5
5
|
haystack_integrations/components/converters/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
haystack_integrations/components/converters/openapi/__init__.py,sha256=S90Ozy9211q-WBermg31Qd33o6_VF7CQawbZO-iL7bE,208
|
|
7
7
|
haystack_integrations/components/converters/openapi/openapi_functions.py,sha256=B-qT6BHDmbQ5UC8Kzhnehm4yLQnLp9u3mkag77WE8Co,11541
|
|
8
|
-
openapi_haystack-0.
|
|
9
|
-
openapi_haystack-0.
|
|
10
|
-
openapi_haystack-0.
|
|
11
|
-
openapi_haystack-0.
|
|
8
|
+
openapi_haystack-2.0.0.dist-info/METADATA,sha256=xM04Z3ILj4S43-_pJ_kORZorJ0DNekox6S6Y_EGPtIE,2000
|
|
9
|
+
openapi_haystack-2.0.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
10
|
+
openapi_haystack-2.0.0.dist-info/licenses/LICENSE.txt,sha256=OrAtTu4aPmrTjKDSTzkSPgo_ji6NOMWO2N9JOTFyAzM,11350
|
|
11
|
+
openapi_haystack-2.0.0.dist-info/RECORD,,
|
|
File without changes
|