pub struct PyArcAgiClient { /* private fields */ }python only.Expand description
An HTTP client for interacting with the ARC-AGI-3 REST API.
Construct with ArcAgiClient() for a zero-configuration default that
reads credentials from the ARC_API_KEY and ARC_BASE_URL environment
variables, or supply keyword arguments to configure them explicitly. All
network methods are synchronous from Python’s perspective; they drive
an internal single-threaded Tokio runtime for each call.
§See Also
Implementations§
Source§impl PyArcAgiClient
impl PyArcAgiClient
Sourcepub fn new(
api_key: Option<String>,
base_url: Option<String>,
cookie_store: bool,
proxy: Option<String>,
) -> PyResult<Self>
pub fn new( api_key: Option<String>, base_url: Option<String>, cookie_store: bool, proxy: Option<String>, ) -> PyResult<Self>
Create a new ArcAgiClient.
Args:
api_key: Optional API key string. Falls back to ARC_API_KEY
environment variable and then to an empty string.
base_url: Optional server base URL. Falls back to ARC_BASE_URL
environment variable and then to
"https://three.arcprize.org".
cookie_store: Enable cookie persistence across requests
(default False).
proxy: Optional proxy URL, e.g. "socks5://127.0.0.1:9050".
Raises: RuntimeError: If the proxy URL is invalid or the HTTP client cannot be constructed.
Sourcepub fn get_anonymous_key(&self) -> PyResult<String>
pub fn get_anonymous_key(&self) -> PyResult<String>
Retrieve an anonymous API key from the server.
Returns: The anonymous API key string.
Raises: RuntimeError: On network or HTTP failure.
Sourcepub fn list_environments(&self) -> PyResult<Vec<PyEnvironmentInfo>>
pub fn list_environments(&self) -> PyResult<Vec<PyEnvironmentInfo>>
Return the list of all available game environments.
Returns:
A list of :class:EnvironmentInfo objects.
Raises: RuntimeError: On network or HTTP failure.
Sourcepub fn get_environment(&self, game_id: String) -> PyResult<PyEnvironmentInfo>
pub fn get_environment(&self, game_id: String) -> PyResult<PyEnvironmentInfo>
Return metadata for a single game environment.
Args:
game_id: The game identifier (e.g. "ls20").
Returns:
An :class:EnvironmentInfo object.
Raises: RuntimeError: If the game is not found or on network failure.
Sourcepub fn open_scorecard(
&self,
source_url: Option<String>,
tags: Option<Vec<String>>,
competition_mode: Option<bool>,
) -> PyResult<String>
pub fn open_scorecard( &self, source_url: Option<String>, tags: Option<Vec<String>>, competition_mode: Option<bool>, ) -> PyResult<String>
Create a new scorecard and return its ID.
Args:
source_url: Optional URL linking to the agent being evaluated.
tags: Optional list of classification tag strings.
competition_mode: When True, enables one-way competition semantics.
Returns:
The card_id string of the newly created scorecard.
Raises: RuntimeError: On network or HTTP failure.
Sourcepub fn get_scorecard(&self, card_id: String) -> PyResult<PyEnvironmentScorecard>
pub fn get_scorecard(&self, card_id: String) -> PyResult<PyEnvironmentScorecard>
Retrieve an existing scorecard by its ID.
Args: card_id: The scorecard identifier.
Returns:
An :class:EnvironmentScorecard object.
Raises: RuntimeError: If the scorecard is not found or on network failure.
Sourcepub fn close_scorecard(
&self,
card_id: String,
) -> PyResult<PyEnvironmentScorecard>
pub fn close_scorecard( &self, card_id: String, ) -> PyResult<PyEnvironmentScorecard>
Close and finalise a scorecard.
Args: card_id: The scorecard identifier.
Returns:
An :class:EnvironmentScorecard with the final scores.
Raises: RuntimeError: If the scorecard is not found or on network failure.
Sourcepub fn reset(
&self,
game_id: String,
scorecard_id: String,
guid: Option<String>,
seed: u32,
) -> PyResult<PyFrameData>
pub fn reset( &self, game_id: String, scorecard_id: String, guid: Option<String>, seed: u32, ) -> PyResult<PyFrameData>
Reset (or start) a game environment.
Args:
game_id: The game identifier.
scorecard_id: The scorecard to record this run under.
guid: Optional existing run GUID to re-use.
seed: Random seed for reproducible level ordering (default 0).
Returns:
A :class:FrameData object with the initial game state.
Raises: RuntimeError: On network or HTTP failure.
Sourcepub fn step(
&self,
game_id: String,
scorecard_id: String,
guid: String,
action_id: u32,
data: Option<&Bound<'_, PyDict>>,
reasoning: Option<&Bound<'_, PyDict>>,
) -> PyResult<PyFrameData>
pub fn step( &self, game_id: String, scorecard_id: String, guid: String, action_id: u32, data: Option<&Bound<'_, PyDict>>, reasoning: Option<&Bound<'_, PyDict>>, ) -> PyResult<PyFrameData>
Send one game action and receive the resulting frame.
Args:
game_id: The game identifier.
scorecard_id: The scorecard identifier.
guid: The run GUID from a prior :meth:reset call.
action_id: Numeric action ID (0 = RESET).
data: Optional dict of action data (e.g. {"x": 3, "y": 4}).
reasoning: Optional dict of freeform reasoning.
Returns:
A :class:FrameData object with the updated game state.
Raises: RuntimeError: On network or HTTP failure.
pub fn __repr__(&self) -> String
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for PyArcAgiClient
impl<'py> IntoPyObject<'py> for PyArcAgiClient
Source§type Target = PyArcAgiClient
type Target = PyArcAgiClient
Source§type Output = Bound<'py, <PyArcAgiClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyArcAgiClient as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for PyArcAgiClient
impl PyClass for PyArcAgiClient
Source§impl PyClassImpl for PyArcAgiClient
impl PyClassImpl for PyArcAgiClient
Source§const MODULE: Option<&str> = ::core::option::Option::None
const MODULE: Option<&str> = ::core::option::Option::None
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// An HTTP client for interacting with the ARC-AGI-3 REST API.
///
/// Construct with ``ArcAgiClient()`` for a zero-configuration default that
/// reads credentials from the ``ARC_API_KEY`` and ``ARC_BASE_URL`` environment
/// variables, or supply keyword arguments to configure them explicitly. All
/// network methods are **synchronous** from Python's perspective; they drive
/// an internal single-threaded Tokio runtime for each call.
///
/// # See Also
///
/// - [ARC-AGI-3 Reference](https://arcprize.org/arc-agi/3)
const RAW_DOC: &'static CStr = /// An HTTP client for interacting with the ARC-AGI-3 REST API. /// /// Construct with ``ArcAgiClient()`` for a zero-configuration default that /// reads credentials from the ``ARC_API_KEY`` and ``ARC_BASE_URL`` environment /// variables, or supply keyword arguments to configure them explicitly. All /// network methods are **synchronous** from Python's perspective; they drive /// an internal single-threaded Tokio runtime for each call. /// /// # See Also /// /// - [ARC-AGI-3 Reference](https://arcprize.org/arc-agi/3)
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<PyArcAgiClient as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<PyArcAgiClient>
type Layout = <<PyArcAgiClient as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<PyArcAgiClient>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for PyArcAgiClient
impl PyClassNewTextSignature for PyArcAgiClient
const TEXT_SIGNATURE: &'static str = "(api_key=None, base_url=None, cookie_store=False, proxy=None)"
Source§impl PyMethods<PyArcAgiClient> for PyClassImplCollector<PyArcAgiClient>
impl PyMethods<PyArcAgiClient> for PyClassImplCollector<PyArcAgiClient>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyArcAgiClient
impl PyTypeInfo for PyArcAgiClient
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for PyArcAgiClient
impl ExtractPyClassWithClone for PyArcAgiClient
Auto Trait Implementations§
impl Freeze for PyArcAgiClient
impl !RefUnwindSafe for PyArcAgiClient
impl Send for PyArcAgiClient
impl Sync for PyArcAgiClient
impl Unpin for PyArcAgiClient
impl UnsafeUnpin for PyArcAgiClient
impl !UnwindSafe for PyArcAgiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.