Skip to content

politica-aberta/backend

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Política Aberta

Chat with Portguese political parties.

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Poítica Aberta screen shot

(back to top)

Built With

  • Flask
  • Python
  • OpenAI

(back to top)

Getting Started

This is the backend of Política Aberta, an open source project to help the Portuguese electors to choose their vote. It acts like a chatbot, where users can ask things to political parties and the answer is based on their political program.

Feel free to clone this repo, run it locally and contribute!

Prerequisites

The following prerequisites are needed to run the project:

  • Python
    # Linux
    apt install python3
    
    #OSX
    brew isntall python3
  • [Optional] Docker
    # Linux
    apt install docker
    
    #OSX
    brew install docker

Installation

  1. Clone the repo
    git clone https://github.com/politica-aberta/backend.git && cd backend
  2. Create and activate virtual env
    python -m venv political && source political/bin/activate
  3. Install Python packages
    pip install -r < requirements
  4. Create .env file in the root directory with OPENAI_API_KEY env
    touch .env
    echo "OPENAI_API_KEY=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" > .env

(back to top)

Usage

Run locally

To run the project locally, simply run it with flask cli:

flask run

This will run this api on port 5000

Run with docker

You can also run it with docker

docker compose up --build

(back to top)

Roadmap

  • Change infer_chat_mode to OpenAI function calling
  • revisit system prompt
  • Stream responses
  • Add cache for requests

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Any contributions are greatly appreciated :)

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the corresponding tag.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Hugo Pitorro - xtwigs - pitorro@politica-aberta.pt

José Martinho - jmartinhoj - martinho@politica-aberta.pt

Project Link: https://github.com/politica-aberta/backend

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •