Spaces:
Sleeping
Sleeping
Aiswarya Sankar
commited on
Commit
·
d8160a7
1
Parent(s):
5f0abd6
Refactor stuff
Browse files
app.py
CHANGED
@@ -262,7 +262,7 @@ def answer_questions(question: str, github: str, **kwargs) -> Response:
|
|
262 |
)
|
263 |
|
264 |
|
265 |
-
def fetchGithubIssues(
|
266 |
"""
|
267 |
This endpoint should get a list of all the github issues that are open for this repository
|
268 |
"""
|
@@ -270,7 +270,7 @@ def fetchGithubIssues(num_issues:int, **kwargs) -> Response:
|
|
270 |
batch = []
|
271 |
all_issues = []
|
272 |
per_page = 100 # Number of issues to return per page
|
273 |
-
num_pages = math.ceil(
|
274 |
base_url = "https://api.github.com/repos"
|
275 |
|
276 |
GITHUB_TOKEN = "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" # Copy your GitHub token here
|
@@ -531,7 +531,7 @@ with gr.Blocks() as demo:
|
|
531 |
# Create the dropdown
|
532 |
# ticket_choices = {git_tickets.value["title"]: ticket for ticket in tickets}
|
533 |
# ticket_titles = [git_tickets.value["title"] for ticket in tickets]
|
534 |
-
ingestTickets = gr.Button("Ingest github tickets").click(fetchGithubIssues
|
535 |
ticketDropdown = gr.Dropdown(choices=git_titles.value, title="Github Issues")
|
536 |
|
537 |
# Extract the ticket title, body for the selected ticket
|
|
|
262 |
)
|
263 |
|
264 |
|
265 |
+
def fetchGithubIssues(**kwargs) -> Response:
|
266 |
"""
|
267 |
This endpoint should get a list of all the github issues that are open for this repository
|
268 |
"""
|
|
|
270 |
batch = []
|
271 |
all_issues = []
|
272 |
per_page = 100 # Number of issues to return per page
|
273 |
+
num_pages = math.ceil(20 / per_page)
|
274 |
base_url = "https://api.github.com/repos"
|
275 |
|
276 |
GITHUB_TOKEN = "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" # Copy your GitHub token here
|
|
|
531 |
# Create the dropdown
|
532 |
# ticket_choices = {git_tickets.value["title"]: ticket for ticket in tickets}
|
533 |
# ticket_titles = [git_tickets.value["title"] for ticket in tickets]
|
534 |
+
ingestTickets = gr.Button("Ingest github tickets").click(fetchGithubIssues).then(create_ticket_dropdown)
|
535 |
ticketDropdown = gr.Dropdown(choices=git_titles.value, title="Github Issues")
|
536 |
|
537 |
# Extract the ticket title, body for the selected ticket
|