PAAIG Secure Chat is a conversational AI chatbot
Project description
PAIG Securechat
Secure Chat is a conversational AI chatbot . Secure chat allows users to create conversations with an AI chatbot which can optionally be governed by PAIG. Secure chat library provides an easy to use, plugable platform which will allow developers/users to have open sourced chatbot python library.
Contents
Installation
PAIG Secure chat is a python library which can be installed using pip.
pip install paig_securechat
Usage
PAIG Secure chat can be used in following ways:
- Before starting the securechat, you need to create a PAIG application and generate an API key for the application.
-
To create a new application and generate an API key, follow these steps:
-
Login to PAIG.
-
Go to
Paig Navigator→AI Applicationsand click theCREATE APPLICATIONbutton at the top-right. -
A dialog box will open where you can enter the details of your application.
-
Once the Application is created:
- Navigate to
Paig Navigator→AI Applicationsand select the application for which you want to generate the API key. - In the
API KEYStab, click theGENERATE API KEYbutton in the top-right corner. - Provide a
NameandDescription, and set anExpiry, or select theMax Validity (1 year)checkbox to use the default expiry.
Note: Once the API key is generated, it will not be shown again. Ensure you copy and securely store it immediately after generation.
- Navigate to
-
-
To initialize the PAIG Shield library in your SecureChat application, export the
PAIG_APP_API_KEYas an environment variable:export PAIG_APP_API_KEY=<<AI_APPLICATION_API_KEY>>
OR
Create a file calledpaig.keyin thecustom-configsfolder and save the AI Application API key in it:echo "<<AI_APPLICATION_API_KEY>>" > custom-configs/paig.key
-
- Run as a service: You can simply run the secure chat as a service by running following command:
paig_securechat run
To get the help for the command and see all available [OPTIONS], you can run the following command:
paig_securechat --help
Example:
paig_securechat run --port 2324 --host 0.0.0.0 --openai_api_key <API_KEY>
- Run as a library: You can run PAIG Secure chat in background by importing the library in your python code. Please run help command to see all available options you can pass while calling launch_app method.
from paig_securechat import launcher
# Start the PAIG Secure Chatbot
session = launcher.launch_app()
# To start without PAIG Shield
# session = launcher.launch_app(disable_paig_shield_plugin=True)
# To get active sessions
active_session = launcher.get_active_session()
print(active_session)
# To view the chatbot in the browser/Iframe
print(active_session.url)
# To view the chatbot in the Iframe
active_session.view()
# To stop the chatbot
launcher.close_app()
[!NOTE] We recommend to use PAIG Shield config for governance of the chatbot.You can opt for insecure mode by providing the
--disable_paig_shield_pluginflag while running the chatbot. You can pass this option in launch_app method as well.
Configuration
PAIG Secure chat provides overlay configuration. You can provide the custom configuration in the following ways:
- Create a new directory in the present working directory of the project with the name
custom-configs. - Create a new custom configuration file named
standalone_config.yamlin thecustom-configsfolder which is provided to the application. - In custom configuration file , user should provide new configuration key-values or override the existing configuration.
- User can configure
response_if_no_docs_foundto provide a custom response when vector DB return no docs, If user want response from AI Model then setresponse_if_no_docs_foundtonull
Example:custom-configs/standalone_config.yaml
#MODELS CONFIG
AI_applications:
file_path: "configs/AI_applications.json"
default_implementation_class: "services.OpenAI_Application.OpenAIClient.OpenAIClient"
response_if_no_docs_found: "I cannot answer this question as there was no context provided"
sales_model:
conversation_history_k: 5
paig_shield_config_file: "custom-configs/privacera-shield-config.json"
disable_conversation_chain: false
vectordb:
index_path: "securechat/sales/index"
data_path: "securechat/sales/data"
vector_type: "chroma"
Configure PAIG Shield Config
PAIG SecureChat provides an option to configure the PAIG Shield Config. You can refer to standalone_config.yaml to see location of the shield config file. All you need to do is to copy PAIG Shield Config file to the location mentioned in the standalone_config.yaml file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paig_securechat-0.0.4-py3-none-any.whl.
File metadata
- Download URL: paig_securechat-0.0.4-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f73e2a84922179a5808e8dff63886a9bcf565870e1a38a66886f96fbd11e67b
|
|
| MD5 |
ab09757040cba1d41078c9b4833a7d52
|
|
| BLAKE2b-256 |
d1ae5216a99dd2e76ffe9c760faa28d318f215451b51c4f15350a592f7e99e94
|