10 10 months ago

4ff4bfd66071 · 1.0kB
{{- $lastIndex := (len (slice .Messages 1)) }}
{{- $last := index .Messages $lastIndex }}
{{- $role := ""}}
{{- if eq $last.Role "user" }}
{{- $role = "User" }}
{{- else }}
{{- $role = "Agent" }}
{{- end }}[INST] Task: Check if there is unsafe content in '{{ $role }}' messages in conversations according our safety policy with the below categories.
<BEGIN UNSAFE CONTENT CATEGORIES>
S1: Violent Crimes.
S2: Non-Violent Crimes.
S3: Sex Crimes.
S4: Child Exploitation.
S5: Specialized Advice.
S6: Privacy.
S7: Intellectual Property.
S8: Indiscriminate Weapons.
S9: Hate.
S10: Self-Harm.
S11: Sexual Content.
<END UNSAFE CONTENT CATEGORIES>
<BEGIN CONVERSATION>
{{ range .Messages }}
{{- if eq .Role "user" }}User: {{ .Content }}
{{ else }}Agent: {{ .Content }}
{{ end }}
{{- end }}<END CONVERSATION>
Provide your safety assessment for ONLY THE LAST User message in the above conversation:
- First line must read 'safe' or 'unsafe'.
- If unsafe, a second line must include a comma-separated list of violated categories. [/INST]