diff --git a/integrations/openrouter/pyproject.toml b/integrations/openrouter/pyproject.toml index dd9e191421..d151383118 100644 --- a/integrations/openrouter/pyproject.toml +++ b/integrations/openrouter/pyproject.toml @@ -7,7 +7,7 @@ name = "openrouter-haystack" dynamic = ["version"] description = '' readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = "Apache-2.0" keywords = [] authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }] @@ -15,7 +15,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Development Status :: 4 - Beta", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -23,7 +22,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dependencies = ["haystack-ai>=2.19.0"] +dependencies = ["haystack-ai>=2.22.0"] [project.urls] Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/openrouter#readme" @@ -76,7 +75,6 @@ disallow_incomplete_defs = true [tool.ruff] -target-version = "py39" line-length = 120 [tool.ruff.lint] @@ -123,10 +121,6 @@ ignore = [ "B008", "S101", ] -unfixable = [ - # Don't touch unused imports - "F401", -] [tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] diff --git a/integrations/openrouter/src/haystack_integrations/components/generators/openrouter/chat/chat_generator.py b/integrations/openrouter/src/haystack_integrations/components/generators/openrouter/chat/chat_generator.py index b68978d376..de16dfac5c 100644 --- a/integrations/openrouter/src/haystack_integrations/components/generators/openrouter/chat/chat_generator.py +++ b/integrations/openrouter/src/haystack_integrations/components/generators/openrouter/chat/chat_generator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Optional +from typing import Any from haystack import component, default_to_dict, logging from haystack.components.generators.chat import OpenAIChatGenerator @@ -61,14 +61,14 @@ def __init__( *, api_key: Secret = Secret.from_env_var("OPENROUTER_API_KEY"), model: str = "openai/gpt-5-mini", - streaming_callback: Optional[StreamingCallbackT] = None, - api_base_url: Optional[str] = "https://openrouter.ai/api/v1", - generation_kwargs: Optional[dict[str, Any]] = None, - tools: Optional[ToolsType] = None, - timeout: Optional[float] = None, - extra_headers: Optional[dict[str, Any]] = None, - max_retries: Optional[int] = None, - http_client_kwargs: Optional[dict[str, Any]] = None, + streaming_callback: StreamingCallbackT | None = None, + api_base_url: str | None = "https://openrouter.ai/api/v1", + generation_kwargs: dict[str, Any] | None = None, + tools: ToolsType | None = None, + timeout: float | None = None, + extra_headers: dict[str, Any] | None = None, + max_retries: int | None = None, + http_client_kwargs: dict[str, Any] | None = None, ): """ Creates an instance of OpenRouterChatGenerator. Unless specified otherwise, @@ -167,10 +167,10 @@ def _prepare_api_call( self, *, messages: list[ChatMessage], - streaming_callback: Optional[StreamingCallbackT] = None, - generation_kwargs: Optional[dict[str, Any]] = None, - tools: Optional[ToolsType] = None, - tools_strict: Optional[bool] = None, + streaming_callback: StreamingCallbackT | None = None, + generation_kwargs: dict[str, Any] | None = None, + tools: ToolsType | None = None, + tools_strict: bool | None = None, ) -> dict[str, Any]: # update generation kwargs by merging with the generation kwargs passed to the run method generation_kwargs = {**self.generation_kwargs, **(generation_kwargs or {})}