Skip to main content

fish-agents

Baseline agents for Fish, a six-player team card game of asking, deduction and calls, and the interface they share, from the Fish benchmark.

  • Agent: an agent is any object with act(view, rng) -> int. It sees only its own seat's view and draws its randomness from the generator it is given, so games replay exactly.
  • B0 (b0-v1): plays uniformly at random among its legal actions, except that in a declaration window it passes all but 1 time in 100.
  • play_game(agents, seed) plays one game with six agents and returns its record (needs the env extra).
  • Memory: Remembering(agent, setting) gives an agent with act(view, memory, rng) full, last-k or no memory of the events it has been shown, and exactly what it can deduce from them.
from fish_agents.b0 import B0
from fish_agents.play import play_game

record = play_game([B0()] * 6, 42)
print("winner: team", record["winner"])

An agent with memory: it asks for a card whenever what it remembers proves the target holds it, and otherwise plays as B0. With full memory it beats three B0s more often than not:

from fish_agents.b0 import B0
from fish_agents.memory import FULL, Memory, Remembering
from fish_agents.play import play_game
from fish_rules.action_index import decode
from fish_rules.events import Ask
from fish_rules.rng import SplitMix64
from fish_rules.view import PlayerView


class Sure:
    """Asks for a card whenever Layer 1 says the target certainly holds it; otherwise B0."""

    def act(self, view: PlayerView, memory: Memory, rng: SplitMix64) -> int:
        for index in view.legal:
            action = decode(view.seat, index, view.phase)
            if isinstance(action, Ask) and memory.deduction.known(action.card) == action.target:
                return index
        return B0().act(view, rng)


games = [play_game([Remembering(Sure(), FULL)] * 3 + [B0()] * 3, seed) for seed in range(20)]
print("Sure won", sum(game["winner"] == 0 for game in games), "of 20 games against B0")

Install with pip install "fish-agents[env]" (Python 3.14 or later), or pip install fish-agents for the interface and agents alone. Stronger baselines (B1 to B3) come in later releases. Documentation is in the repository.

Licensed under Apache-2.0.

Metadata

Release files for fish-agents 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fish-agents 0.2.0
File Size Uploaded Provenance Actions
fish_agents-0.2.0.tar.gz 12.0 kB Without provenance Details for fish_agents-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fish-agents 0.2.0
File Interpreter ABI Platform Actions
fish_agents-0.2.0-py3-none-any.whl Python 3 none any Details for fish_agents-0.2.0-py3-none-any.whl

Total release size: 26.0 kB

Release files / fish_agents-0.2.0.tar.gz

Download URL fish_agents-0.2.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
493b9aee5898ebf7db571c7221031b0a911e9d432c4810bcb409ed82dff1d9a1
BLAKE2b-256 checksum
How to use checksums
b2dcc111027baa590cf2692b92061903f1f705b7dd01c0644bb6d7b53f2a1014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fish_agents-0.2.0-py3-none-any.whl

Download URL fish_agents-0.2.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a12282f2e031e10fe7d8ce4f16bd05c39ad6f424bc13064760d74ce828b9ccef
BLAKE2b-256 checksum
How to use checksums
11a69f80a68a9a2fb92ab354c7dd25a43cd38df72391361ac5db07a14917b42c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fish-agents 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page