sophhub 0.4.15 → 0.4.17
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.
package/package.json
CHANGED
|
@@ -235,19 +235,6 @@ def load_reference_image(path: str) -> dict[str, str]:
|
|
|
235
235
|
return {"mime_type": mime, "data": b64}
|
|
236
236
|
|
|
237
237
|
|
|
238
|
-
def strip_oss_signature(url: str) -> str:
|
|
239
|
-
if not url or "?" not in url:
|
|
240
|
-
return url
|
|
241
|
-
bare = url.split("?")[0]
|
|
242
|
-
try:
|
|
243
|
-
r = requests.head(bare, timeout=10, allow_redirects=True)
|
|
244
|
-
if r.status_code == 200:
|
|
245
|
-
return bare
|
|
246
|
-
except requests.RequestException:
|
|
247
|
-
pass
|
|
248
|
-
return url
|
|
249
|
-
|
|
250
|
-
|
|
251
238
|
# ---------------------------------------------------------------------------
|
|
252
239
|
# Prompt construction
|
|
253
240
|
# ---------------------------------------------------------------------------
|
|
@@ -377,7 +364,7 @@ def upload_b64_image(b64_data: str, ext: str = "png") -> str | None:
|
|
|
377
364
|
if not signed_url:
|
|
378
365
|
print("Warning: upload_oss returned no signed URL", file=sys.stderr)
|
|
379
366
|
return None
|
|
380
|
-
return
|
|
367
|
+
return signed_url
|
|
381
368
|
finally:
|
|
382
369
|
try:
|
|
383
370
|
os.unlink(tmp_path)
|