Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoodStartLabs/AI_Diplomacy
/ functions
Functions
2,689 in github.com/GoodStartLabs/AI_Diplomacy
⨍
Functions
2,689
◇
Types & classes
474
↓ 15 callers
Method
get
Return game instance associated to given power name.
diplomacy/client/game_instances_set.py:47
↓ 15 callers
Method
getPage
()
diplomacy/web/src/gui/pages/content_games.jsx:53
↓ 15 callers
Method
get_next_value
Get lowest value in sorted set greater than given element, or None if such values does not exists in the sorted set. Given element may no
diplomacy/utils/sorted_set.py:110
↓ 15 callers
Method
get_previous_value
Get greatest value in sorted set less the given element, or None if such value does not exists in the sorted set. Given element may not e
diplomacy/utils/sorted_set.py:124
↓ 15 callers
Method
is_player_game
Return True if this game is a player game.
diplomacy/engine/game.py:509
↓ 14 callers
Method
add_journal_entry
Adds a formatted entry string to the agent's private journal.
ai_diplomacy/agent.py:355
↓ 14 callers
Method
get_units
Retrieves the list of units for a power or for all powers :param power_name: Optional. The name of the power (e.g. ``'FRANCE'``) or None
diplomacy/engine/game.py:920
↓ 14 callers
Method
size
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:86
↓ 13 callers
Method
__init__
Builds the response
diplomacy/daide/notifications.py:376
↓ 13 callers
Method
__init__
Constructor
diplomacy/daide/requests.py:150
↓ 13 callers
Method
__init__
(self, **kwargs)
diplomacy/communication/notifications.py:138
↓ 13 callers
Method
_occupant
Finds the occupant of a site :param site: The site name (e.g. "STP") :param any_coast: Boolean to indicate to return unit on
diplomacy/engine/game.py:3635
↓ 13 callers
Method
add_rule
Adds a rule to the current rule list :param rule: Name of rule to add (e.g. 'NO_PRESS') :return: Nothing
diplomacy/engine/game.py:1358
↓ 13 callers
Method
clear_orders
Clears the power's orders :param power_name: Optional. The name of the power to clear (e.g. 'FRANCE') or will clear orders for
diplomacy/engine/game.py:1308
↓ 13 callers
Method
get_hash
Returns the zobrist hash for the current game
diplomacy/engine/game.py:1531
↓ 13 callers
Function
get_prompt_path
Get the appropriate prompt path based on USE_UNFORMATTED_PROMPTS setting. Args: prompt_name: Base name of the prompt file (e.g., "convers
ai_diplomacy/utils.py:503
↓ 13 callers
Method
validate
(self, element)
diplomacy/utils/parsing.py:295
↓ 12 callers
Method
clear_centers
Removes ownership of supply centers :param power_name: Optional. The name of the power whose centers will be cleared (e.g. 'FRANCE'),
diplomacy/engine/game.py:1296
↓ 12 callers
Method
get_centers
Retrieves the list of owned supply centers for a power or for all powers :param power_name: Optional. The name of the power (e.g. 'FRANC
diplomacy/engine/game.py:942
↓ 12 callers
Method
get_order_status
Returns a list or a dict representing the order status ('', 'no convoy', 'bounce', 'void', 'cut', 'dislodged', 'disrupted') for orders su
diplomacy/engine/game.py:1041
↓ 12 callers
Method
isEliminated
()
diplomacy/web/src/diplomacy/engine/power.js:50
↓ 12 callers
Method
json
Convert this object to a JSON string ready to be sent/saved. :return: string
diplomacy/utils/jsonable.py:84
↓ 12 callers
Function
next_time_at
Returns the next timestamp at a specific 'hh:mm' :param timestamp: The unix timestamp to convert :param time_at: The next 'hh:mm' to
diplomacy/utils/time.py:68
↓ 12 callers
Function
trunc_time
Truncates time at a specific interval (e.g. 20M) (i.e. Rounds to the next :20, :40, :60) :param timestamp: The unix epoch to truncate (e.g.
diplomacy/utils/time.py:49
↓ 12 callers
Function
yScale
(count: number)
ai_animation/src/components/rotatingDisplay.ts:232
↓ 11 callers
Method
__init__
(self, key)
diplomacy/utils/exceptions.py:38
↓ 11 callers
Method
abut_list
Returns the adjacency list for the site :param site: The province we want the adjacency list for :param incl_no_coast: Boole
diplomacy/engine/map.py:1243
↓ 11 callers
Method
clear_cache
Clears all caches
diplomacy/engine/game.py:1324
↓ 11 callers
Method
createButton
(title, fn, color, large)
diplomacy/web/src/gui/components/forms.jsx:66
↓ 11 callers
Method
get
()
diplomacy/web/src/diplomacy/utils/queue.js:41
↓ 11 callers
Method
getValue
(fieldValues, fieldName, defaultValue)
diplomacy/web/src/gui/components/forms.jsx:54
↓ 11 callers
Method
load
()
diplomacy/web/src/gui/utils/dipStorage.jsx:35
↓ 11 callers
Method
start
* Start the event queue with current time as reference
ai_animation/src/events.ts:45
↓ 11 callers
Method
success
(message)
diplomacy/web/src/gui/pages/page.jsx:185
↓ 10 callers
Method
_get_unit_center
Compute coordinates of unit center. :param loc: unit location :param is_dislodged: boolean to tell if unit is dislodged
diplomacy/engine/renderer.py:791
↓ 10 callers
Method
close
()
diplomacy/web/src/diplomacy/client/connection.js:350
↓ 10 callers
Method
count_controlled_powers
Return the number of controlled map powers.
diplomacy/engine/game.py:566
↓ 10 callers
Method
filter_phase_data
Return a filtered version of given phase data for given gam role. :param phase_data: GamePhaseData object to filter. :param
diplomacy/server/server_game.py:76
↓ 10 callers
Function
getUnitCenter
(coordinates, symbolSizes, loc, isDislodged)
diplomacy/web/src/gui/maps/common/common.js:65
↓ 10 callers
Function
get_unit_at_location
Returns the full unit string (e.g., 'A PAR (FRA)') if a unit is at the location, else None.
ai_diplomacy/possible_order_context.py:118
↓ 10 callers
Method
has
(role)
diplomacy/web/src/diplomacy/client/game_instance_set.js:30
↓ 10 callers
Method
notify_game_addresses
Notify addresses of a game with a notification. Game ID is automatically provided to notification. Token and game role are au
diplomacy/server/notifier.py:348
↓ 10 callers
Method
put
(key, value)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:39
↓ 10 callers
Function
run_llm_and_log
Calls `client.generate_response` with robust retry logic and returns the raw output. This function handles exceptions gracefully: - It r
ai_diplomacy/utils.py:408
↓ 10 callers
Method
set_centers
Transfers supply centers ownership :param power_name: The name of the power who will control the supply centers (e.g. 'FRANCE')
diplomacy/engine/game.py:1188
↓ 10 callers
Method
set_status
Set game status with given status (should be in diplomacy.utils.strings.ALL_GAME_STATUSES).
diplomacy/engine/game.py:751
↓ 9 callers
Method
_get_phase
(self, phase_name: str)
ai_diplomacy/game_history.py:94
↓ 9 callers
Method
_notify
Register a notification to send. :param notification: a notification instance. :type notification: notifications._AbstractNo
diplomacy/server/notifier.py:75
↓ 9 callers
Function
assert_equals
Checks that expect == computed.
diplomacy/utils/tests/test_common.py:32
↓ 9 callers
Function
assert_game_not_finished
Check if given game is not yet completed or canceled, otherwise raise a GameFinishedException. :param server_game: server game to check
diplomacy/server/request_manager_utils.py:284
↓ 9 callers
Method
builder
Return a function to build sorted sets from content (sequence of values). Returned function expects a content parameter like SortedSet in
diplomacy/utils/sorted_set.py:42
↓ 9 callers
Method
generate_response
( self, prompt: str, temperature: float = 0.0, inject_random_seed: bool = True
ai_diplomacy/clients.py:802
↓ 9 callers
Method
getID
(identifiers)
diplomacy/web/src/gui/utils/province.js:122
↓ 9 callers
Function
getRequiredElement
* Helper function to get a DOM element by ID and throw an error if not found * @param id The element ID to search for * @returns The HTMLElement *
ai_animation/src/domElements.ts:12
↓ 9 callers
Method
has_token
Return True if users have given token.
diplomacy/server/users.py:86
↓ 9 callers
Method
is_controlled
Return True if given power name is currently controlled. :param power_name: power name :type power_name: str :rt
diplomacy/engine/game.py:533
↓ 9 callers
Method
is_controlled_by
(for server game) Return True if given power name is controlled by given username.
diplomacy/server/server_game.py:231
↓ 9 callers
Method
loadGames
(messages)
diplomacy/web/src/gui/pages/page.jsx:116
↓ 9 callers
Method
norm
Normalise a sentence (add spaces before /, replace -+, with ' ', remove .: :param phrase: Phrase to normalise :return: Norma
diplomacy/engine/map.py:830
↓ 9 callers
Method
save
()
diplomacy/web/src/gui/utils/dipStorage.jsx:53
↓ 9 callers
Method
to_type
(self, json_value)
diplomacy/utils/parsing.py:421
↓ 9 callers
Method
update
(self, element)
diplomacy/utils/parsing.py:217
↓ 9 callers
Method
validate
(self, element)
diplomacy/utils/parsing.py:214
↓ 8 callers
Method
__get_orders
* Return a dictionary of local orders for given game engine. * Returned dictionary maps each power name to either: * - a dictionary of order
diplomacy/web/src/gui/pages/content_game.jsx:546
↓ 8 callers
Method
_notify_game
Send a game notification. Game token, game ID and game role will be automatically provided to notification object. :param se
diplomacy/server/notifier.py:89
↓ 8 callers
Method
add_diary_entry
Adds a formatted entry to both the permanent and context diaries.
ai_diplomacy/agent.py:363
↓ 8 callers
Function
assertLength
(expected, given)
diplomacy/web/src/gui/utils/order_building.js:19
↓ 8 callers
Function
cleanProvince
(province: string)
ai_animation/src/types/unitOrders.ts:3
↓ 8 callers
Method
createRow
(label, input)
diplomacy/web/src/gui/components/forms.jsx:90
↓ 8 callers
Method
done
()
diplomacy/web/src/diplomacy/utils/future.js:52
↓ 8 callers
Method
drop
Drop a place :param place: Name of place to remove :return: Nothing
diplomacy/engine/map.py:767
↓ 8 callers
Method
find_next_phase
Returns the long name of the phase coming immediately after the phase :param phase: The long name of the current phase (e.g. SPRING 1905
diplomacy/engine/map.py:1268
↓ 8 callers
Function
getClickedID
(event)
diplomacy/web/src/gui/maps/common/common.js:37
↓ 8 callers
Function
getRequiredTypedElement
* Helper function to get a typed DOM element by ID and throw an error if not found * @param id The element ID to search for * @returns The typed HTM
ai_animation/src/domElements.ts:26
↓ 8 callers
Function
get_type
Return a ParserType sub-class that matches given type. :param desired_type: basic type or ParserType sub-class. :return: ParserType
diplomacy/utils/parsing.py:71
↓ 8 callers
Method
has_token
Return True if game has given token (either observer, omniscient or player).
diplomacy/server/server_game.py:298
↓ 8 callers
Method
info
(msg)
diplomacy/web/src/diplomacy/utils/diplog.js:27
↓ 8 callers
Function
log_llm_response_async
Async version of log_llm_response that runs in a thread pool.
ai_diplomacy/utils.py:590
↓ 8 callers
Method
merge
Transfer all units, centers, and homes of the other_power to this power :param other_power: The other power (will be empty after the mer
diplomacy/engine/power.py:239
↓ 8 callers
Function
parseLocation
(txt)
diplomacy/web/src/gui/maps/common/common.js:45
↓ 8 callers
Function
setInfluence
(classes, mapData, loc, power_name)
diplomacy/web/src/gui/maps/common/common.js:25
↓ 8 callers
Function
showMomentModal
(options: MomentDialogueOptions)
ai_animation/src/components/momentModal.ts:25
↓ 8 callers
Method
to_json
(self, raw_value)
diplomacy/utils/parsing.py:425
↓ 8 callers
Method
token_is_master
Return True if given token is a master token for given game data. :param token: token :param server_game: game data
diplomacy/server/server.py:803
↓ 8 callers
Method
validate
(self, element)
diplomacy/utils/parsing.py:505
↓ 7 callers
Method
__init__
( self, model_name: str, prompts_dir: Optional[str] = None, base_url: Optional
ai_diplomacy/clients.py:785
↓ 7 callers
Method
_is_moving_via_convoy
Determines if a unit is moving via a convoy or through land :param unit: The name of the unit (e.g. 'A PAR') :return: A bool
diplomacy/engine/game.py:1979
↓ 7 callers
Method
default_coast
Returns the coast for a fleet move order that can only be to a single coast (e.g. F GRE-BUL returns F GRE-BUL/SC) :param wor
diplomacy/engine/map.py:1106
↓ 7 callers
Method
find_coasts
Finds all coasts for a given location :param loc: The name of a location (e.g. 'BUL') :return: Returns the list of all coast
diplomacy/engine/map.py:1126
↓ 7 callers
Function
generate_random_seed
(n_lines: int = 5, n_chars_per_line: int = 80)
ai_diplomacy/utils.py:496
↓ 7 callers
Method
get_controller
(Network Method) Return current power controller name ('dummy' if power is not controlled).
diplomacy/engine/power.py:376
↓ 7 callers
Method
get_expected_controls_count
Return the number of map powers expected to be controlled in this game. This number is either specified in settings or the number of map
diplomacy/engine/game.py:574
↓ 7 callers
Method
get_game
Return game saved on server matching given game ID. Raise an exception if game ID not found. Return game if already loaded on
diplomacy/server/server.py:670
↓ 7 callers
Method
get_orderable_locations
Find the location requiring an order for a power (or for all powers) :param power_name: Optionally, the name of the power (e.g. 'FRANCE'
diplomacy/engine/game.py:995
↓ 7 callers
Method
has_admin
Return True if given username is an administrator.
diplomacy/server/users.py:82
↓ 7 callers
Method
has_observer_token
Return True if game has given observer token.
diplomacy/server/server_game.py:303
↓ 7 callers
Method
has_omniscient_token
Return True if game has given omniscient observer token.
diplomacy/server/server_game.py:307
↓ 7 callers
Method
indexOf
(key)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:74
↓ 7 callers
Method
last_key
Get the highest key from the dict.
diplomacy/utils/sorted_dict.py:126
↓ 7 callers
Method
norm_power
Normalise the name of a power (removes spaces) :param power: Name of power to normalise :return: Normalised power name
diplomacy/engine/map.py:822
← previous
next →
101–200 of 2,689, ranked by callers