LokingAI-Document-QA

FREEMIUM
Health Check

N/A

README

Document processing app v0.1.0

> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Base URLs:

Default

desc__get

> Code samples


const headers = {
  'Accept':'application/json'
};

fetch('/document/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/document/', headers = headers)

print(r.json())

GET /

Desc

Get application description.

Returns a simple response containing the description of the application.

Returns:

  • ApiResponse: A response containing the application description.

Example Response:

{
    "data": {
        "desc": "Document processing app"
    }
}

> Example responses

> 200 Response

{
  "error": "string",
  "data": null
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiResponse

answer_questions_answer_questions_post

> Code samples

const inputBody = '{
  "payload": "string",
  "questions": "string"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json'
};

fetch('/document/answer-questions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

r = requests.post('/document/answer-questions', headers = headers)

print(r.json())

POST /answer-questions

Answer Questions

Answer questions based on an uploaded document.

This endpoint takes an uploaded document file and a list of questions. It processes the document
to find answers to the questions.

Parameters:

  • payload: The uploaded document file.
  • questions: A comma-separated list of questions.

Returns:

  • DocumentQuestionAnswerResponse: A response containing answers to the questions.

Example Request:

POST /answer-questions
Content-Type: multipart/form-data
Body: <Upload a PDF or image file>
Form Data: questions=Question1,Question2,Question3

Example Response:

{
    "data": [
        {
            "question": "Question1",
            "answer": "Answer1",
            "score": 0.85,
            "start": 10,
            "end": 20
        },
        {
            "question": "Question2",
            "answer": "Answer2",
            "score": 0.75,
            "start": 30,
            "end": 40
        },
        {
            "question": "Question3",
            "answer": "Answer3",
            "score": 0.92,
            "start": 50,
            "end": 60
        }
    ]
}

> Body parameter

payload: string
questions: string

Parameters

Name In Type Required Description
body body Body_answer_questions_answer_questions_post true none

> Example responses

> 200 Response

{
  "error": "string",
  "data": [
    {
      "question": "string",
      "answer": "string",
      "score": 0,
      "start": 0,
      "end": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response DocumentQuestionAnswerResponse
422 Unprocessable Entity Validation Error HTTPValidationError

Schemas

ApiResponse




{
  "error": "string",
  "data": null
}

ApiResponse

Properties

Name Type Required Restrictions Description
error any true none none

anyOf

Name Type Required Restrictions Description
» anonymous string false none none

or

Name Type Required Restrictions Description
» anonymous null false none none

continued

Name Type Required Restrictions Description
data any true none none

Body_answer_questions_answer_questions_post




{
  "payload": "string",
  "questions": "string"
}

Body_answer_questions_answer_questions_post

Properties

Name Type Required Restrictions Description
payload string(binary) true none none
questions string true none none

DocumentQuestionAnswer




{
  "question": "string",
  "answer": "string",
  "score": 0,
  "start": 0,
  "end": 0
}

DocumentQuestionAnswer

Properties

Name Type Required Restrictions Description
question string true none none
answer string true none none
score number true none none
start integer true none none
end integer true none none

DocumentQuestionAnswerResponse




{
  "error": "string",
  "data": [
    {
      "question": "string",
      "answer": "string",
      "score": 0,
      "start": 0,
      "end": 0
    }
  ]
}

DocumentQuestionAnswerResponse

Properties

Name Type Required Restrictions Description
error any true none none

anyOf

Name Type Required Restrictions Description
» anonymous string false none none

or

Name Type Required Restrictions Description
» anonymous null false none none

continued

Name Type Required Restrictions Description
data [DocumentQuestionAnswer] true none none

HTTPValidationError




{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

HTTPValidationError

Properties

Name Type Required Restrictions Description
detail [ValidationError] false none none

ValidationError




{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

ValidationError

Properties

Name Type Required Restrictions Description
loc [anyOf] true none none

anyOf

Name Type Required Restrictions Description
» anonymous string false none none

or

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
msg string true none none
type string true none none
Followers: 1
API Creator:
Rapid account: Josuebrunel
josuebrunel
josuebrunel
Log In to Rate API
Rating: 5 - Votes: 1