Skip to main content

FastAPI (0.1.0)

Download OpenAPI specification:Download

Character

Generate actions and quests from a string representation of the character's situation.

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/json
required
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

Content type
application/json
{
  • "setting": "Medieval castle",
  • "locations": [
    ],
  • "currentLocation": "Castle bar",
  • "surroundingObjects": [
    ],
  • "characters": [
    ],
  • "personality": "Brave and cunning",
  • "pastEvents": [
    ],
  • "availableActions": [
    ],
  • "generate_quests": true
}

Response samples

Content type
application/json
Example
{
  • "name": "Attack",
  • "params": {
    }
}

Quest

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/json
required
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

Content type
application/json
{
  • "latestEvents": [
    ],
  • "quests": [
    ]
}

Response samples

Content type
application/json
[
  • 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/json
required
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

Content type
application/json
{
  • "latestEvents": [
    ],
  • "alreadyUnlockedAchievements": [
    ]
}

Response samples

Content type
application/json
{
  • "title": "Open Doors",
  • "description": "Activate the Ancient Portal at Mystic Ruins.",
  • "reward": 200
}