Metadata-Version: 2.1
Name: chat-rag
Version: 0.1.69
Summary: 
Author: Diego Peláez Paquico
Author-email: diego.pelaez@with-madrid.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: accelerate (>=0.21.0,<0.22.0)
Requires-Dist: aiohttp (>=3.8.5,<4.0.0)
Requires-Dist: anthropic (==0.18.1)
Requires-Dist: autoawq (==0.1.7)
Requires-Dist: certifi (>=2023.7.22,<2024.0.0)
Requires-Dist: cryptography (>=41.0.4,<42.0.0)
Requires-Dist: ctransformers (>=0.2.10,<0.3.0)
Requires-Dist: einops (>=0.6.1,<0.7.0)
Requires-Dist: mistralai (==0.0.9)
Requires-Dist: numpy (==1.23.5)
Requires-Dist: openai (>=1.3.4,<2.0.0)
Requires-Dist: pandas (==1.4.4)
Requires-Dist: pillow (>=10.1.0,<11.0.0)
Requires-Dist: protobuf (==3.20.2)
Requires-Dist: pyarrow (>=12.0.0,<13.0.0)
Requires-Dist: python-dotenv (>=0.21.0,<0.22.0)
Requires-Dist: ragatouille (>=0.0.8.post2,<0.0.9)
Requires-Dist: sentence-transformers (>=2.3.0,<3.0.0)
Requires-Dist: torch (==2.2.2)
Requires-Dist: torchvision (==0.17.2)
Requires-Dist: tqdm (>=4.65.0,<5.0.0)
Requires-Dist: transformers (>=4.38.2,<5.0.0)
Requires-Dist: unstructured-inference (==0.7.21)
Requires-Dist: unstructured[pdf] (==0.12.0) ; python_version >= "3.10" and python_version < "3.12"
Requires-Dist: urllib3 (>=1.26.18,<2.0.0)
Description-Content-Type: text/markdown

# ChatFAQ NLP Engine

This is the NLP Engine for ChatFAQ. It is divided in two modules:

1. Information Retrieval: This module is responsible for retrieving the most relevant answer to a given question.
2. Chatbot: This module is responsible for generating a response to the given question based on the retrieved answer and chat with the user.

# Information Retrieval

The `Retriever` is the main class for the information retrieval system. It takes as input a question (query) and a context and returns the most relevant sentences from the context to the query. This is done using embeddings and the dot product to compute the similarity between the query and the context sentences.


# Chatbot


## Chatbot

The `RetrieverAnswerer` is the main class for the chatbot. It takes as input a question (query) and a context and returns a response to the query. This is done by first retrieving the most relevant sentences from the context to the query and then generating a response based on the retrieved sentences.


# Publish package

### PYPI test

add repository to poetry config

    poetry config repositories.test-pypi https://test.pypi.org/legacy/

get token from https://test.pypi.org/manage/account/token/

store token using

    poetry config pypi-token.test-pypi pypi-YYYYYYYY

### PYPI production

get token from https://pypi.org/manage/account/token/

store token using

    poetry config pypi-token.chat-rag pypi-XXXXXXXX

Each time you need to publish

Bump version

    poetry version prerelease

or

    poetry version patch

Then build

    poetry build

### Poetry Publish

To TestPyPi

    poetry publish -r test-pypi

To PyPi

    poetry publish

