{ "openapi": "3.0.1", "info": { "title": "ABChatWithPDF", "version": "v1" }, "servers": [ { "url": "https://ab-pdf.abplugins.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. Start calling this endpoint after the user informed that the pdf file was uploaded. 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." } } } } } } } } } }, "components": { "schemas": { "QueryOnPdfBody": { "type": "object", "properties": { "query": { "type": "string", "description": "The query or question to ask based on the PDF document." } } }, "SummaryResponse": { "type": "object", "properties": { "content": { "type": "string", "description": "The summary or text version of the content from the specified URL." }, "responseInstructions": { "type": "string", "description": "Set of actions to do." } } }, "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." } } } } } } }