Skip to content

Commit 4b380bc

Browse files
author
Krish Dholakia
authored
Merge pull request #15 from shin-bot-litellm/fix-yaml-config-v2
fix: correct YAML config format for guardrails
2 parents 0f19074 + 2c759fc commit 4b380bc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Guardrails.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
Documentation
179179
</a>
180180
<a
181-
href="https://github.com/BerriAI/litellm/blob/main/guardrails_registry.json"
181+
href="https://github.com/BerriAI/litellm-guardrails"
182182
target="_blank"
183183
rel="noopener noreferrer"
184184
class="btn btn-secondary"
@@ -289,8 +289,11 @@
289289
<pre class="usage-code"><code>guardrails:
290290
- guardrail_name: "{item.id}"
291291
litellm_params:
292-
guardrail: custom_code.{item.id}
293-
mode: "{item.input_type === 'response' ? 'post_call' : 'pre_call'}"</code></pre>
292+
guardrail: custom_code
293+
mode: "{item.input_type === 'response' ? 'post_call' : 'pre_call'}"
294+
custom_code: |
295+
def apply_guardrail(inputs, request_data, input_type):
296+
... # paste code from above</code></pre>
294297
</div>
295298

296299
<div class="card-footer">

0 commit comments

Comments
 (0)