Skip to content

Commit

Permalink
Merge pull request #46 from privacera/changelogs
Browse files Browse the repository at this point in the history
Changelogs
  • Loading branch information
pravin-bansod authored Sep 6, 2024
2 parents e3f39a9 + 0cfc164 commit 365990c
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 26 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changelog

All changes to this repository can be referred from this file.


### 📚 App-Specific Changelogs
For detailed updates and changes specific to each application, refer to the following links:

- [paig-common Changelog](./paig-common/CHANGELOG.md)
- [paig-server Changelog](./paig-server/CHANGELOG.md)
- [paig-client Changelog](./paig-client/CHANGELOG.md)



## 2024-09-06

### 🔧 CI/CD Integration
Implemented GitHub Actions workflows to automate the development process:

- **Continuous Integration (CI)**:
- Comprehensive testing pipeline for all applications to ensure code quality and functionality.

- **Deployment Pipelines**:
- Automated deployment processes for `paig-server`, `paig-client` and `paig-common`.


### 📚 Documentation Updates
- Updated documentation for installation and usage instructions.


### 📓 Notebooks
- Added jupyter and colab notebooks for quick start.
12 changes: 6 additions & 6 deletions notebooks/paig-os/google-colab/PAIG_OpenAI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"\n",
"This section demonstrates a simple Python application that uses OpenAI for inference. The PAIG Shield is integrated within the application. The PAIG Shield client is initialized using the `setup()` method and is then used to validate the prompts and replies. In this basic GenAI application, the PAIG Shield's `check_access()` method needs to be explicitly called for the prompt and reply. However, when using frameworks like LangChain, PAIG will automatically instrument the code and call the `check_access()` method for all interactions with LLMs and RAGs.\n",
"\n",
"To enforce user or group-specific policies, the calling username should be set as the request context before processing the prompt. This can be done using the `with paig_client_client.create_shield_context(username=username):` syntax.\n",
"To enforce user or group-specific policies, the calling username should be set as the request context before processing the prompt. This can be done using the `with paig_shield_client.create_shield_context(username=username):` syntax.\n",
"\n",
"To stitch together related calls, an optional thread ID can be passed to the `check_access()` method to tie them together.\n",
"\n",
Expand All @@ -260,7 +260,7 @@
"outputs": [],
"source": [
"\n",
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from paig_client.model import ConversationType\n",
"import paig_client.exception\n",
"from openai import OpenAI\n",
Expand All @@ -272,19 +272,19 @@
")\n",
"\n",
"# PAIG supports frameworks like LangChain and VectorDBs like Milvus, OpenSearch. The integration to be considered should be passed as the frameworks parameter.\n",
"paig_client_client.setup(frameworks=[])\n",
"paig_shield_client.setup(frameworks=[])\n",
"\n",
"# Create a function which can be called for the prompts\n",
"def query_as_user(username, prompt_text):\n",
" # Generate a random UUID which will be used to bind a prompt with a reply\n",
" privacera_thread_id = str(uuid.uuid4())\n",
"\n",
" try:\n",
" with paig_client_client.create_shield_context(username=username):\n",
" with paig_shield_client.create_shield_context(username=username):\n",
" print(f\"PROMPT BY USER: {prompt_text}\")\n",
"\n",
" # Validate prompt with Privacera Shield\n",
" updated_prompt_text = paig_client_client.check_access(\n",
" updated_prompt_text = paig_shield_client.check_access(\n",
" text=prompt_text,\n",
" conversation_type=ConversationType.PROMPT,\n",
" thread_id=privacera_thread_id\n",
Expand All @@ -309,7 +309,7 @@
" print(f\"LLM Response: {llm_response}\")\n",
"\n",
" # Validate LLM response with Privacera Shield\n",
" updated_reply_text = paig_client_client.check_access(\n",
" updated_reply_text = paig_shield_client.check_access(\n",
" text=llm_response,\n",
" conversation_type=ConversationType.REPLY,\n",
" thread_id=privacera_thread_id\n",
Expand Down
12 changes: 6 additions & 6 deletions notebooks/paig-os/google-colab/PAIG_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@
},
"outputs": [],
"source": [
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from openai import OpenAI\n",
"\n",
"# Set the OPENAI_API_KEY environment variable or set it here\n",
"openai_client = OpenAI()\n",
"\n",
"paig_client_client.setup(frameworks=[])\n"
"paig_shield_client.setup(frameworks=[])\n"
]
},
{
Expand Down Expand Up @@ -224,7 +224,7 @@
},
"outputs": [],
"source": [
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from paig_client.model import ConversationType\n",
"import paig_client.exception\n",
"import uuid\n",
Expand All @@ -236,11 +236,11 @@
"privacera_thread_id = str(uuid.uuid4())\n",
"\n",
"try:\n",
" with paig_client_client.create_shield_context(username=user):\n",
" with paig_shield_client.create_shield_context(username=user):\n",
" prompt_text = \"Who was the first President of USA and where did they live?\"\n",
" print(f\"User Prompt: {prompt_text}\")\n",
" # Validate prompt with Privacera Shield\n",
" updated_prompt_text = paig_client_client.check_access(\n",
" updated_prompt_text = paig_shield_client.check_access(\n",
" text=prompt_text,\n",
" conversation_type=ConversationType.PROMPT,\n",
" thread_id=privacera_thread_id\n",
Expand All @@ -261,7 +261,7 @@
" llm_response = response.choices[0].message.content\n",
" print(f\"LLM Response: {llm_response}\")\n",
" # Validate LLM response with Privacera Shield\n",
" updated_reply_text = paig_client_client.check_access(\n",
" updated_reply_text = paig_shield_client.check_access(\n",
" text=llm_response,\n",
" conversation_type=ConversationType.REPLY,\n",
" thread_id=privacera_thread_id\n",
Expand Down
12 changes: 6 additions & 6 deletions notebooks/paig-os/jupyter-notebook/PAIG_OpenAI_jupyter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"\n",
"This section demonstrates a simple Python application that uses OpenAI for inference. The PAIG Shield is integrated within the application. The PAIG Shield client is initialized using the `setup()` method and is then used to validate the prompts and replies. In this basic GenAI application, the PAIG Shield's `check_access()` method needs to be explicitly called for the prompt and reply. However, when using frameworks like LangChain, PAIG will automatically instrument the code and call the `check_access()` method for all interactions with LLMs and RAGs.\n",
"\n",
"To enforce user or group-specific policies, the calling username should be set as the request context before processing the prompt. This can be done using the `with paig_client_client.create_shield_context(username=username):` syntax.\n",
"To enforce user or group-specific policies, the calling username should be set as the request context before processing the prompt. This can be done using the `with paig_shield_client.create_shield_context(username=username):` syntax.\n",
"\n",
"To stitch together related calls, an optional thread ID can be passed to the `check_access()` method to tie them together.\n",
"\n",
Expand All @@ -292,7 +292,7 @@
},
"outputs": [],
"source": [
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from paig_client.model import ConversationType\n",
"import paig_client.exception\n",
"from openai import OpenAI\n",
Expand All @@ -304,19 +304,19 @@
")\n",
"\n",
"# PAIG supports frameworks like LangChain and VectorDBs like Milvus, OpenSearch. The integration to be considered should be passed as the frameworks parameter.\n",
"paig_client_client.setup(frameworks=[])\n",
"paig_shield_client.setup(frameworks=[])\n",
"\n",
"# Create a function which can be called for the prompts\n",
"def query_as_user(username, prompt_text):\n",
" # Generate a random UUID which will be used to bind a prompt with a reply\n",
" privacera_thread_id = str(uuid.uuid4())\n",
"\n",
" try:\n",
" with paig_client_client.create_shield_context(username=username):\n",
" with paig_shield_client.create_shield_context(username=username):\n",
" print(f\"PROMPT BY USER: {prompt_text}\")\n",
"\n",
" # Validate prompt with Privacera Shield\n",
" updated_prompt_text = paig_client_client.check_access(\n",
" updated_prompt_text = paig_shield_client.check_access(\n",
" text=prompt_text,\n",
" conversation_type=ConversationType.PROMPT,\n",
" thread_id=privacera_thread_id\n",
Expand All @@ -341,7 +341,7 @@
" print(f\"LLM Response: {llm_response}\")\n",
"\n",
" # Validate LLM response with Privacera Shield\n",
" updated_reply_text = paig_client_client.check_access(\n",
" updated_reply_text = paig_shield_client.check_access(\n",
" text=llm_response,\n",
" conversation_type=ConversationType.REPLY,\n",
" thread_id=privacera_thread_id\n",
Expand Down
12 changes: 6 additions & 6 deletions notebooks/paig-os/jupyter-notebook/PAIG_jupyter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@
},
"outputs": [],
"source": [
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from openai import OpenAI\n",
"\n",
"# Set the OPENAI_API_KEY environment variable or set it here\n",
"openai_client = OpenAI()\n",
"\n",
"paig_client_client.setup(frameworks=[])\n"
"paig_shield_client.setup(frameworks=[])\n"
]
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@
},
"outputs": [],
"source": [
"from paig_client import client as paig_client_client\n",
"from paig_client import client as paig_shield_client\n",
"from paig_client.model import ConversationType\n",
"import paig_client.exception\n",
"import uuid\n",
Expand All @@ -273,11 +273,11 @@
"privacera_thread_id = str(uuid.uuid4())\n",
"\n",
"try:\n",
" with paig_client_client.create_shield_context(username=user):\n",
" with paig_shield_client.create_shield_context(username=user):\n",
" prompt_text = \"Who was the first President of USA and where did they live?\"\n",
" print(f\"User Prompt: {prompt_text}\")\n",
" # Validate prompt with Privacera Shield\n",
" updated_prompt_text = paig_client_client.check_access(\n",
" updated_prompt_text = paig_shield_client.check_access(\n",
" text=prompt_text,\n",
" conversation_type=ConversationType.PROMPT,\n",
" thread_id=privacera_thread_id\n",
Expand All @@ -298,7 +298,7 @@
" llm_response = response.choices[0].message.content\n",
" print(f\"LLM Response: {llm_response}\")\n",
" # Validate LLM response with Privacera Shield\n",
" updated_reply_text = paig_client_client.check_access(\n",
" updated_reply_text = paig_shield_client.check_access(\n",
" text=llm_response,\n",
" conversation_type=ConversationType.REPLY,\n",
" thread_id=privacera_thread_id\n",
Expand Down
6 changes: 6 additions & 0 deletions paig-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# paig-client Changelog
All notable changes to paig-client will be documented in this file.

## [v0.0.1] - 2024-09-06
### Added
- Initial release of the `paig-client`.
9 changes: 9 additions & 0 deletions paig-common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# paig-common Changelog
All changes to paig-common will be documented in this file.

## [v0.0.1] - 2024-09-06
### Added
- Initial release of the `paig-common` shared library.
- Added utility functions for API handling, error management, and data processing.
- Added encryption and decryption functions for data security.
- Added base classes for Async API clients, RBACs.
17 changes: 17 additions & 0 deletions paig-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# paig-server Changelog
All changes to paig-server will be documented in this file.

## [v0.0.2] - 2024-09-06
### Added
- For audit storage Opensearch support added

### Changed
- Improved server startup experience
- Fixed warnings
- Updated dependencies
- Scanner loading time improved


## [v0.0.1] - 2024-08-14
### Added
- Initial release of the `paig-server`.
2 changes: 0 additions & 2 deletions t

This file was deleted.

0 comments on commit 365990c

Please sign in to comment.