ActionExtractor
init
- action_pattern (str): The regex pattern to extract actions. (default: :obj:
"<Action>\\s*(.+)"
).
RLCardsEnv
init
- game_name (str): The name of the RLCard game to play.
- extractor (Optional[BaseExtractor]): Extractor to process LLM responses. If None, a default extractor with ActionExtractor will be used. (default: :obj:
None
) - max_steps (Optional[int]): Maximum steps per episode. (default: :obj:
None
) - num_players (int): Number of players in the game. (default: :obj:
2
) **kwargs: Additional environment parameters.
_get_initial_state
_get_next_observation
_get_terminal_observation
_is_done
_convert_to_rlcard_action
- action_str (str): The string representation of the action.
_format_state_for_observation
- state (Dict[str, Any]): The RLCard state dictionary.
_format_legal_actions
- legal_actions (List[Any]): The list of legal actions.
BlackjackEnv
init
- extractor (Optional[BaseExtractor]): Extractor to process LLM responses. If None, a default extractor will be used. (default: :obj:
None
) - max_steps (Optional[int]): Maximum steps per episode. (default: :obj:
None
) **kwargs: Additional environment parameters.
_convert_to_rlcard_action
- action_str (str): The string representation of the action. Expected to be ‘hit’ or ‘stand’.
_format_state_for_observation
- state (Dict[str, Any]): The RLCard state dictionary.
_format_legal_actions
- legal_actions (List[int]): The list of legal actions.
_format_cards
- cards (List[str]): List of card strings.
_calculate_hand_value
- cards (List[str]): List of card strings.
LeducHoldemEnv
init
- extractor (Optional[BaseExtractor]): Extractor to process LLM responses. If None, a default extractor will be used. (default: :obj:
None
) - max_steps (Optional[int]): Maximum steps per episode. (default: :obj:
None
) - num_players (int): Number of players in the game. (default: :obj:
2
) **kwargs: Additional environment parameters.
_convert_to_rlcard_action
- action_str (str): The string representation of the action. Expected to be ‘fold’, ‘check’, ‘call’, or ‘raise’.
_format_state_for_observation
- state (Dict[str, Any]): The RLCard state dictionary.
_format_legal_actions
- legal_actions (List[int]): The list of legal actions.
DoudizhuEnv
init
- extractor (Optional[BaseExtractor]): Extractor to process LLM responses. If None, a default extractor will be used. (default: :obj:
None
) - max_steps (Optional[int]): Maximum steps per episode. (default: :obj:
None
) **kwargs: Additional environment parameters.
_convert_to_rlcard_action
- action_str (str): The string representation of the action. Expected to be a card combination or ‘pass’.
_format_state_for_observation
- state (Dict[str, Any]): The RLCard state dictionary.
_format_legal_actions
- legal_actions (List[str]): The list of legal actions.
_format_cards
- cards (List[str]): List of card strings.