Skip to content

Commit

Permalink
Merge pull request #11 from nightfallai/reorganize-files
Browse files Browse the repository at this point in the history
move code into examples directory
  • Loading branch information
cmshanahan authored Jul 18, 2024
2 parents 1488a22 + 6710f44 commit 51f013b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 4,526 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v4"
- name: install poetry
run: pip install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
cache: 'pip'
- name: install
run: poetry install --with=dev
run: pip install -r requirements.txt
- name: check imports
run: poetry run isort --check .
run: isort --check .
- name: check formatting
run: poetry run black --check .
run: black --check .
- name: run linter
run: poetry run pylint .
run: pylint --recursive y .
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions langchain_example.py → examples/langchain_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def _call(self, inputs: Dict[str, str]) -> Dict[str, str]:
)
sanitized_text = redacted_payload[0] if redacted_payload[0] else text
print(f"\nsanitized input:\n {sanitized_text}")
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Error in sanitizing input: {e}")
except Exception as exc: # pylint: disable=broad-exception-caught
print(f"Error in sanitizing input: {exc}")
sanitized_text = text
return {self.output_key: sanitized_text}

Expand Down
File renamed without changes.
4,486 changes: 0 additions & 4,486 deletions poetry.lock

This file was deleted.

31 changes: 0 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
[tool.poetry]
name = "genai-prompt-sanitization"
version = "0.1.0"
description = "This repository provides examples of using Firewall for AI APIs to sanitize GenAI prompts for popular LLM services and frameworks using Python."
authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
apify-client = "^1.7.0"
chromadb = "^0.5.3"
langchain = "^0.2.6"
langchain-community = "^0.2.6"
openai = "^1.35.10"
python-dotenv = "^1.0.1"
streamlit = "^1.36.0"
tiktoken = "^0.7.0"
anthropic = "^0.30.1"
nightfall = { git = "https://github.com/nightfallai/nightfall-python-sdk.git" }
langchain-anthropic = "^0.1.19"

[tool.poetry.group.dev.dependencies]
pylint = "^3.2.5"
black = "^24.4.2"
isort = "^5.13.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
package-mode = false

[tool.black]
line-length = 88

Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ tiktoken ~= 0.7.0
anthropic ~= 0.30.1
langchain_anthropic ~= 0.1.19
nightfall ~= 1.4.1
pylint ~= 3.2.5
black ~= 24.4.2
isort ~= 5.13.2

0 comments on commit 51f013b

Please sign in to comment.