Skip to content

Commit

Permalink
* Add Dependabot
Browse files Browse the repository at this point in the history
* Add CodeQL scanner
* Lock libraries
* More linters
* Fix logo URL
  • Loading branch information
asofter committed Aug 10, 2023
1 parent a7cde32 commit 908e637
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: "all"
open-pull-requests-limit: 2
27 changes: 27 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: codeql

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 13 * * 1"
workflow_dispatch:

jobs:
analyze:
permissions:
actions: read
contents: read
security-events: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: github/codeql-action/init@v1
with:
languages: python
- uses: github/codeql-action/analyze@v1
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: end-of-file-fixer
types: [ python ]
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
args: [ --line-length=100, --exclude="" ]
Expand All @@ -24,7 +27,7 @@ repos:
# and this tool removes unused imports, which may be providing
# necessary side effects for the code to run
- repo: https://github.com/PyCQA/autoflake
rev: v1.6.1
rev: v2.2.0
hooks:
- id: autoflake
args:
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-

## [0.0.3] - 2023-08-10

### Added
- Dependabot support
- CodeQL support
- More pre-commit hooks to improve linters

### Fixed
- Locked libraries in `requirements.txt`
- Logo link in README

## [0.0.2] - 2023-08-07

### Fixed

- Fixed missing `.json` files in the package

## [0.0.1] - 2023-08-07

### Added
Expand Down Expand Up @@ -38,4 +55,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Toxicity](./llm_guard/output_scanners/toxicity.py)

[Unreleased]: https://github.com/laiyer-ai/llm-guard/commits/main
[0.0.1]: https://github.com/laiyer-ai/llm-guard/compare/v0.0.0...v0.0.1
[0.0.3]: https://github.com/laiyer-ai/llm-guard/commits/v0.0.3
[0.0.2]: https://github.com/laiyer-ai/llm-guard/commits/v0.0.2
[0.0.1]: https://github.com/laiyer-ai/llm-guard/commits/v0.0.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![LLM-Guard Logo](./docs/logo.png)
![LLM-Guard Logo](https://github.com/laiyer-ai/llm-guard/blob/a7cde324dec3118ebe8427da1a9e15fbd03ce5fe/docs/logo.png?raw=true)

# LLM Guard - The Security Toolkit for LLM Interactions

Expand Down
4 changes: 2 additions & 2 deletions llm_guard/input_scanners/token_limit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import List
from typing import List, Optional

import tiktoken

Expand All @@ -18,7 +18,7 @@ def __init__(
self,
limit: int = 4096,
encoding_name: str = "cl100k_base",
model_name: str = None,
model_name: Optional[str] = None,
):
"""
Initializes TokenLimit with a limit, encoding name, and model name.
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black
pytest
pytest-cov
isort
autoflake
autoflake==2.2.0
black==23.7.0
isort==5.12.0
pytest==7.4.0
pytest-cov==4.1.0
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sentence-transformers
spacy
transformers
xformers
nltk
tiktoken
presidio-anonymizer
presidio-analyzer
nltk==3.8.1
presidio-analyzer==2.2.33
presidio-anonymizer==2.2.33
sentence-transformers==2.2.2
spacy==3.6.1
tiktoken==0.4.0
transformers==4.31.0
xformers==0.0.20
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def parse_requirements(file_name: str) -> List[str]:

setuptools.setup(
name="llm-guard",
version="0.0.2",
version="0.0.3",
author="Laiyer.ai",
author_email="hello@laiyer.ai",
description=(
Expand Down

0 comments on commit 908e637

Please sign in to comment.