agilerl-arena 1.43.0
Basename is uppercase README.mdCalls glob for filename search
SHA-2568d6c75165c370e89f36a2504a8d055bcee0ea8a80bb53c4947e99016a375b62f
Evidence
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4from __future__ import annotations
5
6from typing import TYPE_CHECKING
7
8import lazy_loader as lazy
9
10from agilerl.arena.models import AgentType
11
12if TYPE_CHECKING:
13 from rich.console import Console
14
15 from agilerl.arena.client import ArenaClient
16 from agilerl.arena.inference import Agent
17
18 console: Console
⋯9 lines
28)
29
30__all__ = ["Agent", "AgentType", "ArenaClient", "console", "error_console"]
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4"""Rich consoles and logging setup for the CLI.
5
6Kept out of ``agilerl.arena.__init__`` so importing the manifest contract does
7not pull in rich or install a log handler as a side effect: the platform's
8submit preflight imports ``agilerl.arena.models`` and nothing else.
9"""
10
11from __future__ import annotations
12
13import logging
14
15from rich.console import Console
16from rich.logging import RichHandler
17
18console = Console()
19error_console = Console(stderr=True)
20
21_logger = logging.getLogger("agilerl.arena")
⋯7 lines
29 _logger.propagate = False
30
31logging.getLogger("httpx").setLevel(logging.WARNING)
32logging.getLogger("httpcore").setLevel(logging.WARNING)
1# Copyright 2026 AgileRL
2# SPDX-License-Identifier: Apache-2.0
3
4from __future__ import annotations
5
6import base64
7import binascii
8import json
9import logging
10import os
11import stat
12import time
13import webbrowser
14from pathlib import Path
15from typing import Any
16
17from keycloak import KeycloakOpenID
18from keycloak.exceptions import KeycloakError
19
20from agilerl.arena.exceptions import ArenaAuthError, ArenaTimeoutError
21
22logger = logging.getLogger(__name__)
23
24EXTERNAL_USER_ID_HEADER = "X-External-User-Id"
25_DEFAULT_ …
50:13… ccess_token or "." not in access_token:
51 return None
52 try:
53 _h, payload_b64, *_rest = access_token.split(".")
54 pad = "=" * (-len(payload_b64) % 4)
55 raw = base64.urlsafe_b64decode(payload_b64 + pad)
56 payload = json.loads(raw.decode("utf-8"))
57 exp = payload.get("exp")
58 if exp is None:
59 return None
60 return float(exp) …
94:10… ad the raw JSON object from the credentials file (no token validation).
95
96 Used when merging OAuth tokens with other persisted keys.
97 Deployment bindings live in ``~/.arena/inference.json``.
98
99 :param credentials_path: The path to the credentials file.
100 :type credentials_path: Path | os.PathLike …
Showing the top 5 files — 7 more files (130 regions) not shown.