aimlapi-haystack 1.0.0__tar.gz → 2.0.0__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.
- aimlapi_haystack-2.0.0/CHANGELOG.md +7 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/PKG-INFO +3 -4
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/pyproject.toml +4 -10
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/src/haystack_integrations/components/generators/aimlapi/chat/chat_generator.py +17 -17
- aimlapi_haystack-1.0.0/CHANGELOG.md +0 -3
- aimlapi_haystack-1.0.0/pydoc/config.yml +0 -29
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/.gitignore +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/LICENSE.txt +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/README.md +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/examples/aimlapi_basic_example.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/examples/aimlapi_with_tools_example.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/pydoc/config_docusaurus.yml +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/src/haystack_integrations/components/generators/aimlapi/__init__.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/src/haystack_integrations/components/generators/aimlapi/chat/__init__.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/src/haystack_integrations/components/generators/py.typed +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/tests/__init__.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/tests/test_aimlapi_chat_generator.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/tests/test_aimlapi_chat_generator_async.py +0 -0
- {aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/tests/test_aimlapi_stub_async.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aimlapi-haystack
|
|
3
|
-
Version:
|
|
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.
|
|
21
|
-
Requires-Dist: haystack-ai>=2.
|
|
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
|
|
@@ -7,7 +7,7 @@ name = "aimlapi-haystack"
|
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = ''
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
11
|
license = "Apache-2.0"
|
|
12
12
|
keywords = []
|
|
13
13
|
authors = [{ name = "Dmitry <D1m7asis> Tumanov", email = "d1m7asis@gmail.com" }]
|
|
@@ -15,7 +15,6 @@ classifiers = [
|
|
|
15
15
|
"License :: OSI Approved :: Apache Software License",
|
|
16
16
|
"Development Status :: 4 - Beta",
|
|
17
17
|
"Programming Language :: Python",
|
|
18
|
-
"Programming Language :: Python :: 3.9",
|
|
19
18
|
"Programming Language :: Python :: 3.10",
|
|
20
19
|
"Programming Language :: Python :: 3.11",
|
|
21
20
|
"Programming Language :: Python :: 3.12",
|
|
@@ -23,7 +22,7 @@ classifiers = [
|
|
|
23
22
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
24
23
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
25
24
|
]
|
|
26
|
-
dependencies = ["haystack-ai>=2.
|
|
25
|
+
dependencies = ["haystack-ai>=2.22.0"]
|
|
27
26
|
|
|
28
27
|
[project.urls]
|
|
29
28
|
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/aimlapi#readme"
|
|
@@ -45,8 +44,8 @@ git_describe_command = 'git describe --tags --match="integrations/aimlapi-v[0-9]
|
|
|
45
44
|
installer = "uv"
|
|
46
45
|
dependencies = ["haystack-pydoc-tools", "ruff"]
|
|
47
46
|
[tool.hatch.envs.default.scripts]
|
|
48
|
-
docs = ["pydoc-markdown pydoc/
|
|
49
|
-
fmt = "ruff check --fix {args}
|
|
47
|
+
docs = ["pydoc-markdown pydoc/config_docusaurus.yml"]
|
|
48
|
+
fmt = "ruff check --fix {args}; ruff format {args}"
|
|
50
49
|
fmt-check = "ruff check {args} && ruff format --check {args}"
|
|
51
50
|
|
|
52
51
|
[tool.hatch.envs.test]
|
|
@@ -76,7 +75,6 @@ disallow_incomplete_defs = true
|
|
|
76
75
|
|
|
77
76
|
|
|
78
77
|
[tool.ruff]
|
|
79
|
-
target-version = "py38"
|
|
80
78
|
line-length = 120
|
|
81
79
|
|
|
82
80
|
[tool.ruff.lint]
|
|
@@ -123,10 +121,6 @@ ignore = [
|
|
|
123
121
|
"B008",
|
|
124
122
|
"S101",
|
|
125
123
|
]
|
|
126
|
-
unfixable = [
|
|
127
|
-
# Don't touch unused imports
|
|
128
|
-
"F401",
|
|
129
|
-
]
|
|
130
124
|
|
|
131
125
|
[tool.ruff.lint.isort]
|
|
132
126
|
known-first-party = ["haystack_integrations"]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
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:
|
|
67
|
-
api_base_url:
|
|
68
|
-
generation_kwargs:
|
|
69
|
-
tools:
|
|
70
|
-
timeout:
|
|
71
|
-
extra_headers:
|
|
72
|
-
max_retries:
|
|
73
|
-
http_client_kwargs:
|
|
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) ->
|
|
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:
|
|
158
|
-
streaming_callback:
|
|
159
|
-
generation_kwargs:
|
|
160
|
-
tools:
|
|
161
|
-
tools_strict:
|
|
162
|
-
) ->
|
|
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:
|
|
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)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
loaders:
|
|
2
|
-
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
|
|
3
|
-
search_path: [../src]
|
|
4
|
-
modules: [
|
|
5
|
-
"haystack_integrations.components.generators.aimlapi.chat.chat_generator",
|
|
6
|
-
]
|
|
7
|
-
ignore_when_discovered: ["__init__"]
|
|
8
|
-
processors:
|
|
9
|
-
- type: filter
|
|
10
|
-
expression:
|
|
11
|
-
documented_only: true
|
|
12
|
-
do_not_filter_modules: false
|
|
13
|
-
skip_empty_modules: true
|
|
14
|
-
- type: smart
|
|
15
|
-
- type: crossref
|
|
16
|
-
renderer:
|
|
17
|
-
type: haystack_pydoc_tools.renderers.ReadmeIntegrationRenderer
|
|
18
|
-
excerpt: AIMLAPI integration for Haystack
|
|
19
|
-
category_slug: integrations-api
|
|
20
|
-
title: AIMLAPI
|
|
21
|
-
slug: integrations-aimlapi
|
|
22
|
-
order: 200
|
|
23
|
-
markdown:
|
|
24
|
-
descriptive_class_title: false
|
|
25
|
-
classdef_code_block: false
|
|
26
|
-
descriptive_module_title: true
|
|
27
|
-
add_method_class_prefix: true
|
|
28
|
-
add_member_class_prefix: false
|
|
29
|
-
filename: _readme_aimlapi.md
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aimlapi_haystack-1.0.0 → aimlapi_haystack-2.0.0}/tests/test_aimlapi_chat_generator_async.py
RENAMED
|
File without changes
|
|
File without changes
|