Download classes.py from CazC/Tacklebox: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/CazC/Tacklebox/resolve/main/classes.py
- Command line
-
hf download hf://spaces/CazC/Tacklebox/classes.py
-
curl -L -o classes.py https://huggingface.co/spaces/CazC/Tacklebox/resolve/main/classes.py
1.29 kB
| from enum import Enum | |
| import openai | |
| from pydantic import BaseModel, Field | |
| from typing import Optional | |
| from typing import List | |
| import json | |
| import random | |
| class TackleboxCard(BaseModel): | |
| description: str | |
| share_with_other_player: bool = False | |
| class TackleboxDeck(BaseModel): | |
| cards: List[TackleboxCard] = Field(default_factory=list) | |
| def draw_card(self) -> Optional[TackleboxCard]: | |
| # shuffle and draw the top card | |
| if self.cards and len(self.cards) > 0: | |
| return self.cards.pop(random.randint(0, len(self.cards) - 1)) | |
| return None | |
| class Hand(BaseModel): | |
| cards: List[TackleboxCard] = Field(default_factory=list) | |
| def add_card(self, card: TackleboxCard): | |
| self.cards.append(card) | |
| class Personality(BaseModel): | |
| baseline: str | |
| traits: list[str] | |
| class SpeechStyle(BaseModel): | |
| average_sentence_count: int | |
| allows_small_action_descriptions: bool | |
| forbidden_topics: list[str] | |
| class Character(BaseModel): | |
| name: str | |
| age: int | |
| gender: str | |
| relationship_to_robin: str | |
| recent_event: str | |
| shared_past_event: str | |
| reason_for_fishing_today: Optional[str] = None | |
| relationship_type: Optional[str] = None | |
| pronouns: Optional[str] = None | |
| personality: Personality | |
| speech_style: SpeechStyle | |