FastAPI (0.1.0)
Download OpenAPI specification:Download
Generate action or quest
Generate actions that follow the prototype you provide in your call - e.g., "Attack" with a "characterTarget" parameter. Can also generate quests if you enable it.
Request Body schema: application/jsonrequired
setting | string <= 100 characters Describes the game setting. |
locations | Array of strings <= 10 items [ items <= 100 characters ] Known locations to the character. |
currentLocation | string <= 100 characters The character's current location. |
surroundingObjects | Array of strings <= 10 items [ items <= 100 characters ] Objects surrounding the character. |
characters | Array of strings <= 10 items [ items <= 100 characters ] Characters known to the character. |
personality | string <= 100 characters The character's personality. |
pastEvents | Array of strings <= 10 items [ items <= 100 characters ] Past events that have occurred. |
Array of objects <= 10 items Available actions for the character. | |
generate_quests | boolean If set, enables the generation of quests. |
Responses
Request samples
- Payload
{- "setting": "Medieval castle",
- "locations": [
- "Castle bar",
- "Throne room"
], - "currentLocation": "Castle bar",
- "surroundingObjects": [
- "wooden table",
- "dirty dagger"
], - "characters": [
- "Pharaoh",
- "Priestess of Ra"
], - "personality": "Brave and cunning",
- "pastEvents": [
- "Saved the village from bandits",
- "Lost a treasured heirloom"
], - "availableActions": [
- {
- "name": "Attack",
- "params": {
- "characterTarget": "A character to attack with your sword"
}
}
], - "generate_quests": true
}
Response samples
- 200
- 422
{- "name": "Attack",
- "params": {
- "characterTarget": "Dark Wizard"
}
}
Check if an open quest has been completed, or generate a completed quest from scratch - an "achievement".
Check quests completion
Pass in a string representation of the latest game events, as well as a list of quests to be checked for completion. Returns a list of indices of completed quests, in the order they were provided.
Request Body schema: application/jsonrequired
latestEvents required | Array of strings <= 10 items A list of the latest events that have occurred, influencing quest completion. |
required | Array of objects (QuestModel) <= 10 items List of quests to be checked for completion. |
Responses
Request samples
- Payload
{- "latestEvents": [
- "Tantris strikes White Ghost and deals 15 damage",
- "White Ghost is now dead",
- "Tantris finds Glowy Stone in a chest",
- "Amara casts healing spell, restoring 20 health to Gideon",
- "The Ancient Portal at Mystic Ruins has been activated"
], - "quests": [
- {
- "title": "Defeat the White Ghost",
- "description": "Find and defeat the White Ghost haunting the Mystic Ruins.",
- "reward": 100
}, - {
- "title": "Treasure of the Mystic Ruins",
- "description": "Locate and open the ancient chest hidden within the Mystic Ruins.",
- "reward": 50
}, - {
- "title": "Pet a cat",
- "description": "Locate a cat, and pet it. Easy!",
- "reward": 10
}
]
}
Response samples
- 200
- 422
[- 0,
- 1
]
Generate an achievement
Pass in a string representation of the latest game events, and generate a completed quest that the player has achieved.
Request Body schema: application/jsonrequired
latestEvents required | Array of strings <= 10 items A list of the latest events that have occurred, used to generate an achievement. |
required | Array of objects (QuestModel) <= 10 items A list of achievements that have already been unlocked by the player. |
Responses
Request samples
- Payload
{- "latestEvents": [
- "Tantris strikes White Ghost and deals 15 damage",
- "White Ghost is now dead",
- "Tantris finds Glowy Stone in a chest",
- "Amara casts healing spell, restoring 20 health to Gideon",
- "The Ancient Portal at Mystic Ruins has been activated"
], - "alreadyUnlockedAchievements": [
- {
- "title": "Defeat the White Ghost",
- "description": "You have defeated the spectral menace that haunted the ruins.",
- "reward": 100
}
]
}
Response samples
- 200
- 422
{- "title": "Open Doors",
- "description": "Activate the Ancient Portal at Mystic Ruins.",
- "reward": 200
}