Skip to content

educorvi/edi.chatgpt4plone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edi.chatgpt4plone

This add-on is a "proof of concept" (poc) prototype for integration of ChatGPT3 in Web-CMS Plone. This add-on and the additional system enhancement "gpt-poc" are working on the shoulders of the great LLM-Framework (LLM = Large Language Model) LangChain. In our first release we assume that the plone site is connected with an local elastic search engine. For the integration of elastic search in plone we use the add-on collective.elasticsearch.

The base idea is to use the well known LLM ChatGPT3 from openAI together with an own content-database provided by an elastic search engine. The AI-based creative process to generate answers for prompted questions should use own information sources only!

The system enhancement gpt-poc will start a websocket-server based application to build a "bridge" between Plone Web-CMS, LLM (using LangChain), the
elastic search engine and some other small dependencies illustrated in figure-1.

Concept Overview

With this concept the ChatGPT3 Integration will work for other web application environments and other Web-CMS Systems too. And because we use LangChain we are able to change the LLM.

Thanks to all authors and conributors of used dependencies.

Requirements

Installation

Install and configure the linux system enhancement gpt-poc

gpt-poc will therefore deliver a client-part (javascript web-component) and a backend-part for communication with Plone Web-CMS, LLM and elastic search engine.

Install gpt-poc with ubuntu package manager

sudo add-apt-repository ppa:educorvi/experimental
sudo apt update
sudo apt install python3-gpt-poc-backend

After successfully installation you have to configure the gpt-poc backend by the following steps:

cd /etc/gpt-poc
sudo cp conf.template.yaml conf.yaml
sudo vi conf.yaml

Example:

OpenAI:
  API_KEY: sk-xxxxxxxxxxxxxxxbkFJS9KbUAQtjNAWh4y0X6zE

ElasticSearch:
  url: "http://localhost:9200"
  index: inwiportal-portal_catalog_1
  result_size: 2

Websocket:
  port: 8765

Now you can start|stop the websocket server with the following commands:

sudo systemctl start gpt-poc-backend
sudo systemctl stop gpt-poc-backend

Check if websocket server runs correct

sudo systemctl status gpt-poc-backend
● gpt-poc-backend.service - GPT POC Backend Service
     Loaded: loaded (/lib/systemd/system/gpt-poc-backend.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-06-10 19:21:41 UTC; 5s ago
   Main PID: 2088110 (gpt-poc-backend)
      Tasks: 4 (limit: 9257)
     Memory: 80.4M
        CPU: 4.761s
     CGroup: /system.slice/gpt-poc-backend.service
             └─2088110 /usr/bin/python3 /usr/bin/gpt-poc-backend

Jun 10 19:21:41 ubuntu-8gb-nbg1-2 systemd[1]: Started GPT POC Backend Service.

Install gpt-poc via github checkout in local homefolder

cd ~
git clone https://github.com/educorvi/gpt-poc.git
cd gpt-poc/backend
sudo make install

After successfully installation you have to configure the gpt-poc backend by the following steps:

cd /etc/gpt-poc
sudo cp conf.template.yaml conf.yaml
sudo vi conf.yaml

Example:

OpenAI:
  API_KEY: sk-xxxxxxxxxxxxxxxbkFJS9KbUAQtjNAWh4y0X6zE

ElasticSearch:
  url: "http://localhost:9200"
  index: inwiportal-portal_catalog_1
  result_size: 2

Websocket:
  port: 8765

To start the websocket-server in foreground do the following:

cd ~
cd gpt-poc/backend
./gpt-poc-backend

To stop websocket-server type: CTRL-C

Install and configure addons for CMS Plone

Clone the package edi.chatgpt4plone to src directory of your buildout instance:

cd src
git clone https://github.com/educorvi/edi.chatgpt4plone.git

Install edi.chatgpt4plone and collective.elasticsearch by adding it to your buildout::

    [buildout]

    ...

    eggs =
        edi.chatgpt4plone
        collective.elasticsearch

    develop = 
        src/edi.chatgpt4plone

and then running bin/buildout

After successful installation you must install and configure both addons for your Plone site via plone_controlpanel:

  • you must enable elastic search an rebuild the portal-catalog
  • for this initial relase only the following config-entries for chatgpt4plone are required:
    • URI of websocket server: ws://your.server.domain
    • Port of websocket server: 8765 # Default Value

Sources

gpt-poc

https://github.com/educorvi/gpt-poc

edi.chatgpt4plone

https://github.com/educorvi/edi.chatgpt4plone

Support

Issue Tracker

If you are having issues, please let us know. [email protected]

License

The project is licensed under the MIT Licence.

About

No description, website, or topics provided.

Resources

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE.GPL
Unknown
LICENSE.rst

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published