Skip to content

Commit 73859a2

Browse files
committed
fix: remove extra params
1 parent a28727e commit 73859a2

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

integrations/github/src/haystack_integrations/tools/github/repo_forker_tool.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def __init__(
2424
description: Optional[str] = REPO_FORKER_PROMPT,
2525
parameters: Optional[Dict[str, Any]] = REPO_FORKER_SCHEMA,
2626
github_token: Optional[Secret] = None,
27-
repo: Optional[str] = None,
28-
branch: str = "main",
2927
raise_on_failure: bool = True,
3028
outputs_to_string: Optional[Dict[str, Union[str, Callable[[Any], str]]]] = None,
3129
inputs_from_state: Optional[Dict[str, str]] = None,
@@ -38,8 +36,6 @@ def __init__(
3836
:param description: Optional description.
3937
:param parameters: Optional JSON schema defining the parameters expected by the Tool.
4038
:param github_token: GitHub personal access token for API authentication
41-
:param repo: Default repository in owner/repo format
42-
:param branch: Default branch to work with
4339
:param raise_on_failure: If True, raises exceptions on API errors
4440
:param outputs_to_string:
4541
Optional dictionary defining how a tool outputs should be converted into a string.
@@ -66,8 +62,6 @@ def __init__(
6662
self.description = description
6763
self.parameters = parameters
6864
self.github_token = github_token
69-
self.repo = repo
70-
self.branch = branch
7165
self.raise_on_failure = raise_on_failure
7266
self.outputs_to_string = outputs_to_string
7367
self.inputs_from_state = inputs_from_state
@@ -100,8 +94,6 @@ def to_dict(self) -> Dict[str, Any]:
10094
"description": self.description,
10195
"parameters": self.parameters,
10296
"github_token": self.github_token.to_dict() if self.github_token else None,
103-
"repo": self.repo,
104-
"branch": self.branch,
10597
"raise_on_failure": self.raise_on_failure,
10698
"outputs_to_string": self.outputs_to_string,
10799
"inputs_from_state": self.inputs_from_state,

integrations/github/tests/test_repo_forker_tool.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def test_init(self, monkeypatch):
1515
assert tool.description == REPO_FORKER_PROMPT
1616
assert tool.parameters == REPO_FORKER_SCHEMA
1717
assert tool.github_token is None
18-
assert tool.repo is None
19-
assert tool.branch == "main"
2018
assert tool.raise_on_failure is True
2119
assert tool.outputs_to_string is None
2220
assert tool.inputs_from_state is None
@@ -31,8 +29,6 @@ def test_from_dict(self, monkeypatch):
3129
"description": REPO_FORKER_PROMPT,
3230
"parameters": REPO_FORKER_SCHEMA,
3331
"github_token": None,
34-
"repo": None,
35-
"branch": "main",
3632
"raise_on_failure": True,
3733
"outputs_to_string": None,
3834
"inputs_from_state": None,
@@ -44,8 +40,6 @@ def test_from_dict(self, monkeypatch):
4440
assert tool.description == REPO_FORKER_PROMPT
4541
assert tool.parameters == REPO_FORKER_SCHEMA
4642
assert tool.github_token is None
47-
assert tool.repo is None
48-
assert tool.branch == "main"
4943
assert tool.raise_on_failure is True
5044
assert tool.outputs_to_string is None
5145
assert tool.inputs_from_state is None
@@ -60,8 +54,6 @@ def test_to_dict(self, monkeypatch):
6054
assert tool_dict["data"]["description"] == REPO_FORKER_PROMPT
6155
assert tool_dict["data"]["parameters"] == REPO_FORKER_SCHEMA
6256
assert tool_dict["data"]["github_token"] is None
63-
assert tool_dict["data"]["repo"] is None
64-
assert tool_dict["data"]["branch"] == "main"
6557
assert tool_dict["data"]["raise_on_failure"] is True
6658
assert tool_dict["data"]["outputs_to_string"] is None
6759
assert tool_dict["data"]["inputs_from_state"] is None
@@ -71,8 +63,6 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7163
monkeypatch.setenv("GITHUB_TOKEN", "test-token")
7264
tool = GitHubRepoForkerTool(
7365
github_token=None,
74-
repo="owner/repo",
75-
branch="dev",
7666
raise_on_failure=False,
7767
outputs_to_string={"source": "docs", "handler": message_handler},
7868
inputs_from_state={"repository": "repo"},
@@ -84,8 +74,6 @@ def test_to_dict_with_extra_params(self, monkeypatch):
8474
assert tool_dict["data"]["description"] == REPO_FORKER_PROMPT
8575
assert tool_dict["data"]["parameters"] == REPO_FORKER_SCHEMA
8676
assert tool_dict["data"]["github_token"] is None
87-
assert tool_dict["data"]["repo"] == "owner/repo"
88-
assert tool_dict["data"]["branch"] == "dev"
8977
assert tool_dict["data"]["raise_on_failure"] is False
9078
assert (
9179
tool_dict["data"]["outputs_to_string"]["handler"]
@@ -107,8 +95,6 @@ def test_from_dict_with_extra_params(self, monkeypatch):
10795
"description": REPO_FORKER_PROMPT,
10896
"parameters": REPO_FORKER_SCHEMA,
10997
"github_token": None,
110-
"repo": "owner/repo",
111-
"branch": "dev",
11298
"raise_on_failure": False,
11399
"outputs_to_string": {"handler": "haystack_integrations.tools.github.utils.message_handler"},
114100
"inputs_from_state": {"repository": "repo"},
@@ -125,8 +111,6 @@ def test_from_dict_with_extra_params(self, monkeypatch):
125111
assert tool.description == REPO_FORKER_PROMPT
126112
assert tool.parameters == REPO_FORKER_SCHEMA
127113
assert tool.github_token is None
128-
assert tool.repo == "owner/repo"
129-
assert tool.branch == "dev"
130114
assert tool.raise_on_failure is False
131115
assert tool.outputs_to_string["handler"] == message_handler
132116
assert tool.inputs_from_state == {"repository": "repo"}

0 commit comments

Comments
 (0)