diff --git a/.github/workflows/code-embedding.yml b/.github/workflows/code-embedding.yml new file mode 100644 index 0000000..e4e5ac2 --- /dev/null +++ b/.github/workflows/code-embedding.yml @@ -0,0 +1,17 @@ +name: Code Embedder + +on: + push: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.ref }} + - name: Embed Code + uses: kvankova/code-embedder@v0.3.0 + env: + GITHUB_TOKEN: ${{ secrets.CODE_EMBEDDER }} diff --git a/README.md b/README.md index 813d93d..4279c20 100644 --- a/README.md +++ b/README.md @@ -52,24 +52,7 @@ that has the signature explained in sections down below. ### Usage Example (🤸 Gymnasium) The example loop for running the game looks like this -```python -import gymnasium as gym - -from generals.agents import RandomAgent, ExpanderAgent - -# Initialize agents -agent = RandomAgent() -npc = ExpanderAgent() - -# Create environment -env = gym.make("gym-generals-v0", agent=agent, npc=npc, render_mode="human") - -observation, info = env.reset() -terminated = truncated = False -while not (terminated or truncated): - action = agent.act(observation) - observation, reward, terminated, truncated, info = env.step(action) - env.render() +```python:examples/gymnasium_example.py ``` > [!TIP]