Skip to content

Commit 45f631d

Browse files
authored
fix: tools error (#251)
2 parents bcc1db1 + b375706 commit 45f631d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/tools/issue.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def create_issue(repo_name, title, body):
1919
:param title: The title of the issue to be created
2020
:param body: The content of the issue to be created
2121
"""
22-
2322
if access_token is None:
2423
return need_github_login()
2524
auth = Auth.Token(token=access_token)
@@ -31,10 +30,13 @@ def create_issue(repo_name, title, body):
3130

3231
# Create an issue
3332
issue = repo.create_issue(title=title, body=body)
34-
return issue.html_url
33+
return json.dumps({
34+
"url": issue.html_url,
35+
"title": issue.title,
36+
})
3537
except Exception as e:
3638
print(f"An error occurred: {e}")
37-
return None
39+
return json.dumps([])
3840

3941
@tool
4042
def get_issues(

0 commit comments

Comments
 (0)