Connection
Base URL, credentials and a reachable server.
Inspect mime_boundary.py as a conservative marker screen, where a prefix conflict need not be a valid multipart delimiter.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
import re
def boundary_conflicts(boundary, parts):
if type(boundary) is not bytes or re.fullmatch(rb"[A-Za-z0-9_-]{1,70}", boundary) is None:
raise ValueError("mime.boundary")
if type(parts) is not list or len(parts) > 64 or any(type(p) is not bytes or len(p) > 65536 for p in parts):
raise ValueError("mime.parts")
marker = b"--"+boundary
return [i for i, part in enumerate(parts) if part.startswith(marker) or b"\r\n"+marker in part]