Giter VIP home page Giter VIP logo

confluence-chatbot's Introduction

Description

Command line tool that combines the power of ChatGPT with your Confluence Wiki to create a chatbot that knows your internal documentation

Installation

Requirements

  • Docker must be installed on your system
  • you need a Confluence instance in the cloud and a personal API token (PAT) for remote access to the contents of your wiki
  • last but not least, you need an OpenAI account with a credit balance

Once these requirements are met, you are ready to go. The installation is done in four simple steps:

1. ️Clone the Repository Clone the repo to a local directory.

git clone https://github.com/dirk-weimar/confluence-chatbot

2. Create Dockerfile Create a file named Dockerfile with the following content in the root directory of the app:

# Use an official Python runtime as a parent image
FROM python:3.10

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 80

# Define environment variable
ENV OPENAI_API_KEY 'your-openai-api-key'
ENV CONFLUENCE_URL 'your-confluence-url'
ENV CONFLUENCE_USERNAME 'your-confluence-username'
ENV CONFLUENCE_API_TOKEN 'your-confluence-api-key'

# Define the standard acrion
ENV ACTION 'start-chatbot'

# Run app.py when the container launches
CMD ["python", "app.py"]

3. Build the app Change to the root directory and build the app locally using Docker. cd confluence-chatbot

docker build -t confluence-chatbot .

4. Configuration Populate the environment variables in the Dockerfile you just created with your real connection data for Confluence and OpenAI. In the app.py file, set the range keys of the Confluence spaces you want to use. You can specify one or more spaces.

confluence_spaces = ['TST', 'SYS']

Running the App

Now you're ready to import your data from Confluence. Start the app with the ACTION "collect-data":

docker run -it --rm -v $(pwd):/app -e ACTION=collect-data confluence-chatbot
# output
Load information from the Confluence space TST ...
44 pages loaded -> split into 47 pages
Add embeddings ...............................................
CSV file data/pages_data_TST.csv written

Your chatbot is ready to go. Start it (without the ACTION parameter this time) and ask it questions that require specialized knowledge from your wiki to answer:

docker run -it --rm -v $(pwd):/app confluence-chatbot

To exit the app, type "exit" into the console instead of a question and confirm with Enter.

confluence-chatbot's People

Contributors

dirk-weimar 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.