Skip to content

Commit 6ab1f04

Browse files
anakin87davidsbatista
authored andcommitted
chore!: meta_llama - drop Python 3.9 and use X|Y typing (#2712)
1 parent 16c64d4 commit 6ab1f04

2 files changed

Lines changed: 11 additions & 17 deletions

File tree

integrations/meta_llama/pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ name = "meta-llama-haystack"
77
dynamic = ["version"]
88
description = 'Use Llama models via Llama API'
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
license = "Apache-2.0"
1212
keywords = []
1313
authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
1414
classifiers = [
1515
"License :: OSI Approved :: Apache Software License",
1616
"Development Status :: 4 - Beta",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
2322
"Programming Language :: Python :: Implementation :: CPython",
2423
"Programming Language :: Python :: Implementation :: PyPy",
2524
]
26-
dependencies = ["haystack-ai>=2.19.0"]
25+
dependencies = ["haystack-ai>=2.22.0"]
2726

2827
[project.urls]
2928
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/meta_llama#readme"
@@ -75,7 +74,6 @@ check_untyped_defs = true
7574
disallow_incomplete_defs = true
7675

7776
[tool.ruff]
78-
target-version = "py39"
7977
line-length = 120
8078

8179
[tool.ruff.lint]
@@ -122,10 +120,6 @@ ignore = [
122120
"B008",
123121
"S101",
124122
]
125-
unfixable = [
126-
# Don't touch unused imports
127-
"F401",
128-
]
129123

130124
[tool.ruff.lint.isort]
131125
known-first-party = ["haystack_integrations"]

integrations/meta_llama/src/haystack_integrations/components/generators/meta_llama/chat/chat_generator.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0
55

6-
from typing import Any, Optional
6+
from typing import Any
77

88
from haystack import component, default_to_dict, logging
99
from haystack.components.generators.chat import OpenAIChatGenerator
@@ -59,10 +59,10 @@ def __init__(
5959
*,
6060
api_key: Secret = Secret.from_env_var("LLAMA_API_KEY"),
6161
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,
6666
):
6767
"""
6868
Creates an instance of LlamaChatGenerator. Unless specified otherwise in the `model`, this is for Llama's
@@ -117,10 +117,10 @@ def _prepare_api_call(
117117
self,
118118
*,
119119
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,
124124
) -> dict[str, Any]:
125125
api_args = super(MetaLlamaChatGenerator, self)._prepare_api_call( # noqa: UP008
126126
messages=messages,

0 commit comments

Comments
 (0)