From b375706e000634c9c82f3fffc083879ab5822a6f Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Thu, 22 Aug 2024 14:58:51 +0800 Subject: [PATCH] fix: tools error --- server/tools/issue.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/tools/issue.py b/server/tools/issue.py index 4e44e09a..fd13ede1 100644 --- a/server/tools/issue.py +++ b/server/tools/issue.py @@ -19,7 +19,6 @@ def create_issue(repo_name, title, body): :param title: The title of the issue to be created :param body: The content of the issue to be created """ - if access_token is None: return need_github_login() auth = Auth.Token(token=access_token) @@ -31,10 +30,13 @@ def create_issue(repo_name, title, body): # Create an issue issue = repo.create_issue(title=title, body=body) - return issue.html_url + return json.dumps({ + "url": issue.html_url, + "title": issue.title, + }) except Exception as e: print(f"An error occurred: {e}") - return None + return json.dumps([]) @tool def get_issues(