RPGGPT Visual Storyteller

RPGGPT Visual Storyteller · GPT 작업

FastAPI

  • POST /notify/Send a notification to the developer

    Notifies the developer of any issues with the service

  • POST /game/entities:newPlayerCreate a new player. Will automatically create the player's entity.

    Create a new player

  • GET /game/entitiesGet the current game state

    Get the current game state

  • POST /game/events:playerActionPerform an action in the game on behalf of the player

    Perform an action in the game

  • GET /game/eventsGet the current game events

    Get the current game events

  • GET /log-requestLogs that this endpoint was called

    Logs that this endpoint was called

원본 API 스키마
{
  "openapi": "3.1.0",
  "info": {
    "title": "FastAPI",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://llm-mmo-production.up.railway.app/api"
    }
  ],
  "paths": {
    "/notify/": {
      "post": {
        "summary": "Send a notification to the developer",
        "description": "Notifies the developer of any issues with the service",
        "operationId": "send_notification_notify__post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "message",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Message"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/game/entities:newPlayer": {
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Create a new player. Will automatically create the player's entity.",
        "description": "Create a new player",
        "operationId": "new_player_game_entities_newPlayer_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCharacterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/game/entities": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get the current game state",
        "description": "Get the current game state",
        "operationId": "get_entities_game_entities_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameState"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/game/events:playerAction": {
      "post": {
        "tags": [
          "game"
        ],
        "summary": "Perform an action in the game on behalf of the player",
        "description": "Perform an action in the game",
        "operationId": "player_action_game_events_playerAction_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlayerAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerActionResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/game/events": {
      "get": {
        "tags": [
          "game"
        ],
        "summary": "Get the current game events",
        "description": "Get the current game events",
        "operationId": "get_events_game_events_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  },
                  "type": "array",
                  "title": "Response Get Events Game Events Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/log-request": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Logs that this endpoint was called",
        "description": "Logs that this endpoint was called",
        "operationId": "log_request_log_request_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Character": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "The current state of the entity. Stores information on health, inventory, etc. Can even be JSON!"
          },
          "location": {
            "type": "string",
            "title": "Location",
            "description": "The location of the entity in the game world."
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "type",
          "state",
          "location"
        ],
        "title": "Character"
      },
      "CreateCharacterRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "state": {
            "type": "string",
            "title": "State"
          }
        },
        "type": "object",
        "required": [
          "name",
          "state"
        ],
        "title": "CreateCharacterRequest"
      },
      "Entity": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "The current state of the entity. Stores information on health, inventory, etc. Can even be JSON!"
          },
          "location": {
            "type": "string",
            "title": "Location",
            "description": "The location of the entity in the game world."
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "type",
          "state",
          "location"
        ],
        "title": "Entity",
        "description": "Represents any entity in the game. The possible types are enumerated in EntityType."
      },
      "EntityStateChange": {
        "properties": {
          "original_state": {
            "type": "string",
            "title": "Original State"
          },
          "change": {
            "type": "string",
            "title": "Change"
          },
          "final_state": {
            "type": "string",
            "title": "Final State"
          }
        },
        "type": "object",
        "required": [
          "original_state",
          "change",
          "final_state"
        ],
        "title": "EntityStateChange"
      },
      "EntityType": {
        "type": "string",
        "enum": [
          "player",
          "object",
          "npc",
          "structure"
        ],
        "title": "EntityType"
      },
      "Event": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "title": "Time"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "time"
        ],
        "title": "Event"
      },
      "GameState": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "type": "array",
            "title": "Events"
          },
          "entities": {
            "items": {
              "$ref": "#/components/schemas/Entity"
            },
            "type": "array",
            "title": "Entities"
          }
        },
        "type": "object",
        "required": [
          "events",
          "entities"
        ],
        "title": "GameState"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PlayerAction": {
        "properties": {
          "player_name": {
            "type": "string",
            "title": "Player Name",
            "description": "The name of the character taking the action. This should be available after the character creation step."
          },
          "action": {
            "type": "string",
            "title": "Action",
            "description": "The action the player is taking. It should be reasonably combined with the player's and any effected entity states."
          }
        },
        "type": "object",
        "required": [
          "player_name",
          "action"
        ],
        "title": "PlayerAction"
      },
      "PlayerActionResult": {
        "properties": {
          "player_name": {
            "type": "string",
            "title": "Player Name",
            "description": "The name of the player taking the action."
          },
          "state_changes": {
            "items": {
              "$ref": "#/components/schemas/EntityStateChange"
            },
            "type": "array",
            "title": "State Changes",
            "description": "A summary of the state changes that occurred as a result of the action. This should be used to describe to the player what happened."
          }
        },
        "type": "object",
        "required": [
          "player_name",
          "state_changes"
        ],
        "title": "PlayerActionResult"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  }
}