Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save quantra-go-algo/ad5479a3ee3bd219bcea7ea1f41e8f5b to your computer and use it in GitHub Desktop.

Select an option

Save quantra-go-algo/ad5479a3ee3bd219bcea7ea1f41e8f5b to your computer and use it in GitHub Desktop.
guardrailed-llm-agent — Step 7: Hard Guardrails: When the LLM Isn't Enough (snippet 2)
# A4: re-optimize guardrails every month (OPT_FREQ_MONTHS=1)
if best_guard is None or ((m.month - 1) % OPT_FREQ_MONTHS == 0):
best_guard = optimize_guardrails(train, policy)
print('Re-opt guardrails @', m.date(), '->', best_guard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment