{
  "openapi": "3.0.2",
  "info": {
    "title": "open-assistant backend",
    "version": "0.1.0"
  },
  "paths": {
    "/api/v1/tasks/": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Request Task",
        "description": "Create new task.",
        "operationId": "request_task_api_v1_tasks__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Request Task Api V1 Tasks  Post",
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TaskDone"
                    },
                    {
                      "$ref": "#/components/schemas/SummarizeStoryTask"
                    },
                    {
                      "$ref": "#/components/schemas/RateSummaryTask"
                    },
                    {
                      "$ref": "#/components/schemas/InitialPromptTask"
                    },
                    {
                      "$ref": "#/components/schemas/ReplyToConversationTask"
                    },
                    {
                      "$ref": "#/components/schemas/PrompterReplyTask"
                    },
                    {
                      "$ref": "#/components/schemas/AssistantReplyTask"
                    },
                    {
                      "$ref": "#/components/schemas/RankInitialPromptsTask"
                    },
                    {
                      "$ref": "#/components/schemas/RankConversationRepliesTask"
                    },
                    {
                      "$ref": "#/components/schemas/RankPrompterRepliesTask"
                    },
                    {
                      "$ref": "#/components/schemas/RankAssistantRepliesTask"
                    },
                    {
                      "$ref": "#/components/schemas/LabelInitialPromptTask"
                    },
                    {
                      "$ref": "#/components/schemas/LabelConversationReplyTask"
                    },
                    {
                      "$ref": "#/components/schemas/LabelPrompterReplyTask"
                    },
                    {
                      "$ref": "#/components/schemas/LabelAssistantReplyTask"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/tasks/{task_id}/ack": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Tasks Acknowledge",
        "description": "The frontend acknowledges a task.",
        "operationId": "tasks_acknowledge_api_v1_tasks__task_id__ack_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "task_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskAck"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/tasks/{task_id}/nack": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Tasks Acknowledge Failure",
        "description": "The frontend reports failure to implement a task.",
        "operationId": "tasks_acknowledge_failure_api_v1_tasks__task_id__nack_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "task_id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskNAck"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/tasks/interaction": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Tasks Interaction",
        "description": "The frontend reports an interaction.",
        "operationId": "tasks_interaction_api_v1_tasks_interaction_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Interaction",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TextReplyToMessage"
                  },
                  {
                    "$ref": "#/components/schemas/MessageRating"
                  },
                  {
                    "$ref": "#/components/schemas/MessageRanking"
                  },
                  {
                    "$ref": "#/components/schemas/TextLabels"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDone"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/tasks/close": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Close Collective Task",
        "operationId": "close_collective_task_api_v1_tasks_close_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskClose"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDone"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/text_labels/": {
      "post": {
        "tags": [
          "text_labels"
        ],
        "summary": "Label Text",
        "description": "Label a piece of text.",
        "operationId": "label_text_api_v1_text_labels__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextLabels"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/text_labels/valid_labels": {
      "get": {
        "tags": [
          "text_labels"
        ],
        "summary": "Get Valid Lables",
        "operationId": "get_valid_lables_api_v1_text_labels_valid_labels_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/messages/": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Query Messages",
        "description": "Query messages.",
        "operationId": "query_messages_api_v1_messages__get",
        "parameters": [
          {
            "required": false,
            "schema": {
              "title": "Username",
              "type": "string"
            },
            "name": "username",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string"
            },
            "name": "api_client_id",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Count",
              "maximum": 1000,
              "exclusiveMinimum": 0,
              "type": "integer",
              "default": 10
            },
            "name": "max_count",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Start Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "start_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "End Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "end_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Only Roots",
              "type": "boolean",
              "default": false
            },
            "name": "only_roots",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Desc",
              "type": "boolean",
              "default": true
            },
            "name": "desc",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Allow Deleted",
              "type": "boolean",
              "default": false
            },
            "name": "allow_deleted",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Query Messages Api V1 Messages  Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Message",
        "description": "Get a message by its internal ID.",
        "operationId": "get_message_api_v1_messages__message_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Mark Message Deleted",
        "operationId": "mark_message_deleted_api_v1_messages__message_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/conversation": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Conv",
        "description": "Get a conversation from the tree root and up to the message with given internal ID.",
        "operationId": "get_conv_api_v1_messages__message_id__conversation_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/tree": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Tree",
        "description": "Get all messages belonging to the same message tree.",
        "operationId": "get_tree_api_v1_messages__message_id__tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/children": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Children",
        "description": "Get all messages belonging to the same message tree.",
        "operationId": "get_children_api_v1_messages__message_id__children_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Children Api V1 Messages  Message Id  Children Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/descendants": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Descendants",
        "description": "Get a subtree which starts with this message.",
        "operationId": "get_descendants_api_v1_messages__message_id__descendants_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/longest_conversation_in_tree": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Longest Conv",
        "description": "Get the longest conversation from the tree of the message.",
        "operationId": "get_longest_conv_api_v1_messages__message_id__longest_conversation_in_tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/messages/{message_id}/max_children_in_tree": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get Max Children",
        "description": "Get message with the most children from the tree of the provided message.",
        "operationId": "get_max_children_api_v1_messages__message_id__max_children_in_tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Message By Frontend Id",
        "description": "Get a message by its frontend ID.",
        "operationId": "get_message_by_frontend_id_api_v1_frontend_messages__message_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/conversation": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Conv By Frontend Id",
        "description": "Get a conversation from the tree root and up to the message with given frontend ID.",
        "operationId": "get_conv_by_frontend_id_api_v1_frontend_messages__message_id__conversation_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/tree": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Tree By Frontend Id",
        "description": "Get all messages belonging to the same message tree.\nMessage is identified by its frontend ID.",
        "operationId": "get_tree_by_frontend_id_api_v1_frontend_messages__message_id__tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/children": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Children By Frontend Id",
        "description": "Get all messages belonging to the same message tree.",
        "operationId": "get_children_by_frontend_id_api_v1_frontend_messages__message_id__children_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Children By Frontend Id Api V1 Frontend Messages  Message Id  Children Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/descendants": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Descendants By Frontend Id",
        "description": "Get a subtree which starts with this message.\nThe message is identified by its frontend ID.",
        "operationId": "get_descendants_by_frontend_id_api_v1_frontend_messages__message_id__descendants_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/longest_conversation_in_tree": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Longest Conv By Frontend Id",
        "description": "Get the longest conversation from the tree of the message.\nThe message is identified by its frontend ID.",
        "operationId": "get_longest_conv_by_frontend_id_api_v1_frontend_messages__message_id__longest_conversation_in_tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_messages/{message_id}/max_children_in_tree": {
      "get": {
        "tags": [
          "frontend_messages"
        ],
        "summary": "Get Max Children By Frontend Id",
        "description": "Get message with the most children from the tree of the provided message.\nThe message is identified by its frontend ID.",
        "operationId": "get_max_children_by_frontend_id_api_v1_frontend_messages__message_id__max_children_in_tree_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            },
            "name": "message_id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTree"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/users/users/{user_id}": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get User",
        "description": "Get a user by global user ID. Only trusted clients can resolve users they did not register.",
        "operationId": "get_user_api_v1_users_users__user_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "user_id",
            "in": "path"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      },
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Update User",
        "description": "Update a user by global user ID. Only trusted clients can update users.",
        "operationId": "update_user_api_v1_users_users__user_id__put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "user_id",
            "in": "path"
          },
          {
            "required": false,
            "schema": {
              "title": "Enabled",
              "type": "boolean"
            },
            "name": "enabled",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Notes",
              "type": "string"
            },
            "name": "notes",
            "in": "query"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Delete User",
        "description": "Delete a user by global user ID. Only trusted clients can delete users.",
        "operationId": "delete_user_api_v1_users_users__user_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/users/{user_id}/messages": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Query User Messages",
        "description": "Query user messages.",
        "operationId": "query_user_messages_api_v1_users__user_id__messages_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "user_id",
            "in": "path"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Count",
              "maximum": 1000,
              "exclusiveMinimum": 0,
              "type": "integer",
              "default": 10
            },
            "name": "max_count",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Start Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "start_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "End Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "end_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Only Roots",
              "type": "boolean",
              "default": false
            },
            "name": "only_roots",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Desc",
              "type": "boolean",
              "default": true
            },
            "name": "desc",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Include Deleted",
              "type": "boolean",
              "default": false
            },
            "name": "include_deleted",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Query User Messages Api V1 Users  User Id  Messages Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Mark User Messages Deleted",
        "operationId": "mark_user_messages_deleted_api_v1_users__user_id__messages_delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_users/": {
      "get": {
        "tags": [
          "frontend_users"
        ],
        "summary": "Get Users",
        "operationId": "get_users_api_v1_frontend_users__get",
        "parameters": [
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Count",
              "maximum": 10000,
              "exclusiveMinimum": 0,
              "type": "integer",
              "default": 100
            },
            "name": "max_count",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Gte",
              "type": "string"
            },
            "name": "gte",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Lt",
              "type": "string"
            },
            "name": "lt",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Auth Method",
              "type": "string"
            },
            "name": "auth_method",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Users Api V1 Frontend Users  Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FrontEndUser"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_users/by_display_name": {
      "get": {
        "tags": [
          "frontend_users"
        ],
        "summary": "Query Frontend Users By Display Name",
        "operationId": "query_frontend_users_by_display_name_api_v1_frontend_users_by_display_name_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Search Text",
              "type": "string"
            },
            "name": "search_text",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Exact",
              "type": "boolean",
              "default": false
            },
            "name": "exact",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Count",
              "maximum": 1000,
              "exclusiveMinimum": 0,
              "type": "integer",
              "default": 20
            },
            "name": "max_count",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Auth Method",
              "type": "string"
            },
            "name": "auth_method",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_users/{auth_method}/{username}": {
      "get": {
        "tags": [
          "frontend_users"
        ],
        "summary": "Query Frontend User",
        "description": "Query frontend user.",
        "operationId": "query_frontend_user_api_v1_frontend_users__auth_method___username__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Auth Method",
              "type": "string"
            },
            "name": "auth_method",
            "in": "path"
          },
          {
            "required": true,
            "schema": {
              "title": "Username",
              "type": "string"
            },
            "name": "username",
            "in": "path"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FrontEndUser"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/frontend_users/{auth_method}/{username}/messages": {
      "get": {
        "tags": [
          "frontend_users"
        ],
        "summary": "Query Frontend User Messages",
        "description": "Query frontend user messages.",
        "operationId": "query_frontend_user_messages_api_v1_frontend_users__auth_method___username__messages_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Auth Method",
              "type": "string"
            },
            "name": "auth_method",
            "in": "path"
          },
          {
            "required": true,
            "schema": {
              "title": "Username",
              "type": "string"
            },
            "name": "username",
            "in": "path"
          },
          {
            "required": false,
            "schema": {
              "title": "Api Client Id",
              "type": "string",
              "format": "uuid"
            },
            "name": "api_client_id",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Max Count",
              "maximum": 1000,
              "exclusiveMinimum": 0,
              "type": "integer",
              "default": 10
            },
            "name": "max_count",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Start Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "start_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "End Date",
              "type": "string",
              "format": "date-time"
            },
            "name": "end_date",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Only Roots",
              "type": "boolean",
              "default": false
            },
            "name": "only_roots",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Desc",
              "type": "boolean",
              "default": true
            },
            "name": "desc",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "title": "Include Deleted",
              "type": "boolean",
              "default": false
            },
            "name": "include_deleted",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Query Frontend User Messages Api V1 Frontend Users  Auth Method   Username  Messages Get",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "frontend_users"
        ],
        "summary": "Mark Frontend User Messages Deleted",
        "operationId": "mark_frontend_user_messages_deleted_api_v1_frontend_users__auth_method___username__messages_delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Auth Method",
              "type": "string"
            },
            "name": "auth_method",
            "in": "path"
          },
          {
            "required": true,
            "schema": {
              "title": "Username",
              "type": "string"
            },
            "name": "username",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/stats/": {
      "get": {
        "tags": [
          "stats"
        ],
        "summary": "Get Message Stats",
        "operationId": "get_message_stats_api_v1_stats__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemStats"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/experimental/leaderboards/create/assistant": {
      "get": {
        "tags": [
          "leaderboards"
        ],
        "summary": "Get Assistant Leaderboard",
        "operationId": "get_assistant_leaderboard_api_v1_experimental_leaderboards_create_assistant_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/experimental/leaderboards/create/prompter": {
      "get": {
        "tags": [
          "leaderboards"
        ],
        "summary": "Get Prompter Leaderboard",
        "operationId": "get_prompter_leaderboard_api_v1_experimental_leaderboards_create_prompter_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/hf/text_toxicity": {
      "get": {
        "tags": [
          "hugging_face"
        ],
        "summary": "Get Text Toxicity",
        "description": "Get the Message Toxicity from HuggingFace Roberta model.\n\nArgs:\n    msg (str): the message that we want to analyze.\n    api_client (ApiClient, optional): authentification of the user of the request.\n        Defaults to Depends(deps.get_trusted_api_client).\n\nReturns:\n    ToxicityClassification: the score of toxicity of the message.",
        "operationId": "get_text_toxicity_api_v1_hf_text_toxicity_get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Msg",
              "type": "string"
            },
            "name": "msg",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyQuery": []
          },
          {
            "APIKeyHeader": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AssistantReplyTask": {
        "title": "AssistantReplyTask",
        "required": [
          "conversation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "assistant_reply"
            ],
            "type": "string",
            "default": "assistant_reply"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          }
        },
        "description": "A task to prompt the user to act as the assistant."
      },
      "Conversation": {
        "title": "Conversation",
        "type": "object",
        "properties": {
          "messages": {
            "title": "Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            },
            "default": []
          }
        },
        "description": "Represents a conversation between the prompter and the assistant."
      },
      "ConversationMessage": {
        "title": "ConversationMessage",
        "required": [
          "text",
          "is_assistant"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "frontend_message_id": {
            "title": "Frontend Message Id",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "is_assistant": {
            "title": "Is Assistant",
            "type": "boolean"
          }
        },
        "description": "Represents a message in a conversation between the user and the assistant."
      },
      "FrontEndUser": {
        "title": "FrontEndUser",
        "required": [
          "id",
          "display_name",
          "auth_method",
          "user_id",
          "enabled",
          "deleted",
          "notes"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "auth_method": {
            "title": "Auth Method",
            "enum": [
              "discord",
              "local"
            ],
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string",
            "format": "uuid"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "deleted": {
            "title": "Deleted",
            "type": "boolean"
          },
          "notes": {
            "title": "Notes",
            "type": "string"
          },
          "created_date": {
            "title": "Created Date",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "InitialPromptTask": {
        "title": "InitialPromptTask",
        "type": "object",
        "properties": {
          "hint": {
            "title": "Hint",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "initial_prompt"
            ],
            "type": "string",
            "default": "initial_prompt"
          }
        },
        "description": "A task to prompt the user to submit an initial prompt to the assistant."
      },
      "LabelAssistantReplyTask": {
        "title": "LabelAssistantReplyTask",
        "required": [
          "conversation",
          "message_id",
          "reply",
          "valid_labels"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "label_assistant_reply"
            ],
            "type": "string",
            "default": "label_assistant_reply"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string",
            "format": "uuid"
          },
          "reply": {
            "title": "Reply",
            "type": "string"
          },
          "valid_labels": {
            "title": "Valid Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mandatory_labels": {
            "title": "Mandatory Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "$ref": "#/components/schemas/LabelTaskMode"
          }
        },
        "description": "A task to label an assistant reply to a conversation."
      },
      "LabelConversationReplyTask": {
        "title": "LabelConversationReplyTask",
        "required": [
          "conversation",
          "message_id",
          "reply",
          "valid_labels"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "label_conversation_reply"
            ],
            "type": "string",
            "default": "label_conversation_reply"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string",
            "format": "uuid"
          },
          "reply": {
            "title": "Reply",
            "type": "string"
          },
          "valid_labels": {
            "title": "Valid Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mandatory_labels": {
            "title": "Mandatory Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "$ref": "#/components/schemas/LabelTaskMode"
          }
        },
        "description": "A task to label a reply to a conversation."
      },
      "LabelInitialPromptTask": {
        "title": "LabelInitialPromptTask",
        "required": [
          "message_id",
          "prompt",
          "valid_labels"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "label_initial_prompt"
            ],
            "type": "string",
            "default": "label_initial_prompt"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string",
            "format": "uuid"
          },
          "prompt": {
            "title": "Prompt",
            "type": "string"
          },
          "valid_labels": {
            "title": "Valid Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mandatory_labels": {
            "title": "Mandatory Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "$ref": "#/components/schemas/LabelTaskMode"
          }
        },
        "description": "A task to label an initial prompt."
      },
      "LabelPrompterReplyTask": {
        "title": "LabelPrompterReplyTask",
        "required": [
          "conversation",
          "message_id",
          "reply",
          "valid_labels"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "label_prompter_reply"
            ],
            "type": "string",
            "default": "label_prompter_reply"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string",
            "format": "uuid"
          },
          "reply": {
            "title": "Reply",
            "type": "string"
          },
          "valid_labels": {
            "title": "Valid Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mandatory_labels": {
            "title": "Mandatory Labels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "$ref": "#/components/schemas/LabelTaskMode"
          }
        },
        "description": "A task to label a prompter reply to a conversation."
      },
      "LabelTaskMode": {
        "title": "LabelTaskMode",
        "enum": [
          "simple",
          "full"
        ],
        "type": "string",
        "description": "Label task mode that allows frontends to select an appropriate UI."
      },
      "Message": {
        "title": "Message",
        "required": [
          "text",
          "is_assistant"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "frontend_message_id": {
            "title": "Frontend Message Id",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "is_assistant": {
            "title": "Is Assistant",
            "type": "boolean"
          },
          "parent_id": {
            "title": "Parent Id",
            "type": "string",
            "format": "uuid"
          },
          "created_date": {
            "title": "Created Date",
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Represents a message in a conversation between the user and the assistant."
      },
      "MessageRanking": {
        "title": "MessageRanking",
        "required": [
          "user",
          "message_id",
          "ranking"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "enum": [
              "message_ranking"
            ],
            "type": "string",
            "default": "message_ranking"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string"
          },
          "ranking": {
            "title": "Ranking",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "description": "A user has given a ranking for a message."
      },
      "MessageRating": {
        "title": "MessageRating",
        "required": [
          "user",
          "message_id",
          "rating"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "enum": [
              "message_rating"
            ],
            "type": "string",
            "default": "message_rating"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string"
          },
          "rating": {
            "title": "Rating",
            "exclusiveMinimum": 0,
            "type": "integer"
          }
        },
        "description": "A user has rated a message."
      },
      "MessageTree": {
        "title": "MessageTree",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "messages": {
            "title": "Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "default": []
          }
        },
        "description": "All messages belonging to the same message tree."
      },
      "PrompterReplyTask": {
        "title": "PrompterReplyTask",
        "required": [
          "conversation"
        ],
        "type": "object",
        "properties": {
          "hint": {
            "title": "Hint",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "prompter_reply"
            ],
            "type": "string",
            "default": "prompter_reply"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          }
        },
        "description": "A task to prompt the user to submit a reply to the assistant."
      },
      "RankAssistantRepliesTask": {
        "title": "RankAssistantRepliesTask",
        "required": [
          "conversation",
          "replies",
          "reply_messages"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "rank_assistant_replies"
            ],
            "type": "string",
            "default": "rank_assistant_replies"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "replies": {
            "title": "Replies",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reply_messages": {
            "title": "Reply Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          }
        },
        "description": "A task to rank a set of assistant replies to a conversation."
      },
      "RankConversationRepliesTask": {
        "title": "RankConversationRepliesTask",
        "required": [
          "conversation",
          "replies",
          "reply_messages"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "rank_conversation_replies"
            ],
            "type": "string",
            "default": "rank_conversation_replies"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "replies": {
            "title": "Replies",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reply_messages": {
            "title": "Reply Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          }
        },
        "description": "A task to rank a set of replies to a conversation."
      },
      "RankInitialPromptsTask": {
        "title": "RankInitialPromptsTask",
        "required": [
          "prompts",
          "prompt_messages"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "rank_initial_prompts"
            ],
            "type": "string",
            "default": "rank_initial_prompts"
          },
          "prompts": {
            "title": "Prompts",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prompt_messages": {
            "title": "Prompt Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          }
        },
        "description": "A task to rank a set of initial prompts."
      },
      "RankPrompterRepliesTask": {
        "title": "RankPrompterRepliesTask",
        "required": [
          "conversation",
          "replies",
          "reply_messages"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "rank_prompter_replies"
            ],
            "type": "string",
            "default": "rank_prompter_replies"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          },
          "replies": {
            "title": "Replies",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reply_messages": {
            "title": "Reply Messages",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          }
        },
        "description": "A task to rank a set of prompter replies to a conversation."
      },
      "RateSummaryTask": {
        "title": "RateSummaryTask",
        "required": [
          "full_text",
          "summary"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "rate_summary"
            ],
            "type": "string",
            "default": "rate_summary"
          },
          "scale": {
            "title": "Scale",
            "allOf": [
              {
                "$ref": "#/components/schemas/RatingScale"
              }
            ],
            "default": {
              "min": 1,
              "max": 5
            }
          },
          "full_text": {
            "title": "Full Text",
            "type": "string"
          },
          "summary": {
            "title": "Summary",
            "type": "string"
          }
        },
        "description": "A task to rate a summary."
      },
      "RatingScale": {
        "title": "RatingScale",
        "required": [
          "min",
          "max"
        ],
        "type": "object",
        "properties": {
          "min": {
            "title": "Min",
            "type": "integer"
          },
          "max": {
            "title": "Max",
            "type": "integer"
          }
        }
      },
      "ReplyToConversationTask": {
        "title": "ReplyToConversationTask",
        "required": [
          "conversation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "reply_to_conversation"
            ],
            "type": "string",
            "default": "reply_to_conversation"
          },
          "conversation": {
            "$ref": "#/components/schemas/Conversation"
          }
        },
        "description": "A task to prompt the user to submit a reply to a conversation."
      },
      "SummarizeStoryTask": {
        "title": "SummarizeStoryTask",
        "required": [
          "story"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "summarize_story"
            ],
            "type": "string",
            "default": "summarize_story"
          },
          "story": {
            "title": "Story",
            "type": "string"
          }
        },
        "description": "A task to summarize a story."
      },
      "SystemStats": {
        "title": "SystemStats",
        "type": "object",
        "properties": {
          "all": {
            "title": "All",
            "type": "integer",
            "default": 0
          },
          "active": {
            "title": "Active",
            "type": "integer",
            "default": 0
          },
          "deleted": {
            "title": "Deleted",
            "type": "integer",
            "default": 0
          },
          "message_trees": {
            "title": "Message Trees",
            "type": "integer",
            "default": 0
          }
        }
      },
      "TaskAck": {
        "title": "TaskAck",
        "required": [
          "message_id"
        ],
        "type": "object",
        "properties": {
          "message_id": {
            "title": "Message Id",
            "type": "string"
          }
        },
        "description": "The frontend acknowledges that it has received a task and created a message."
      },
      "TaskClose": {
        "title": "TaskClose",
        "required": [
          "message_id"
        ],
        "type": "object",
        "properties": {
          "message_id": {
            "title": "Message Id",
            "type": "string"
          }
        },
        "description": "The frontend asks to mark task as done"
      },
      "TaskDone": {
        "title": "TaskDone",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "title": "Type",
            "enum": [
              "task_done"
            ],
            "type": "string",
            "default": "task_done"
          }
        },
        "description": "Signals to the frontend that the task is done."
      },
      "TaskNAck": {
        "title": "TaskNAck",
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "description": "The frontend acknowledges that it has received a task but cannot create a message."
      },
      "TaskRequest": {
        "title": "TaskRequest",
        "type": "object",
        "properties": {
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskRequestType"
              }
            ],
            "default": "random"
          },
          "user": {
            "title": "User",
            "allOf": [
              {
                "$ref": "#/components/schemas/User"
              }
            ],
            "nullable": true
          },
          "collective": {
            "title": "Collective",
            "type": "boolean",
            "default": false
          }
        },
        "description": "The frontend asks the backend for a task."
      },
      "TaskRequestType": {
        "title": "TaskRequestType",
        "enum": [
          "random",
          "summarize_story",
          "rate_summary",
          "initial_prompt",
          "prompter_reply",
          "assistant_reply",
          "rank_initial_prompts",
          "rank_prompter_replies",
          "rank_assistant_replies",
          "label_initial_prompt",
          "label_assistant_reply",
          "label_prompter_reply"
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "TextLabels": {
        "title": "TextLabels",
        "required": [
          "user",
          "text",
          "labels",
          "message_id"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "enum": [
              "text_labels"
            ],
            "type": "string",
            "default": "text_labels"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "labels": {
            "title": "Labels",
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "message_id": {
            "title": "Message Id",
            "type": "string",
            "format": "uuid"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string",
            "format": "uuid"
          }
        },
        "description": "A set of labels for a piece of text."
      },
      "TextReplyToMessage": {
        "title": "TextReplyToMessage",
        "required": [
          "user",
          "message_id",
          "user_message_id",
          "text"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "enum": [
              "text_reply_to_message"
            ],
            "type": "string",
            "default": "text_reply_to_message"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "message_id": {
            "title": "Message Id",
            "type": "string"
          },
          "user_message_id": {
            "title": "User Message Id",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "minLength": 1,
            "type": "string"
          }
        },
        "description": "A user has replied to a message with text."
      },
      "User": {
        "title": "User",
        "required": [
          "id",
          "display_name",
          "auth_method"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "auth_method": {
            "title": "Auth Method",
            "enum": [
              "discord",
              "local"
            ],
            "type": "string"
          }
        }
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "APIKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      },
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
