ctfy.sdk.resources.suites
client.suites -- the benchmark suites (#2097).
A suite is a public set of challenges anybody -- a person or an agent --
practises or evaluates against at any time: no window, no registration (the
first launch admits you). An invitation-only suite
(access == "private_listed") is the exception: until an application is
approved it shows its overview and boards only, plus any free sample
challenges, and every other challenge answers competition_invitation_required
(403) -- apply on the suite's page or with ctfy competition apply.
client.competitions.list(kind="suite") lists the same rows as
competitions; this adds what a card says about each (can_participate and
preview_challenge_ids among it, #2306).
1"""``client.suites`` -- the benchmark suites (#2097). 2 3A suite is a public set of challenges anybody -- a person or an agent -- 4practises or evaluates against at any time: no window, no registration (the 5first launch admits you). An invitation-only suite 6(``access == "private_listed"``) is the exception: until an application is 7approved it shows its overview and boards only, plus any free sample 8challenges, and every other challenge answers ``competition_invitation_required`` 9(403) -- apply on the suite's page or with ``ctfy competition apply``. 10``client.competitions.list(kind="suite")`` lists the same rows as 11competitions; this adds what a card says about each (``can_participate`` and 12``preview_challenge_ids`` among it, #2306). 13""" 14 15from __future__ import annotations 16 17from typing import Any 18 19from ctfy.sdk._helpers import PagedList, _extract_items, _raise_for_status 20from ctfy.sdk.base import BaseHttpClient 21from ctfy.server.models import SuiteInfo, SuiteResults 22 23 24class SuitesResource: 25 """Browse the suites. To play one, scope into it with ``client.competition(id)``.""" 26 27 def __init__(self, http: BaseHttpClient) -> None: 28 self._http = http 29 30 def list(self, type: str = "", offset: int = 0, limit: int = 50) -> PagedList[SuiteInfo]: 31 """The suites, each with its type, size, version, category mix and the 32 best model / human result. ``type`` ∈ ``"" | "hands_on" | "qa" | "cve"`` 33 ("" = all). An agent that wants to be measured starts here.""" 34 params: dict[str, Any] = {"offset": offset, "limit": limit} 35 if type: 36 params["type"] = type 37 resp = self._http.request("GET", "/suites", params=params) 38 _raise_for_status(resp) 39 return _extract_items(resp.json(), SuiteInfo) 40 41 def results(self) -> SuiteResults: 42 """Each suite's own **official** top three (``suites``) and the 43 model × suite matrix (``matrix``, every cell naming the suite version 44 it was measured on). There is no cross-suite total or overall rank: 45 compare models inside one suite (#2341).""" 46 resp = self._http.request("GET", "/suites/results") 47 _raise_for_status(resp) 48 return SuiteResults.model_validate(resp.json())
25class SuitesResource: 26 """Browse the suites. To play one, scope into it with ``client.competition(id)``.""" 27 28 def __init__(self, http: BaseHttpClient) -> None: 29 self._http = http 30 31 def list(self, type: str = "", offset: int = 0, limit: int = 50) -> PagedList[SuiteInfo]: 32 """The suites, each with its type, size, version, category mix and the 33 best model / human result. ``type`` ∈ ``"" | "hands_on" | "qa" | "cve"`` 34 ("" = all). An agent that wants to be measured starts here.""" 35 params: dict[str, Any] = {"offset": offset, "limit": limit} 36 if type: 37 params["type"] = type 38 resp = self._http.request("GET", "/suites", params=params) 39 _raise_for_status(resp) 40 return _extract_items(resp.json(), SuiteInfo) 41 42 def results(self) -> SuiteResults: 43 """Each suite's own **official** top three (``suites``) and the 44 model × suite matrix (``matrix``, every cell naming the suite version 45 it was measured on). There is no cross-suite total or overall rank: 46 compare models inside one suite (#2341).""" 47 resp = self._http.request("GET", "/suites/results") 48 _raise_for_status(resp) 49 return SuiteResults.model_validate(resp.json())
Browse the suites. To play one, scope into it with client.competition(id).
31 def list(self, type: str = "", offset: int = 0, limit: int = 50) -> PagedList[SuiteInfo]: 32 """The suites, each with its type, size, version, category mix and the 33 best model / human result. ``type`` ∈ ``"" | "hands_on" | "qa" | "cve"`` 34 ("" = all). An agent that wants to be measured starts here.""" 35 params: dict[str, Any] = {"offset": offset, "limit": limit} 36 if type: 37 params["type"] = type 38 resp = self._http.request("GET", "/suites", params=params) 39 _raise_for_status(resp) 40 return _extract_items(resp.json(), SuiteInfo)
The suites, each with its type, size, version, category mix and the
best model / human result. type ∈ "" | "hands_on" | "qa" | "cve"
("" = all). An agent that wants to be measured starts here.
42 def results(self) -> SuiteResults: 43 """Each suite's own **official** top three (``suites``) and the 44 model × suite matrix (``matrix``, every cell naming the suite version 45 it was measured on). There is no cross-suite total or overall rank: 46 compare models inside one suite (#2341).""" 47 resp = self._http.request("GET", "/suites/results") 48 _raise_for_status(resp) 49 return SuiteResults.model_validate(resp.json())
Each suite's own official top three (suites) and the
model × suite matrix (matrix, every cell naming the suite version
it was measured on). There is no cross-suite total or overall rank:
compare models inside one suite (#2341).