thiagomosantos / rag-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function: Python "rag"

Introduction

This repository contains a project that create serverless function 'Talk to PDF' written in Python. You are able to ask questions about the content of a PDF file. You can deploy it on DigitalOcean's App Platform as a Serverless Function component. Documentation is available at https://docs.digitalocean.com/products/functions.

Requirements

Deploying the Function

# clone this repo
git clone git@github.com:thiagoms1987/rag-app.git
# deploy the project, using a remote build so that compiled executable matched runtime environment
> doctl serverless deploy rag-app --remote-build
Deploying 'rag-app'
  to namespace 'fn-...'
  on host 'https://faas-...'
Submitted action 'rag' for remote building and deployment in runtime python:default (id: ...)

Deployed functions ('doctl sls fn get <funcName> --url' for URL):
  - rag/rag

Using the Function

doctl serverless functions invoke rag/rag -p userprompt:message.
{
  "response": "message"
}

To send a query using curl:

curl -X PUT -H 'Content-Type: application/json' {your-DO-app-url} -d '{"userprompt":"message"}' 

Learn More

You can learn more about Functions and App Platform integration in the official App Platform Documentation.

About


Languages

Language:Jupyter Notebook 69.6%Language:Python 29.8%Language:Shell 0.6%