{ "openapi": "3.0.1", "info": { "title": "AaronChatPDF", "version": "v1" }, "servers": [ { "url": "https://aaron-pdf.aaronplugins.com" } ], "paths": { "/api/pdf/create-upload-link": { "get": { "summary": "Provides a PDF file upload link for the user.", "operationId": "UploadPdf", "responses": { "200": { "description": "Successful response with the upload link.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseBody" } } } } } } }, "/api/pdf/save-pdf": { "post": { "summary": "Saves a PDF from a provided link.", "operationId": "SavePdfByProvidedLink", "requestBody": { "description": "Body containing the links of the PDF files.", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PdfUrls" } } } }, "responses": { "200": { "description": "Successful response indicating the PDF was saved.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseBody" } } } } } } }, "/api/pdf/query": { "post": { "summary": "Queries the PDF based on the provided input.", "operationId": "QueryOnPdf", "requestBody": { "description": "Body containing the query for the PDF.", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryOnPdfBody" } } } }, "responses": { "200": { "description": "Successful response with the query results.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseBody" } } } }, "400": { "description": "Occurs when there's a validation error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseBody" } } } } } } }, "/api/pdf/check-status": { "get": { "summary": "Checks the status of the uploaded pdf file. If the status is \"success\", you can accept the user's query on the pdf file.'", "operationId": "CheckStatus", "responses": { "200": { "description": "Returns the status of the uploaded pdf file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusBody" } } } } } } }, "/api/pdf/summary": { "get": { "summary": "Summary of Provided Files", "description": "Call this endpoint when the user wants to get the summary of provided files.", "operationId": "summaryProvidedFiles", "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "type": "object", "properties": { "filesSummary": { "type": "array", "items": { "type": "object", "properties": { "fileName": { "type": "string" }, "content": { "type": "string" } } } }, "responseInstructions": { "type": "string", "description": "Set of actions to do." } } } } } } } } }, "/api/pdf/text-summary": { "post": { "summary": "Summary of the provided text.", "description": "Always call this endpoint when user wants to get the summary of provided text or their query starts with 'Summarize the following text'.", "operationId": "TextSummary", "requestBody": { "description": "Body containing the text for summarization.", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummaryOnTextBody" } } } }, "responses": { "200": { "description": "Successful response with the text summary.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummaryResponse" } } } } } } } }, "components": { "schemas": { "QueryOnPdfBody": { "type": "object", "properties": { "query": { "type": "string", "description": "The query or question to ask based on the PDF document." } } }, "ResponseBody": { "type": "object", "properties": { "status": { "type": "string" }, "responseInstructions": { "type": "string" }, "errorMessage": { "type": "string" }, "response": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } }, "StatusBody": { "type": "object", "properties": { "status": { "type": "string", "description": "Returns one of the values: running, success, fail." }, "responseInstructions": { "type": "string", "description": "Set of actions to inform the user about." } } }, "PdfUrls": { "type": "object", "properties": { "urls": { "type": "array", "items": { "type": "string", "description": "The url of the pdf file." } } } }, "SummaryOnTextBody": { "type": "object", "properties": { "text": { "type": "string", "description": "The text to be summarized." } } }, "SummaryResponse": { "type": "object", "properties": { "summary": { "type": "string" }, "responseInstructions": { "type": "string", "description": "Instructions for providing user with the summary." } } } } } }