Skip to content

Instantly share code, notes, and snippets.

@ryancollingwood
Created August 18, 2023 00:12
Show Gist options
  • Save ryancollingwood/528868631f6c1f51c8ab9d4d65933e54 to your computer and use it in GitHub Desktop.
Save ryancollingwood/528868631f6c1f51c8ab9d4d65933e54 to your computer and use it in GitHub Desktop.
from typing import List
from pydantic import BaseModel
class CharacterClass(BaseModel):
name: str
is_ranged: bool
is_magic: bool
class Item(BaseModel):
name: str
class InventoryItem(BaseModel):
item: Item
quantity: int
class Character(BaseModel):
name: str
char_class: CharacterClass
inventory: List[InventoryItem]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment