|
3 | 3 | # |
4 | 4 | # SPDX-License-Identifier: Apache-2.0 |
5 | 5 |
|
6 | | -from typing import Any, Optional |
| 6 | +from typing import Any |
7 | 7 |
|
8 | 8 | from haystack import component, default_to_dict, logging |
9 | 9 | from haystack.components.generators.chat import OpenAIChatGenerator |
@@ -59,10 +59,10 @@ def __init__( |
59 | 59 | *, |
60 | 60 | api_key: Secret = Secret.from_env_var("LLAMA_API_KEY"), |
61 | 61 | model: str = "Llama-4-Scout-17B-16E-Instruct-FP8", |
62 | | - streaming_callback: Optional[StreamingCallbackT] = None, |
63 | | - api_base_url: Optional[str] = "https://api.llama.com/compat/v1/", |
64 | | - generation_kwargs: Optional[dict[str, Any]] = None, |
65 | | - tools: Optional[ToolsType] = None, |
| 62 | + streaming_callback: StreamingCallbackT | None = None, |
| 63 | + api_base_url: str | None = "https://api.llama.com/compat/v1/", |
| 64 | + generation_kwargs: dict[str, Any] | None = None, |
| 65 | + tools: ToolsType | None = None, |
66 | 66 | ): |
67 | 67 | """ |
68 | 68 | Creates an instance of LlamaChatGenerator. Unless specified otherwise in the `model`, this is for Llama's |
@@ -117,10 +117,10 @@ def _prepare_api_call( |
117 | 117 | self, |
118 | 118 | *, |
119 | 119 | messages: list[ChatMessage], |
120 | | - streaming_callback: Optional[StreamingCallbackT] = None, |
121 | | - generation_kwargs: Optional[dict[str, Any]] = None, |
122 | | - tools: Optional[ToolsType] = None, |
123 | | - tools_strict: Optional[bool] = None, |
| 120 | + streaming_callback: StreamingCallbackT | None = None, |
| 121 | + generation_kwargs: dict[str, Any] | None = None, |
| 122 | + tools: ToolsType | None = None, |
| 123 | + tools_strict: bool | None = None, |
124 | 124 | ) -> dict[str, Any]: |
125 | 125 | api_args = super(MetaLlamaChatGenerator, self)._prepare_api_call( # noqa: UP008 |
126 | 126 | messages=messages, |
|
0 commit comments