Skip to content

Commit

Permalink
Merge branch 'main' into renovate/fastapi-0.x-lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pigri authored Dec 4, 2024
2 parents 2bbd4d9 + 1c9eb8f commit 933a0b9
Show file tree
Hide file tree
Showing 17 changed files with 469 additions and 625 deletions.
29 changes: 29 additions & 0 deletions config_example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
rules:




input:
- name: "language_detection"
type: "language_detection"
Expand Down Expand Up @@ -62,6 +66,31 @@ rules:
action:
type: "block"
# - type: "monitoring" # logging
- name: "llamaguard_check"
type: "llama_guard"
enabled: true
order_number: 4
config:
plugin_name: "llama_guard"
threshold: 0.5
relation: ">"
# can be left empty, in that case every categgory is included.
#categories: ["S1","S7"]

action:
type: "block"

- name: "PromptGuard Injection Detection"
type: "prompt_guard"
enabled: true
order_number: 5
config:
plugin_name: "prompt_guard"
threshold: 0.7
relation: ">"
temperature: 3.0
action:
type: "block"
output:
- name: "pii_example"
type: "pii_filter"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/swaggo/http-swagger v1.3.4
github.com/swaggo/swag v1.16.4
github.com/tiktoken-go/tokenizer v0.2.0
golang.org/x/sync v0.8.0
golang.org/x/sync v0.9.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/postgres v1.5.9
gorm.io/gorm v1.25.12
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
1 change: 1 addition & 0 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ type Config struct {
Url string `mapstructure:"url,omitempty"`
ApiKey string `mapstructure:"api_key,omitempty"`
PIIService interface{} `mapstructure:"piiservice,omitempty"`
Categories []string `mapstructure:"categories,omitempty"`
}

// Add this function to set default values
Expand Down
135 changes: 0 additions & 135 deletions lib/llamaguard/handlers.go

This file was deleted.

103 changes: 0 additions & 103 deletions lib/promptguard/handlers.go

This file was deleted.

Loading

0 comments on commit 933a0b9

Please sign in to comment.