This is a chatbot API for Julio_GPT made with Python using the Flask framework
- Initialize your virtual environment
- Install the dependencies in the requirements.txt file
- Make a file named:
env.pyand enter this variables: yourOPENAI_API_KEYfrom the OpenAI key and the url of your Flask server inBACKEND_SERVER - Upload your Markdown files with which you will train your AI into the
Markdownsdirectory, the AI will take the first topic "#" as a reference and finish that section (embbeding) with "###" so classify your sections or themes well - In the console run:
flask --app app.py --debug run - Train AI by request to
/process - Ask your question with a request to
/query?text= - Ready!
/process -> the process to train your AI
/query?text= -> this endpoint makes a question to your AI, send your question by the args
the project is made with Flask, the project is a simple API that communicates with two services: OpenAI and ChromaDb. ChromaDB serves as a vector database and thus create embeddings, which is expensive in terms of tokens or use refers to the OpenAI API, instead OpenAI is used in conjunction with the project in order to respond sensibly and conditionally with the indicated training
The training is based on using Markdown files with the content you want to train, it can be kitchen items or the desired theme. AI will understand and train
The AI will seek to classify the files by the main theme or h1 of the Markdowns which is "#", so your topic must be concise and clear so that the AI is easier to save and search for that topic
The AI will separate each topic or section (embedding) by a sub-sub-topic or a "###", from there, the AI will take the previous text as a separate section or topic and take the new one as a new section or topic. Eg :
'# Methods to center a div
blablablabla'
'###'
'# How to import this into JS'
'blablabla. "'
Flask: https://flask.palletsprojects.com/en/3.0.x/
ChromaDB: https://docs.trychroma.com/
OpenAI: https://platform.openai.com/
- Make a better code 💩
- Refact the code ♻️
- Change de Endpoint
/processto/train⏰ - Add to
env.pya variableOPENAI_PROMPTto a better access to modify it 🔨 - Add speech AI 🤖