aisysprojserver_clienttools package

Submodules

aisysprojserver_clienttools.admin module

class aisysprojserver_clienttools.admin.AdminClient(url: str, password: str | None = None)

Bases: object

add_env_to_group(group: str, env: str) tuple[int, Any]
add_subgroup_to_group(group: str, subgroup: str) tuple[int, Any]
delete_group(group: str) tuple[int, Any]
classmethod from_file(path: Path) AdminClient
get_agent_results(env: str | None = None)
get_envs()
make_env(env_class: str, identifier: str, display_name: str, config: Any = {}, overwrite: bool = False) tuple[int, Any]
make_group(identifier: str, title: str, description: str, overwrite: bool = False) tuple[int, Any]
new_user(env: str, user: str, overwrite: bool = False) tuple[int, Any]
print_diskusage()
print_errors()
remove_nonrecent_runs(just_vacuum: bool = False)
remove_unused_agents(env: str)
send_request(path: str, **kwargs) tuple[int, Any]

Overwritten for integration tests

upload_plugin(package: Path | str)

aisysprojserver_clienttools.client module

A Python implementation of the AISysProj server protocol.

If you want to do the protocol implementation yourself, there is also a simplified client implementation, which should be much easier to understand.

You can find client implementations here: https://aisysprojserver.readthedocs.io/en/latest/clients.html

class aisysprojserver_clienttools.client.Action

Bases: dict

act_no: int
action: Any
run: str
class aisysprojserver_clienttools.client.ActionRequest

Bases: dict

act_no: int
percept: Any
run: str
class aisysprojserver_clienttools.client.Agent(run_id: str, agent_config: AgentConfig)

Bases: ABC

abstract get_action(percept: Any, request_info: RequestInfo) Any
get_run_url() str
on_finish(outcome: Any)
on_message(content: str, type: str)
classmethod run(agent_config_file: str | Path | AgentConfig, *, parallel_runs: bool = True, multiprocessing: bool = False, abandon_old_runs: bool = False, run_limit: int | None = None)
class aisysprojserver_clienttools.client.AgentConfig

Bases: dict

agent: str
env: str
pwd: str
url: str
class aisysprojserver_clienttools.client.AgentProcess(agent_class: type[Agent])

Bases: object

finish_run(outcome: Any)
get_response()
new_run(run_id: str, agent_config: AgentConfig)
send_action_request(percept: Any, request_info: RequestInfo)
send_command(command: str, *args)
send_message(content: str, type: str)
stop()
class aisysprojserver_clienttools.client.Message

Bases: dict

content: str
run: str | None
type: Literal['info', 'warning', 'error']
class aisysprojserver_clienttools.client.MultiProcessAgentRequestProcessor(agent_class: type[Agent], agent_config: AgentConfig)

Bases: RequestProcessor

close()
on_finished_run(run_id: str, url: str, outcome: Any)
on_message(message: Message)
process_requests(requests: list[tuple[Any, RequestInfo]], counter: _RunTracker) list[Action]
class aisysprojserver_clienttools.client.RequestInfo(run_url: str, action_number: int, run_id: str)

Bases: object

action_number: int
run_id: str
run_url: str
class aisysprojserver_clienttools.client.RequestProcessor

Bases: ABC

close()
on_finished_run(run_id: str, url: str, outcome: Any)
on_message(message: Message)
on_new_run(run_id: str)
abstract process_requests(requests: list[tuple[Any, RequestInfo]], counter: _RunTracker) list[Action]
class aisysprojserver_clienttools.client.SequentialAgentRequestProcessor(agent_class: type[Agent], agent_config: AgentConfig)

Bases: RequestProcessor

on_finished_run(run_id: str, url: str, outcome: Any)
on_message(message: Message)
process_requests(requests: list[tuple[Any, RequestInfo]], counter: _RunTracker) list[Action]
class aisysprojserver_clienttools.client.ServerResponse

Bases: dict

action_requests: list[ActionRequest]
active_runs: list[str]
finished_runs: dict[str, Any]
messages: list[Message]
class aisysprojserver_clienttools.client.SimpleRequestProcessor(action_function: Callable[[Any, RequestInfo], Any], processes: int = 1)

Bases: RequestProcessor

close()
process_requests(requests: list[tuple[Any, RequestInfo]], counter: _RunTracker) list[Action]
aisysprojserver_clienttools.client.get_run_url(agent_config: AgentConfig, run_id: str) str
aisysprojserver_clienttools.client.run(agent_config_file: str | Path | AgentConfig, agent: Callable[[Any, RequestInfo], Any], *, parallel_runs: bool = True, processes: int = 1, run_limit: int | None = None, abandon_old_runs: bool = False)
aisysprojserver_clienttools.client.send_request(config: AgentConfig, actions: list[Action], *, to_abandon: list[str] | None = None, parallel_runs: bool = True) ServerResponse

aisysprojserver_clienttools.client_simple_v0 module

To use this implementation, you simply have to implement get_action such that it returns a legal action. You can then let your agent compete on the server by calling

python3 client_simple_v0.py path/to/your/config.json

aisysprojserver_clienttools.client_simple_v0.get_action(percept)
aisysprojserver_clienttools.client_simple_v0.run(config_file, action_function, parallel_runs=True)

aisysprojserver_clienttools.client_simple_v1 module

To use this implementation, you simply have to implement get_action such that it returns a legal action. You can then let your agent compete on the server by calling

python3 client_simple_v1.py path/to/your/config.json

aisysprojserver_clienttools.client_simple_v1.get_action(percept)
aisysprojserver_clienttools.client_simple_v1.run(config_file, action_function, parallel_runs=True)

aisysprojserver_clienttools.upload_plugin module

aisysprojserver_clienttools.upload_plugin.upload_plugin(client: AdminClient, package: Path | str)

Module contents