ultralytics-actions 0.0.97__py3-none-any.whl → 0.0.99__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- actions/__init__.py +1 -1
- actions/utils/openai_utils.py +18 -14
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/METADATA +1 -1
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/RECORD +8 -8
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/WHEEL +0 -0
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/entry_points.txt +0 -0
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/licenses/LICENSE +0 -0
- {ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/top_level.txt +0 -0
actions/__init__.py
CHANGED
actions/utils/openai_utils.py
CHANGED
@@ -3,14 +3,13 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
import os
|
6
|
-
import time
|
7
6
|
|
8
7
|
import requests
|
9
8
|
|
10
9
|
from actions.utils.common_utils import check_links_in_string
|
11
10
|
|
12
11
|
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
13
|
-
OPENAI_MODEL = os.getenv("OPENAI_MODEL", "gpt-5-
|
12
|
+
OPENAI_MODEL = os.getenv("OPENAI_MODEL", "gpt-5-codex")
|
14
13
|
SYSTEM_PROMPT_ADDITION = """Guidance:
|
15
14
|
- Ultralytics Branding: Use YOLO11, YOLO26, etc., not YOLOv11, YOLOv26 (only older versions like YOLOv10 have a v). Always capitalize "HUB" in "Ultralytics HUB"; use "Ultralytics HUB", not "The Ultralytics HUB".
|
16
15
|
- Avoid Equations: Do not include equations or mathematical notations.
|
@@ -41,9 +40,9 @@ def get_completion(
|
|
41
40
|
temperature: float = 1.0, # note GPT-5 requires temperature=1.0
|
42
41
|
reasoning_effort: str = None, # reasoning effort for GPT-5 models: minimal, low, medium, high
|
43
42
|
) -> str:
|
44
|
-
"""Generates a completion using OpenAI's API based on input messages."""
|
43
|
+
"""Generates a completion using OpenAI's Responses API based on input messages."""
|
45
44
|
assert OPENAI_API_KEY, "OpenAI API key is required."
|
46
|
-
url = "https://api.openai.com/v1/
|
45
|
+
url = "https://api.openai.com/v1/responses"
|
47
46
|
headers = {"Authorization": f"Bearer {OPENAI_API_KEY}", "Content-Type": "application/json"}
|
48
47
|
if messages and messages[0].get("role") == "system":
|
49
48
|
messages[0]["content"] += "\n\n" + SYSTEM_PROMPT_ADDITION
|
@@ -51,20 +50,25 @@ def get_completion(
|
|
51
50
|
content = ""
|
52
51
|
max_retries = 2
|
53
52
|
for attempt in range(max_retries + 2): # attempt = [0, 1, 2, 3], 2 random retries before asking for no links
|
54
|
-
data = {
|
55
|
-
|
56
|
-
|
57
|
-
"seed": int(time.time() * 1000),
|
58
|
-
"temperature": temperature,
|
59
|
-
}
|
60
|
-
|
61
|
-
# Add reasoning_effort for GPT-5 models
|
53
|
+
data = {"model": OPENAI_MODEL, "input": messages, "store": False, "temperature": temperature}
|
54
|
+
|
55
|
+
# Add reasoning for GPT-5 models
|
62
56
|
if "gpt-5" in OPENAI_MODEL:
|
63
|
-
data["
|
57
|
+
data["reasoning"] = {"effort": reasoning_effort or "low"} # Default to low for GPT-5
|
64
58
|
|
65
59
|
r = requests.post(url, json=data, headers=headers)
|
66
60
|
r.raise_for_status()
|
67
|
-
|
61
|
+
response_data = r.json()
|
62
|
+
|
63
|
+
# Extract text from output array
|
64
|
+
content = ""
|
65
|
+
for item in response_data.get("output", []):
|
66
|
+
if item.get("type") == "message":
|
67
|
+
for content_item in item.get("content", []):
|
68
|
+
if content_item.get("type") == "output_text":
|
69
|
+
content += content_item.get("text", "")
|
70
|
+
|
71
|
+
content = content.strip()
|
68
72
|
content = remove_outer_codeblocks(content)
|
69
73
|
for x in remove:
|
70
74
|
content = content.replace(x, "")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.99
|
4
4
|
Summary: Ultralytics Actions for GitHub automation and PR management.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
actions/__init__.py,sha256=
|
1
|
+
actions/__init__.py,sha256=JKSdo8QTOTrYpQHCCkMK4ULpJNvplUyJfsCzFmOpjg4,742
|
2
2
|
actions/dispatch_actions.py,sha256=RPqjsnH_8932oLaPp9wWRCWKTaMp8M9dn6CIAMtNjN0,4230
|
3
3
|
actions/first_interaction.py,sha256=bPG_BMp_k-iJbeQ-fI1bTRHxnfo86ZdIhb0wytBGXVo,16511
|
4
4
|
actions/summarize_pr.py,sha256=2qDkSlonQGytJXcthsggPE-AKu2xhtcsWwIaBgkSmAk,10499
|
@@ -8,11 +8,11 @@ actions/update_markdown_code_blocks.py,sha256=EdIlRd4s903U7Q0J1yI0Z6Wk0ldJbQF43X
|
|
8
8
|
actions/utils/__init__.py,sha256=7k4cmFX0Td99Uzgsd8Mm-E0xq5kQ5ZJoPM_oGCVD4CU,804
|
9
9
|
actions/utils/common_utils.py,sha256=8ZmgaXZU3J2sg-HSaldp3hHYq7bI3akcJHdIXPmcNAo,11908
|
10
10
|
actions/utils/github_utils.py,sha256=NJYfZzpagt5LK-Rwt6tqdTq7DZRGhclKLHHd-N2zkfk,8207
|
11
|
-
actions/utils/openai_utils.py,sha256=
|
11
|
+
actions/utils/openai_utils.py,sha256=WKnsLVA1-YNLvJmyNCzEV6lFs11qoYc4Ft18ylLEpaQ,4209
|
12
12
|
actions/utils/version_utils.py,sha256=EIbm3iZVNyNl3dh8aNz_9ITeTC93ZxfyUzIRkO3tSXw,3242
|
13
|
-
ultralytics_actions-0.0.
|
14
|
-
ultralytics_actions-0.0.
|
15
|
-
ultralytics_actions-0.0.
|
16
|
-
ultralytics_actions-0.0.
|
17
|
-
ultralytics_actions-0.0.
|
18
|
-
ultralytics_actions-0.0.
|
13
|
+
ultralytics_actions-0.0.99.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
14
|
+
ultralytics_actions-0.0.99.dist-info/METADATA,sha256=YU6rBmIePyaL-I1Nu05eeibaqtnivunWiYOCG5i5gfc,11973
|
15
|
+
ultralytics_actions-0.0.99.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
ultralytics_actions-0.0.99.dist-info/entry_points.txt,sha256=rvqr6Juj7lCJL1DQLwMmOrA8R2Q8tyR_dvCe0mYuJ8s,441
|
17
|
+
ultralytics_actions-0.0.99.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
18
|
+
ultralytics_actions-0.0.99.dist-info/RECORD,,
|
File without changes
|
{ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/entry_points.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.97.dist-info → ultralytics_actions-0.0.99.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|