From fa35ef1dabd8ee377003b9ac510a351a809f9a47 Mon Sep 17 00:00:00 2001 From: Katerina Vankova Date: Tue, 29 Oct 2024 18:57:45 +0100 Subject: [PATCH] Add code embedder --- .github/workflows/code-embedding.yml | 17 +++++++++++++++++ README.md | 19 +------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/code-embedding.yml 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]