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.
@@ -61,11 +61,18 @@ class OpenAPIConnector:
61
61
  self.credentials = credentials
62
62
  self.service_kwargs = service_kwargs or {}
63
63
 
64
- self.client = OpenAPIClient.from_spec(
65
- openapi_spec=openapi_spec,
66
- credentials=credentials.resolve_value() if credentials else None,
67
- **self.service_kwargs,
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.4
1
+ Metadata-Version: 2.5
2
2
  Name: openapi-haystack
3
- Version: 0.1.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.10
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=pvokis7cYm4QNkwmE7jhG89nZzZg4eC1sKIjoC4CP8Q,3826
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.1.0.dist-info/METADATA,sha256=7xbX56KA5Mum-0CGOPOT_2xBPzMtxvOuipeMnC-bLik,1903
9
- openapi_haystack-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
10
- openapi_haystack-0.1.0.dist-info/licenses/LICENSE.txt,sha256=OrAtTu4aPmrTjKDSTzkSPgo_ji6NOMWO2N9JOTFyAzM,11350
11
- openapi_haystack-0.1.0.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.30.1
2
+ Generator: hatchling 1.32.4
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any