Skip to content

Commit 265b5c1

Browse files
docs: sync Core Integrations API reference (aimlapi) on Docusaurus (#12038)
Co-authored-by: julian-risch <4181769+julian-risch@users.noreply.github.com>
1 parent 5c474c5 commit 265b5c1

15 files changed

Lines changed: 720 additions & 734 deletions

File tree

docs-website/reference/integrations-api/aimlapi.md

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ description: "AIMLAPI integration for Haystack"
55
slug: "/integrations-aimlapi"
66
---
77

8-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator"></a>
98

10-
## Module haystack\_integrations.components.generators.aimlapi.chat.chat\_generator
11-
12-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator"></a>
9+
## haystack_integrations.components.generators.aimlapi.chat.chat_generator
1310

1411
### AIMLAPIChatGenerator
1512

13+
Bases: <code>OpenAIChatGenerator</code>
14+
1615
Enables text generation using AIMLAPI generative models.
16+
1717
For supported models, see AIMLAPI documentation.
1818

1919
Users can pass any text generation parameters valid for the AIMLAPI chat completion API
2020
directly to this component using the `generation_kwargs` parameter in `__init__` or the `generation_kwargs`
2121
parameter in `run` method.
2222

2323
Key Features and Compatibility:
24+
2425
- **Primary Compatibility**: Designed to work seamlessly with the AIMLAPI chat completion endpoint.
2526
- **Streaming Support**: Supports streaming responses from the AIMLAPI chat completion endpoint.
2627
- **Customizability**: Supports all parameters supported by the AIMLAPI chat completion endpoint.
@@ -34,6 +35,7 @@ For more details on the parameters supported by the AIMLAPI API, refer to the
3435
AIMLAPI documentation.
3536

3637
Usage example:
38+
3739
```python
3840
from haystack_integrations.components.generators.aimlapi import AIMLAPIChatGenerator
3941
from haystack.dataclasses import ChatMessage
@@ -51,69 +53,66 @@ print(response)
5153
>>'usage': {'prompt_tokens': 15, 'completion_tokens': 36, 'total_tokens': 51}})]}
5254
```
5355

54-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator.__init__"></a>
55-
56-
#### AIMLAPIChatGenerator.\_\_init\_\_
56+
#### __init__
5757

5858
```python
59-
def __init__(*,
60-
api_key: Secret = Secret.from_env_var("AIMLAPI_API_KEY"),
61-
model: str = "openai/gpt-5-chat-latest",
62-
streaming_callback: StreamingCallbackT | None = None,
63-
api_base_url: str | None = "https://api.aimlapi.com/v1",
64-
generation_kwargs: dict[str, Any] | None = None,
65-
tools: ToolsType | None = None,
66-
timeout: float | None = None,
67-
extra_headers: dict[str, Any] | None = None,
68-
max_retries: int | None = None,
69-
http_client_kwargs: dict[str, Any] | None = None)
59+
__init__(
60+
*,
61+
api_key: Secret = Secret.from_env_var("AIMLAPI_API_KEY"),
62+
model: str = "openai/gpt-5-chat-latest",
63+
streaming_callback: StreamingCallbackT | None = None,
64+
api_base_url: str | None = "https://api.aimlapi.com/v1",
65+
generation_kwargs: dict[str, Any] | None = None,
66+
tools: ToolsType | None = None,
67+
timeout: float | None = None,
68+
extra_headers: dict[str, Any] | None = None,
69+
max_retries: int | None = None,
70+
http_client_kwargs: dict[str, Any] | None = None
71+
) -> None
7072
```
7173

72-
Creates an instance of AIMLAPIChatGenerator. Unless specified otherwise,
74+
Creates an instance of AIMLAPIChatGenerator.
7375

74-
the default model is `openai/gpt-5-chat-latest`.
76+
Unless specified otherwise, the default model is `openai/gpt-5-chat-latest`.
7577

76-
**Arguments**:
78+
**Parameters:**
7779

78-
- `api_key`: The AIMLAPI API key.
79-
- `model`: The name of the AIMLAPI chat completion model to use.
80-
- `streaming_callback`: A callback function that is called when a new token is received from the stream.
81-
The callback function accepts StreamingChunk as an argument.
82-
- `api_base_url`: The AIMLAPI API Base url.
83-
For more details, see AIMLAPI documentation.
84-
- `generation_kwargs`: Other parameters to use for the model. These parameters are all sent directly to
85-
the AIMLAPI endpoint. See AIMLAPI API docs for more details.
86-
Some of the supported parameters:
80+
- **api_key** (<code>Secret</code>) – The AIMLAPI API key.
81+
- **model** (<code>str</code>) – The name of the AIMLAPI chat completion model to use.
82+
- **streaming_callback** (<code>StreamingCallbackT | None</code>) – A callback function that is called when a new token is received from the stream.
83+
The callback function accepts StreamingChunk as an argument.
84+
- **api_base_url** (<code>str | None</code>) – The AIMLAPI API Base url.
85+
For more details, see AIMLAPI documentation.
86+
- **generation_kwargs** (<code>dict\[str, Any\] | None</code>) – Other parameters to use for the model. These parameters are all sent directly to
87+
the AIMLAPI endpoint. See AIMLAPI API docs for more details.
88+
Some of the supported parameters:
8789
- `max_tokens`: The maximum number of tokens the output text can have.
8890
- `temperature`: What sampling temperature to use. Higher values mean the model will take more risks.
89-
Try 0.9 for more creative applications and 0 (argmax sampling) for ones with a well-defined answer.
91+
Try 0.9 for more creative applications and 0 (argmax sampling) for ones with a well-defined answer.
9092
- `top_p`: An alternative to sampling with temperature, called nucleus sampling, where the model
91-
considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens
92-
comprising the top 10% probability mass are considered.
93+
considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens
94+
comprising the top 10% probability mass are considered.
9395
- `stream`: Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent
94-
events as they become available, with the stream terminated by a data: [DONE] message.
96+
events as they become available, with the stream terminated by a data: [DONE] message.
9597
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
9698
- `random_seed`: The seed to use for random sampling.
97-
- `tools`: A list of tools or a Toolset for which the model can prepare calls. This parameter can accept either a
98-
list of `Tool` objects or a `Toolset` instance.
99-
- `timeout`: The timeout for the AIMLAPI API call.
100-
- `extra_headers`: Additional HTTP headers to include in requests to the AIMLAPI API.
101-
- `max_retries`: Maximum number of retries to contact AIMLAPI after an internal error.
102-
If not set, it defaults to either the `AIMLAPI_MAX_RETRIES` environment variable, or set to 5.
103-
- `http_client_kwargs`: A dictionary of keyword arguments to configure a custom `httpx.Client`or `httpx.AsyncClient`.
104-
For more information, see the [HTTPX documentation](https://www.python-httpx.org/api/`client`).
99+
- **tools** (<code>ToolsType | None</code>) – A list of tools or a Toolset for which the model can prepare calls. This parameter can accept either a
100+
list of `Tool` objects or a `Toolset` instance.
101+
- **timeout** (<code>float | None</code>) – The timeout for the AIMLAPI API call.
102+
- **extra_headers** (<code>dict\[str, Any\] | None</code>) – Additional HTTP headers to include in requests to the AIMLAPI API.
103+
- **max_retries** (<code>int | None</code>) – Maximum number of retries to contact AIMLAPI after an internal error.
104+
If not set, it defaults to either the `AIMLAPI_MAX_RETRIES` environment variable, or set to 5.
105+
- **http_client_kwargs** (<code>dict\[str, Any\] | None</code>) – A dictionary of keyword arguments to configure a custom `httpx.Client`or `httpx.AsyncClient`.
106+
For more information, see the [HTTPX documentation](https://www.python-httpx.org/api/#client).
105107

106-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator.to_dict"></a>
107-
108-
#### AIMLAPIChatGenerator.to\_dict
108+
#### to_dict
109109

110110
```python
111-
def to_dict() -> dict[str, Any]
111+
to_dict() -> dict[str, Any]
112112
```
113113

114114
Serialize this component to a dictionary.
115115

116-
**Returns**:
117-
118-
The serialized component as a dictionary.
116+
**Returns:**
119117

118+
- <code>dict\[str, Any\]</code> – The serialized component as a dictionary.

docs-website/reference_versioned_docs/version-2.18/integrations-api/aimlapi.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ description: "AIMLAPI integration for Haystack"
55
slug: "/integrations-aimlapi"
66
---
77

8-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator"></a>
98

10-
## Module haystack\_integrations.components.generators.aimlapi.chat.chat\_generator
11-
12-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator"></a>
9+
## haystack_integrations.components.generators.aimlapi.chat.chat_generator
1310

1411
### AIMLAPIChatGenerator
1512

13+
Bases: <code>OpenAIChatGenerator</code>
14+
1615
Enables text generation using AIMLAPI generative models.
16+
1717
For supported models, see AIMLAPI documentation.
1818

1919
Users can pass any text generation parameters valid for the AIMLAPI chat completion API
2020
directly to this component using the `generation_kwargs` parameter in `__init__` or the `generation_kwargs`
2121
parameter in `run` method.
2222

2323
Key Features and Compatibility:
24+
2425
- **Primary Compatibility**: Designed to work seamlessly with the AIMLAPI chat completion endpoint.
2526
- **Streaming Support**: Supports streaming responses from the AIMLAPI chat completion endpoint.
2627
- **Customizability**: Supports all parameters supported by the AIMLAPI chat completion endpoint.
@@ -34,6 +35,7 @@ For more details on the parameters supported by the AIMLAPI API, refer to the
3435
AIMLAPI documentation.
3536

3637
Usage example:
38+
3739
```python
3840
from haystack_integrations.components.generators.aimlapi import AIMLAPIChatGenerator
3941
from haystack.dataclasses import ChatMessage
@@ -51,68 +53,66 @@ print(response)
5153
>>'usage': {'prompt_tokens': 15, 'completion_tokens': 36, 'total_tokens': 51}})]}
5254
```
5355

54-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator.__init__"></a>
55-
56-
#### AIMLAPIChatGenerator.\_\_init\_\_
56+
#### __init__
5757

5858
```python
59-
def __init__(*,
60-
api_key: Secret = Secret.from_env_var("AIMLAPI_API_KEY"),
61-
model: str = "openai/gpt-5-chat-latest",
62-
streaming_callback: StreamingCallbackT | None = None,
63-
api_base_url: str | None = "https://api.aimlapi.com/v1",
64-
generation_kwargs: dict[str, Any] | None = None,
65-
tools: ToolsType | None = None,
66-
timeout: float | None = None,
67-
extra_headers: dict[str, Any] | None = None,
68-
max_retries: int | None = None,
69-
http_client_kwargs: dict[str, Any] | None = None)
59+
__init__(
60+
*,
61+
api_key: Secret = Secret.from_env_var("AIMLAPI_API_KEY"),
62+
model: str = "openai/gpt-5-chat-latest",
63+
streaming_callback: StreamingCallbackT | None = None,
64+
api_base_url: str | None = "https://api.aimlapi.com/v1",
65+
generation_kwargs: dict[str, Any] | None = None,
66+
tools: ToolsType | None = None,
67+
timeout: float | None = None,
68+
extra_headers: dict[str, Any] | None = None,
69+
max_retries: int | None = None,
70+
http_client_kwargs: dict[str, Any] | None = None
71+
) -> None
7072
```
7173

72-
Creates an instance of AIMLAPIChatGenerator. Unless specified otherwise,
74+
Creates an instance of AIMLAPIChatGenerator.
7375

74-
the default model is `openai/gpt-5-chat-latest`.
76+
Unless specified otherwise, the default model is `openai/gpt-5-chat-latest`.
7577

76-
**Arguments**:
78+
**Parameters:**
7779

78-
- `api_key`: The AIMLAPI API key.
79-
- `model`: The name of the AIMLAPI chat completion model to use.
80-
- `streaming_callback`: A callback function that is called when a new token is received from the stream.
81-
The callback function accepts StreamingChunk as an argument.
82-
- `api_base_url`: The AIMLAPI API Base url.
83-
For more details, see AIMLAPI documentation.
84-
- `generation_kwargs`: Other parameters to use for the model. These parameters are all sent directly to
85-
the AIMLAPI endpoint. See AIMLAPI API docs for more details.
86-
Some of the supported parameters:
80+
- **api_key** (<code>Secret</code>) – The AIMLAPI API key.
81+
- **model** (<code>str</code>) – The name of the AIMLAPI chat completion model to use.
82+
- **streaming_callback** (<code>StreamingCallbackT | None</code>) – A callback function that is called when a new token is received from the stream.
83+
The callback function accepts StreamingChunk as an argument.
84+
- **api_base_url** (<code>str | None</code>) – The AIMLAPI API Base url.
85+
For more details, see AIMLAPI documentation.
86+
- **generation_kwargs** (<code>dict\[str, Any\] | None</code>) – Other parameters to use for the model. These parameters are all sent directly to
87+
the AIMLAPI endpoint. See AIMLAPI API docs for more details.
88+
Some of the supported parameters:
8789
- `max_tokens`: The maximum number of tokens the output text can have.
8890
- `temperature`: What sampling temperature to use. Higher values mean the model will take more risks.
89-
Try 0.9 for more creative applications and 0 (argmax sampling) for ones with a well-defined answer.
91+
Try 0.9 for more creative applications and 0 (argmax sampling) for ones with a well-defined answer.
9092
- `top_p`: An alternative to sampling with temperature, called nucleus sampling, where the model
91-
considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens
92-
comprising the top 10% probability mass are considered.
93+
considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens
94+
comprising the top 10% probability mass are considered.
9395
- `stream`: Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent
94-
events as they become available, with the stream terminated by a data: [DONE] message.
96+
events as they become available, with the stream terminated by a data: [DONE] message.
9597
- `safe_prompt`: Whether to inject a safety prompt before all conversations.
9698
- `random_seed`: The seed to use for random sampling.
97-
- `tools`: A list of tools or a Toolset for which the model can prepare calls. This parameter can accept either a
98-
list of `Tool` objects or a `Toolset` instance.
99-
- `timeout`: The timeout for the AIMLAPI API call.
100-
- `extra_headers`: Additional HTTP headers to include in requests to the AIMLAPI API.
101-
- `max_retries`: Maximum number of retries to contact AIMLAPI after an internal error.
102-
If not set, it defaults to either the `AIMLAPI_MAX_RETRIES` environment variable, or set to 5.
103-
- `http_client_kwargs`: A dictionary of keyword arguments to configure a custom `httpx.Client`or `httpx.AsyncClient`.
104-
For more information, see the [HTTPX documentation](https://www.python-httpx.org/api/`client`).
105-
106-
<a id="haystack_integrations.components.generators.aimlapi.chat.chat_generator.AIMLAPIChatGenerator.to_dict"></a>
99+
- **tools** (<code>ToolsType | None</code>) – A list of tools or a Toolset for which the model can prepare calls. This parameter can accept either a
100+
list of `Tool` objects or a `Toolset` instance.
101+
- **timeout** (<code>float | None</code>) – The timeout for the AIMLAPI API call.
102+
- **extra_headers** (<code>dict\[str, Any\] | None</code>) – Additional HTTP headers to include in requests to the AIMLAPI API.
103+
- **max_retries** (<code>int | None</code>) – Maximum number of retries to contact AIMLAPI after an internal error.
104+
If not set, it defaults to either the `AIMLAPI_MAX_RETRIES` environment variable, or set to 5.
105+
- **http_client_kwargs** (<code>dict\[str, Any\] | None</code>) – A dictionary of keyword arguments to configure a custom `httpx.Client`or `httpx.AsyncClient`.
106+
For more information, see the [HTTPX documentation](https://www.python-httpx.org/api/#client).
107107

108-
#### AIMLAPIChatGenerator.to\_dict
108+
#### to_dict
109109

110110
```python
111-
def to_dict() -> dict[str, Any]
111+
to_dict() -> dict[str, Any]
112112
```
113113

114114
Serialize this component to a dictionary.
115115

116-
**Returns**:
116+
**Returns:**
117117

118-
The serialized component as a dictionary.
118+
- <code>dict\[str, Any\]</code> – The serialized component as a dictionary.

0 commit comments

Comments
 (0)