set default actions and systems, fix more yaml extensions
This commit is contained in:
parent
d76bcf0b8a
commit
cf5af8f4a3
|
@ -7,6 +7,6 @@ RUN pip install --no-cache-dir -r requirements/base.txt
|
||||||
|
|
||||||
COPY taleweave/ /taleweave/taleweave/
|
COPY taleweave/ /taleweave/taleweave/
|
||||||
COPY prompts/ /taleweave/prompts/
|
COPY prompts/ /taleweave/prompts/
|
||||||
COPY config.yml /taleweave/config.yml
|
COPY config.yaml /taleweave/config.yaml
|
||||||
|
|
||||||
CMD ["python", "-m", "taleweave.main"]
|
CMD ["python", "-m", "taleweave.main"]
|
||||||
|
|
52
README.md
52
README.md
|
@ -5,6 +5,20 @@ TaleWeave AI is an open-source game engine designed for creating rich, immersive
|
||||||
|
|
||||||
![TaleWeave AI logo with glowing sunrise over angular castle](https://docs-cdn.taleweave.ai/taleweave-github-1280.png)
|
![TaleWeave AI logo with glowing sunrise over angular castle](https://docs-cdn.taleweave.ai/taleweave-github-1280.png)
|
||||||
|
|
||||||
|
TaleWeave AI is meant for gamers, developers, and researchers. It is a:
|
||||||
|
|
||||||
|
- multiplayer text adventure
|
||||||
|
- Discord role-playing game
|
||||||
|
- emergent behavior laboratory
|
||||||
|
- life simulator
|
||||||
|
- survival game
|
||||||
|
- game engine
|
||||||
|
- world generator
|
||||||
|
- human-machine interface
|
||||||
|
- multi-user dungeon
|
||||||
|
- cross-platform gaming experience
|
||||||
|
- behavioral experiment
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [TaleWeave AI](#taleweave-ai)
|
- [TaleWeave AI](#taleweave-ai)
|
||||||
|
@ -22,20 +36,6 @@ TaleWeave AI is an open-source game engine designed for creating rich, immersive
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
TaleWeave AI is meant for gamers, developers, and researchers. It is a:
|
|
||||||
|
|
||||||
- multiplayer text adventure
|
|
||||||
- Discord role-playing game
|
|
||||||
- emergent behavior laboratory
|
|
||||||
- life simulator
|
|
||||||
- survival game
|
|
||||||
- game engine
|
|
||||||
- world generator
|
|
||||||
- human-machine interface
|
|
||||||
- multi-user dungeon
|
|
||||||
- cross-platform gaming experience
|
|
||||||
- behavioral experiment
|
|
||||||
|
|
||||||
TaleWeave AI does a few things out of the box:
|
TaleWeave AI does a few things out of the box:
|
||||||
|
|
||||||
- Generate a world from a brief text prompt
|
- Generate a world from a brief text prompt
|
||||||
|
@ -47,24 +47,26 @@ TaleWeave AI does a few things out of the box:
|
||||||
|
|
||||||
TaleWeave AI can:
|
TaleWeave AI can:
|
||||||
|
|
||||||
- Be modified in almost every way - everything is a plugin, including the planning and action stages that drive the simulation
|
- Be modified in almost every way - everything is a plugin, including the planning and action stages that drive the
|
||||||
- Be run locally - does not require any cloud services, but does play nicely with them
|
simulation
|
||||||
|
- Run locally - does not require any cloud services, but does play nicely with them
|
||||||
- Connect to your data - game systems can fetch data for RAG, making responses richer and more consistent
|
- Connect to your data - game systems can fetch data for RAG, making responses richer and more consistent
|
||||||
- Export training data - for analysis, visualization, and fine tuning of character models
|
- Export training data - for analysis, visualization, and fine tuning of character models
|
||||||
- Plug in to your workflow - run the simulation step by step in Jupyter notebooks using the TaleWeave AI engine as a Python library
|
- Plug in to your training workflow - run the simulation step by step in Jupyter notebooks using the TaleWeave AI engine
|
||||||
- Connect to your server and vice versa - the Discord bot is a plugin and can be replaced with your favorite chat platform
|
as a Python library
|
||||||
|
- Chat with you anywhere - the Discord bot is a plugin and can be replaced with your favorite chat platform
|
||||||
|
|
||||||
### Game Actions
|
### Game Actions
|
||||||
|
|
||||||
TaleWeave AI has in-game actions for:
|
TaleWeave AI has in-game actions for:
|
||||||
|
|
||||||
| Core | Life Sim | RPG |
|
| Core | Life Sim | RPG |
|
||||||
| ------------ | --------------- | --------- |
|
| ------------ | ----------------- | --------- |
|
||||||
| Planning | Hunger & Thirst | Combat |
|
| Planning | Cooking | Combat |
|
||||||
| Conversation | Hygiene | Crafting |
|
| Conversation | Eating & Drinking | Crafting |
|
||||||
| Movement | Sleeping | Magic |
|
| Movement | Sleeping | Magic |
|
||||||
| Exploration | | Movement* |
|
| Exploration | Washing | Movement* |
|
||||||
| | | Writing |
|
| | | Writing |
|
||||||
|
|
||||||
1. The core exploration actions provide ways for characters to expand the world by finding new rooms and items.
|
1. The core exploration actions provide ways for characters to expand the world by finding new rooms and items.
|
||||||
2. The RPG movement actions provide additional situational movement like crawling, climbing, and jumping.
|
2. The RPG movement actions provide additional situational movement like crawling, climbing, and jumping.
|
||||||
|
|
|
@ -303,7 +303,7 @@ DISCORD_TOKEN=YOUR_TOKEN
|
||||||
|
|
||||||
### Configure the Discord bot
|
### Configure the Discord bot
|
||||||
|
|
||||||
Copy the `config.yml` file to a file named `custom_config.yml` and edit the `bot` section to use your desired
|
Copy the `config.yaml` file to a file named `custom_config.yaml` and edit the `bot` section to use your desired
|
||||||
parameters for the Discord bot. Make sure the list of `channels` includes one or more valid channels in the servers
|
parameters for the Discord bot. Make sure the list of `channels` includes one or more valid channels in the servers
|
||||||
to which you invited the bot. By default, this is a channel named `taleweave`.
|
to which you invited the bot. By default, this is a channel named `taleweave`.
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ The `name_*` fields are used by the bot to refer to itself in messages.
|
||||||
_Note:_ This step is _required_ if you are using the `--render` or `--render-generated` command-line arguments. If you
|
_Note:_ This step is _required_ if you are using the `--render` or `--render-generated` command-line arguments. If you
|
||||||
launched ComfyUI, do this step too.
|
launched ComfyUI, do this step too.
|
||||||
|
|
||||||
In your `custom_config.yml`, edit the `render` section to use your desired parameters for image generation. Make sure
|
In your `custom_config.yaml`, edit the `render` section to use your desired parameters for image generation. Make sure
|
||||||
the `checkpoints` are valid file names in your checkpoints folder. If you provide more than one checkpoint, one will be
|
the `checkpoints` are valid file names in your checkpoints folder. If you provide more than one checkpoint, one will be
|
||||||
randomly selected for each batch of images. Adjust the `sizes` as needed to match the checkpoint and control your memory
|
randomly selected for each batch of images. Adjust the `sizes` as needed to match the checkpoint and control your memory
|
||||||
usage.
|
usage.
|
||||||
|
@ -356,7 +356,7 @@ render:
|
||||||
|
|
||||||
_Note:_ You only need to do this step if you want to change the host or port where the websocket server will listen.
|
_Note:_ You only need to do this step if you want to change the host or port where the websocket server will listen.
|
||||||
|
|
||||||
In your `custom_config.yml`, edit the `server` section to change the host and port where the websocket server will
|
In your `custom_config.yaml`, edit the `server` section to change the host and port where the websocket server will
|
||||||
listen for connections:
|
listen for connections:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -373,7 +373,7 @@ front of the websocket server.
|
||||||
|
|
||||||
_Note:_ You only need to do this step if you want to change the size of the world during generation.
|
_Note:_ You only need to do this step if you want to change the size of the world during generation.
|
||||||
|
|
||||||
In your `custom_config.yml`, edit the `world` section to change the size of the rooms and character inventory while
|
In your `custom_config.yaml`, edit the `world` section to change the size of the rooms and character inventory while
|
||||||
generating the world.
|
generating the world.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -432,7 +432,7 @@ world:
|
||||||
The world prompt has two parts: the main theme and the secondary flavor text used by the dungeon master and world
|
The world prompt has two parts: the main theme and the secondary flavor text used by the dungeon master and world
|
||||||
builder to make a more unique and interesting world.
|
builder to make a more unique and interesting world.
|
||||||
|
|
||||||
Some world templates are provided in the [`taleweave/prompts.yml` file](../../taleweave/prompts.yml), which you can
|
Some world templates are provided in the [`taleweave/worlds.yaml` file](../../taleweave/worlds.yaml), which you can
|
||||||
use to get started, or create your own prompt and generate a unique world.
|
use to get started, or create your own prompt and generate a unique world.
|
||||||
|
|
||||||
Example world templates include:
|
Example world templates include:
|
||||||
|
@ -468,10 +468,10 @@ server:
|
||||||
```bash
|
```bash
|
||||||
# Start the TaleWeave AI engine
|
# Start the TaleWeave AI engine
|
||||||
python3 -m taleweave.main \
|
python3 -m taleweave.main \
|
||||||
--config config.yml \
|
--config config.yaml \
|
||||||
--prompts prompts/llama-base.yml prompts/llama-quest.yml prompts/discord-en-us.yml \
|
--prompts prompts/llama-*.yaml prompts/discord-en-us.yaml \
|
||||||
--world worlds/outback-animals-1 \
|
--world worlds/outback-animals-1 \
|
||||||
--world-template ./worlds.yml:outback-animals \
|
--world-template ./worlds.yaml:outback-animals \
|
||||||
--discord \
|
--discord \
|
||||||
--render \
|
--render \
|
||||||
--render-generated \
|
--render-generated \
|
||||||
|
@ -479,8 +479,8 @@ python3 -m taleweave.main \
|
||||||
--rooms 3 \
|
--rooms 3 \
|
||||||
--turns 30 \
|
--turns 30 \
|
||||||
--optional-actions \
|
--optional-actions \
|
||||||
--actions taleweave.systems.sim:init_actions \
|
--actions taleweave.actions.core taleweave.actions.optional taleweave.systems.sim:init_actions \
|
||||||
--systems taleweave.systems.sim:init_logic
|
--systems taleweave.systems.core taleweave.systems.sim:init_logic
|
||||||
```
|
```
|
||||||
|
|
||||||
This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down.
|
This will generate a relatively small world with 3 rooms or areas, run for 30 steps, then save the game and shut down.
|
||||||
|
@ -490,7 +490,7 @@ another file named `worlds/outback-animals-1.state.json`. The world can be stopp
|
||||||
although the step in progress will be lost. The saved state can be resumed and played for any number of additional
|
although the step in progress will be lost. The saved state can be resumed and played for any number of additional
|
||||||
steps by running the server again with the same arguments.
|
steps by running the server again with the same arguments.
|
||||||
|
|
||||||
> Note: `module.name:function_name` and `path/filename.yml:key` are patterns you will see repeated throughout TaleWeave AI.
|
> Note: `module.name:function_name` and `path/filename.yaml:key` are patterns you will see repeated throughout TaleWeave AI.
|
||||||
> They indicate a Python module and function within it, or a data file and key within it, respectively.
|
> They indicate a Python module and function within it, or a data file and key within it, respectively.
|
||||||
|
|
||||||
The optional actions are actions that allow characters to explore and expand the world during the game,
|
The optional actions are actions that allow characters to explore and expand the world during the game,
|
||||||
|
|
|
@ -113,18 +113,28 @@ def parse_args():
|
||||||
type=str,
|
type=str,
|
||||||
nargs="*",
|
nargs="*",
|
||||||
help="Extra actions to include in the simulation",
|
help="Extra actions to include in the simulation",
|
||||||
|
default=[
|
||||||
|
"taleweave.actions.core",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--prompts",
|
"--prompts",
|
||||||
type=str,
|
type=str,
|
||||||
nargs="*",
|
nargs="*",
|
||||||
help="The file to load game prompts from",
|
help="The file to load game prompts from",
|
||||||
|
default=[
|
||||||
|
"prompts/discord-en-us.yaml",
|
||||||
|
"prompts/llama-*.yaml",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--systems",
|
"--systems",
|
||||||
type=str,
|
type=str,
|
||||||
nargs="*",
|
nargs="*",
|
||||||
help="Extra systems to run in the simulation",
|
help="Extra systems to run in the simulation",
|
||||||
|
default=[
|
||||||
|
"taleweave.systems.core",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
# generation arguments
|
# generation arguments
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
from os import path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from packit.agent import Agent
|
from packit.agent import Agent
|
||||||
|
@ -17,7 +18,7 @@ logger = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
LOGIC_FILES = [
|
LOGIC_FILES = [
|
||||||
"./taleweave/systems/environment/weather/logic.yaml",
|
path.join(".", "taleweave", "systems", "environment", "weather", "logic.yaml"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ def describe_character(
|
||||||
def describe_static(entity: WorldEntity) -> str:
|
def describe_static(entity: WorldEntity) -> str:
|
||||||
attribute_descriptions = format_attributes(entity)
|
attribute_descriptions = format_attributes(entity)
|
||||||
logger.info(
|
logger.info(
|
||||||
"describing entity: %s, attributes: '%s'",
|
"describing entity: %s, attributes: %s",
|
||||||
entity.name,
|
entity.name,
|
||||||
attribute_descriptions,
|
attribute_descriptions,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue