Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions integrations/openrouter/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ 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" }]
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",
"Programming Language :: Python :: 3.13",
"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"
Expand Down Expand Up @@ -76,7 +75,6 @@ disallow_incomplete_defs = true


[tool.ruff]
target-version = "py39"
line-length = 120

[tool.ruff.lint]
Expand Down Expand Up @@ -123,10 +121,6 @@ ignore = [
"B008",
"S101",
]
unfixable = [
# Don't touch unused imports
"F401",
]

[tool.ruff.lint.isort]
known-first-party = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {})}
Expand Down
Loading