Code Monkey home page Code Monkey logo

ai_planet's Introduction

AI PLANET

Objective:

Develop a full-stack application that allows users to upload PDF documents and ask questions regarding the content of these documents. The backend will process these documents and utilize natural language processing to provide answers to the questions posed by the users.

Tools and Technologies:

Backend: FastAPI NLP Processing: LangChain/LLamaIndex Frontend: React.js Database: SQLite or PostgreSQL (for storing document metadata, if necessary) File Storage: Local filesystem or cloud storage (e.g., AWS S3) for storing uploaded PDFs

FastAPI

Uplaod PDF file.Post Method:

try {
  const response = axios.post('http://localhost:8000/upload/', formData, {
  headers: {
  'Content-Type': 'multipart/form-data'
  });
  setMessage(`File uploaded successfully: ${response.data.id}`);
  onUploadSuccess(response.data.id);
  return {errors: false}
  } catch (error) {
  }

Success(200) Response:

#body
{
  	"id": 8,
  	"filename": "Full Stack SEO Developer  - Ashraf Uddin.pdf"
}

Error Response:

#body
{
  "detail": "File must be a PDF"
}

Ask qustions.Post Method:

try {
 const response = await fetch(`http://localhost:8000/ask/?document_id=${documentId}&question=${encodeURIComponent(question)}`, {
    method: 'POST',
  	headers: {
    'Content-Type': 'application/json',
    },
  });
  }

Success(200) Response:

#body
{
	"string"
}

Validation Error:


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

ai_planet's People

Contributors

techtobit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.