minimax-h3-prompt-rewriter 0.27.1
GitHub Actions workflow definition pathJinja2 immutable sandbox environment import
SHA-2561af9965df2d8a9df200fdec69fd377fb6dea7c41e2c4607da212ac54afea44fb
Evidence
30:10… -- see ``runner._adopt``.
31"""
32
33from __future__ import annotations
34
35import base64
36import json
37import logging
38import os
39import socket
40import threading
41import time
42import urllib.error
43import urllib.request
44
45from . import devices, runner
46
47log = logging.getLogger(__name__)
48
49HOST = "127.0.0.1"
50
51STARTUP_SECONDS = 900.0
⋯4 lines
56STDERR_KEEP = 80
57
58MEDIA_TYPE = {".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg",
59 ".webp": "image/webp", ".gif": "image/gif", ".bmp": "image/bmp"}
60
61CHOICE_ENV = "MINIMAX_ …
75:20… k that does not involve editing the pack.
76 """
77 choice = (os.environ.get(CHOICE_ENV) or AUTO).strip().lower()
78 if choice == NEVER:
79 return False
80 if choice == ALWAYS:
81 return True
97:63… race that can be
98 narrowed and not closed.
99 """
100 with socket.socket() as sock:
101 sock.bind((HOST, 0))
102 return int(sock.getsockname()[1])
103
104
105def _data_uri(path: str) -> str:
106 kind = MEDIA_TYPE.get(os.path.splitext(path)[1].lower(), "image/png")
107 with open(path, "rb") as handle:
108 return f"data:{kind};base64," + base64.b64encode(handle.read()).decode("ascii")
109
110
111def content_parts(instruction: str, attachments: list[tuple[str, str]]) -> list[dict]:
112 """ …
119:26… achments:
120 if kind == "image":
121 parts.append({"type": "image_url", "image_url": {"url": _data_uri(path)}})
122 elif kind == "audio":
123 with open(path, "rb") as handle: …
189:2… if system_prompt:
190 messages.append({"role": "system", "content": system_prompt})
191 messages.append({"role": "user", "content": content_parts(instruction, attachments)})
192
193 body = {
194 …
Showing the top 5 files — 7 more files (110 regions) not shown.
No evidence locations were recorded for this file. Raw result