aimlapi-haystack 1.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aimlapi-haystack
3
- Version: 1.0.0
3
+ Version: 2.0.0
4
4
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/aimlapi#readme
5
5
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
6
6
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/aimlapi
@@ -10,15 +10,14 @@ License-File: LICENSE.txt
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
18
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
- Requires-Python: >=3.9
21
- Requires-Dist: haystack-ai>=2.19.0
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: haystack-ai>=2.22.0
22
21
  Description-Content-Type: text/markdown
23
22
 
24
23
  # aimlapi-haystack
@@ -1,8 +1,8 @@
1
1
  haystack_integrations/components/generators/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  haystack_integrations/components/generators/aimlapi/__init__.py,sha256=QVmh_YP8EKx4gjxrqQ54dzZEZewtjtd1MgsjjJolxpI,90
3
3
  haystack_integrations/components/generators/aimlapi/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- haystack_integrations/components/generators/aimlapi/chat/chat_generator.py,sha256=fnTmV_tOi6bfsupfCz5XU9lRWQQBl9viZttkn6_iRc8,9992
5
- aimlapi_haystack-1.0.0.dist-info/METADATA,sha256=6kU1ZCMPurQiYK0h32dZy1yh8ENYqojxq3BluhJBEqs,1847
6
- aimlapi_haystack-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- aimlapi_haystack-1.0.0.dist-info/licenses/LICENSE.txt,sha256=dBoNaaXH0arIHtfis5LQowOenGorOi0fqfeWub_w3kI,10262
8
- aimlapi_haystack-1.0.0.dist-info/RECORD,,
4
+ haystack_integrations/components/generators/aimlapi/chat/chat_generator.py,sha256=RW1nRKGNG2Of3h-vNqCHoAOb2ZGmbVO9MhcalKyuSpk,9934
5
+ aimlapi_haystack-2.0.0.dist-info/METADATA,sha256=OyZQD4a1jtQCpzmUoqBjFW_FbUUyVefSnyqnhy7GBzc,1798
6
+ aimlapi_haystack-2.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
7
+ aimlapi_haystack-2.0.0.dist-info/licenses/LICENSE.txt,sha256=dBoNaaXH0arIHtfis5LQowOenGorOi0fqfeWub_w3kI,10262
8
+ aimlapi_haystack-2.0.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
- from typing import Any, Dict, List, Optional
5
+ from typing import Any
6
6
 
7
7
  from haystack import component, default_to_dict, logging
8
8
  from haystack.components.generators.chat import OpenAIChatGenerator
@@ -63,14 +63,14 @@ class AIMLAPIChatGenerator(OpenAIChatGenerator):
63
63
  *,
64
64
  api_key: Secret = Secret.from_env_var("AIMLAPI_API_KEY"),
65
65
  model: str = "openai/gpt-5-chat-latest",
66
- streaming_callback: Optional[StreamingCallbackT] = None,
67
- api_base_url: Optional[str] = "https://api.aimlapi.com/v1",
68
- generation_kwargs: Optional[Dict[str, Any]] = None,
69
- tools: Optional[ToolsType] = None,
70
- timeout: Optional[float] = None,
71
- extra_headers: Optional[Dict[str, Any]] = None,
72
- max_retries: Optional[int] = None,
73
- http_client_kwargs: Optional[Dict[str, Any]] = None,
66
+ streaming_callback: StreamingCallbackT | None = None,
67
+ api_base_url: str | None = "https://api.aimlapi.com/v1",
68
+ generation_kwargs: dict[str, Any] | None = None,
69
+ tools: ToolsType | None = None,
70
+ timeout: float | None = None,
71
+ extra_headers: dict[str, Any] | None = None,
72
+ max_retries: int | None = None,
73
+ http_client_kwargs: dict[str, Any] | None = None,
74
74
  ):
75
75
  """
76
76
  Creates an instance of AIMLAPIChatGenerator. Unless specified otherwise,
@@ -128,7 +128,7 @@ class AIMLAPIChatGenerator(OpenAIChatGenerator):
128
128
  )
129
129
  self.extra_headers = extra_headers
130
130
 
131
- def to_dict(self) -> Dict[str, Any]:
131
+ def to_dict(self) -> dict[str, Any]:
132
132
  """
133
133
  Serialize this component to a dictionary.
134
134
 
@@ -154,18 +154,18 @@ class AIMLAPIChatGenerator(OpenAIChatGenerator):
154
154
  def _prepare_api_call(
155
155
  self,
156
156
  *,
157
- messages: List[ChatMessage],
158
- streaming_callback: Optional[StreamingCallbackT] = None,
159
- generation_kwargs: Optional[Dict[str, Any]] = None,
160
- tools: Optional[ToolsType] = None,
161
- tools_strict: Optional[bool] = None,
162
- ) -> Dict[str, Any]:
157
+ messages: list[ChatMessage],
158
+ streaming_callback: StreamingCallbackT | None = None,
159
+ generation_kwargs: dict[str, Any] | None = None,
160
+ tools: ToolsType | None = None,
161
+ tools_strict: bool | None = None,
162
+ ) -> dict[str, Any]:
163
163
  # update generation kwargs by merging with the generation kwargs passed to the run method
164
164
  generation_kwargs = {**self.generation_kwargs, **(generation_kwargs or {})}
165
165
  extra_headers = {**AIMLAPI_HEADERS, **(self.extra_headers or {})}
166
166
 
167
167
  # adapt ChatMessage(s) to the format expected by the OpenAI API (AIMLAPI uses the same format)
168
- aimlapi_formatted_messages: List[Dict[str, Any]] = [message.to_openai_dict_format() for message in messages]
168
+ aimlapi_formatted_messages: list[dict[str, Any]] = [message.to_openai_dict_format() for message in messages]
169
169
 
170
170
  tools_strict = tools_strict if tools_strict is not None else self.tools_strict
171
171
  flattened_tools = flatten_tools_or_toolsets(tools or self.tools)