Skip to content

Commit

Permalink
TLK-2709 - Github Tool Implementation review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneLightsOn committed Jan 30, 2025
1 parent 3914e8c commit 120ea6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/backend/chat/collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ async def rerank_and_chunk(

chunked_outputs = []
for output in tool_result["outputs"]:
if isinstance(output, ToolError):
reranked_results[tool_call_hashable] = tool_result
continue

text = output.get("text")

if not text:
Expand Down
5 changes: 3 additions & 2 deletions src/backend/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ def get_tool_error(cls, details: str, text: str = "Error calling tool", error_ty

@classmethod
def get_no_results_error(cls):
return ToolError(text="No results found.", details="No results found for the given params.")
tool_error = ToolError(text="No results found.", details="No results found for the given params.").model_dump()
return [tool_error]

@abstractmethod
async def call(
self, parameters: dict, ctx: Any, **kwargs: Any
) -> Union[List[Dict[str, Any]], ToolError]:
) -> List[Dict[str, Any]]:
...

@classmethod
Expand Down
4 changes: 3 additions & 1 deletion src/backend/tools/github/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from github import Auth, Github

from backend.tools.github.constants import SEARCH_LIMIT


class GithubClient:
def __init__(self, auth_token, search_limit=20):
def __init__(self, auth_token, search_limit=SEARCH_LIMIT):
auth = Auth.Token(auth_token)
self.client = Github(auth=auth, per_page=search_limit)

Expand Down

0 comments on commit 120ea6f

Please sign in to comment.