Skip to content

Commit 5978ce2

Browse files
Refactor print statements and clean up code
1 parent 399f176 commit 5978ce2

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

  • contributing/samples/adk_triaging_agent

contributing/samples/adk_triaging_agent/agent.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545

46-
LABEL_TO_GTECH = ["klateefa","llalitkumarrr","surajksharma07"]
46+
LABEL_TO_GTECH = ["klateefa", "llalitkumarrr", "surajksharma07"]
4747

4848
LABEL_GUIDELINES = """
4949
Label rubric and disambiguation rules:
@@ -131,7 +131,6 @@ def list_untriaged_issues(issue_count: int) -> dict[str, Any]:
131131
# needs_owner = has_planned and not assignees
132132
needs_owner = not assignees
133133

134-
135134
# Include issue if it needs any action
136135
if needs_component_label or needs_owner:
137136
# issue["has_planned_label"] = has_planned
@@ -194,11 +193,7 @@ def assign_gtech_owner_to_issue(issue_number: int) -> dict[str, Any]:
194193
Returns:
195194
The status of this request, with the assigned owner when successful.
196195
"""
197-
print(
198-
f"Attempting to assign GTech owner to issue #{issue_number}"
199-
)
200-
201-
196+
print(f"Attempting to assign GTech owner to issue #{issue_number}")
202197
gtech_assignee = LABEL_TO_GTECH[issue_number % len(LABEL_TO_GTECH)]
203198
if not gtech_assignee:
204199
return {
@@ -208,12 +203,9 @@ def assign_gtech_owner_to_issue(issue_number: int) -> dict[str, Any]:
208203
assignee_url = (
209204
f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/assignees"
210205
)
211-
assignee_payload = {"assignees": [gtech_assignee]}
212-
213206

214207
try:
215208
response = post_request(assignee_url, assignee_payload)
216-
print("successfully assigned this issue to :",gtech_assignee)
217209
except requests.exceptions.RequestException as e:
218210
return error_response(f"Error: {e}")
219211

@@ -340,7 +332,6 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
340332
tools=[
341333
list_untriaged_issues,
342334
add_label_to_issue,
343-
# add_owner_to_issue,
344335
assign_gtech_owner_to_issue,
345336
change_issue_type,
346337
],

0 commit comments

Comments
 (0)