INNER CODE UNIT · Python
ai_batch
wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:448
def ai_batch(failures):
if not ANTHROPIC_KEY or not failures:
return {}
if len(failures) > AI_MAX_CALLS:
print(
f"note: {len(failures)} failures exceeds the {AI_MAX_CALLS}-call cap; "
"this looks systemic, skipping AI triage",
file=sys.stderr,
)
return {}
try:
import anthropic
client = anthropic.Anthropic(api_key=ANTHROPIC_KEY)
except ImportError:
print("warn: anthropic SDK not installed; skipping AI triage", file=sys.stderr)
return {}
with ThreadPoolExecutor(max_workers=4) as pool: