Coder Social home page Coder Social logo

data-questionnaire-agent's Introduction

Data Wellness Q&A Chatbot

This is a reverse chatbot that asks the users questions about data integration practices and then gives advice based on a body of knowledge. This version operates a bit like an agent which tries to gather enough information to be able to give advice. So it may ask an unspecified number of questions.

We have used a specially changed version of the [Chainlit][https://chainlit.io] library that you can install from the wheels folder.

Setup

We suggest to use Conda to manage the virtual environment and then install poetry.

conda activate base
conda remove -n data_integration_questionnaire_agent --all
conda create -n data_integration_questionnaire_agent python=3.11
conda activate data_integration_questionnaire_agent
pip install poetry

Installation

poetry install
poetry add --editable ./wheels/chainlit-0.7.8.6-py3-none-any.whl

Running

chainlit run .\data_questionnaire_agent\ui\data_questionnaire_chainlit.py --port 8080

Configuration

This is the content of the .env file

OPENAI_API_KEY=<open-api-key>
# This model does not seem to perform too well.
# OPENAI_MODEL=gpt-4-1106-preview
OPENAI_MODEL=gpt-4-0613
REQUEST_TIMEOUT=300

VERBOSE_LLM=true
LANGCHAIN_CACHE=false
CHATGPT_STREAMING=false

UI_TIMEOUT = 60

# Email related
MAIL_FROM_PERSON=<mail sender>
MAIL_USER=<some valid email id>
MAIL_PASSWORD=<mail password>
MAIL_FROM=<some valid email sender>
MAIL_SERVER=smtp.gmail.com:587

# General stuff
PROJECT_ROOT=/development/playground/langchain/data_questionnaire_agent
QUESTION_CACHE_FOLDER=/tmp/data_questionnaire_agent/cache

# PDF Related
WKHTMLTOPDF_BINARY=/Program Files/wkhtmltopdf/bin/wkhtmltopdf.exe
TEMPLATE_LOCATION=/development/playground/langchain/data_questionnaire_agent/templates
PDF_FOLDER=/tmp/data_questionnaire_agent/pdfs

# Whether to show the task list or not
TASKLIST=false

# UI
SHOW_CHAIN_OF_THOUGHT=true

# Embedding related
# The following property is where your knowledge base is located
RAW_TEXT_FOLDER=/development/playground/langchain/data_questionnaire_agent/docs/raw_text
EMBEDDINGS_PERSISTENCE_DIR=/development/playground/langchain/data_questionnaire_agent/embeddings
EMBEDDINGS_CHUNK_SIZE=2500
SEARCH_RESULTS_HOW_MANY=2

# Question generation related
QUESTIONS_PER_BATCH=1
# Minimum questions asked before giving advice
MINIMUM_QUESTIONNAIRE_SIZE=4

# Token limit for chatgpt 4. Important to extend the context as much as possible using the vector DB search
# This could be higher as the TPM increased on the 6th of November
TOKEN_LIMIT=6000

# Not in use
IMAGE_LLM_TEMPERATURE=0.9

# Show session cost
SHOW_SESSION_COST=false
OPENAI_RETRY_ATTEMPTS=3
OPENAI_WAIT_FIXED=30

Here is the content of the config.toml file in the .chainlit folder:

[project]
# Whether to enable telemetry (default: true). No personal data is collected.
enable_telemetry = true

# List of environment variables to be provided by each user to use the app.
user_env = []

# Duration (in seconds) during which the session is saved when the connection is lost
session_timeout = 3600

# Enable third parties caching (e.g LangChain cache)
cache = false

# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
# follow_symlink = false

[features]
# Show the prompt playground
prompt_playground = true

[UI]
# Name of the app and chatbot.
name = "Chatbot"

# Description of the app and chatbot. This is used for HTML tags.
# description = ""

# Large size content are by default collapsed for a cleaner ui
default_collapse_content = true

# The default value for the expand messages settings.
default_expand_messages = false

# Hide the chain of thought details from the user in the UI.
hide_cot = false

# Link to your github repo. This will add a github button in the UI's header.
github = "https://onepointltd.com"

# Specify a CSS file that can be used to customize the user interface.
custom_css = '/public/css/styles.css'

# The text
watermark_text = "Built by"

# Override default MUI light theme. (Check theme.ts)
[UI.theme.light]
    #background = "#FAFAFA"
    #paper = "#FFFFFF"

    [UI.theme.light.primary]
        #main = "#F80061"
        #dark = "#980039"
        #light = "#FFE7EB"

# Override default MUI dark theme. (Check theme.ts)
[UI.theme.dark]
    #background = "#FAFAFA"
    #paper = "#FFFFFF"

    [UI.theme.dark.primary]
        #main = "#F80061"
        #dark = "#980039"
        #light = "#FFE7EB"


[meta]
generated_by = "0.7.1"

data-questionnaire-agent's People

Contributors

onepointconsulting 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.