abhikamuni commited on
Commit
4b207b8
·
verified ·
1 Parent(s): aa6cd65
Files changed (1) hide show
  1. app/services/guardrails.py +5 -2
app/services/guardrails.py CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  import json
2
  from fastapi import HTTPException
3
  from langchain_core.prompts import ChatPromptTemplate
@@ -88,5 +92,4 @@ def check_output_guardrail(solution: str | None) -> (bool, str):
88
  return (False, "AI refused to answer the question.")
89
 
90
  print("--- Guardrail: Output OK ---")
91
- return (True, solution)
92
-
 
1
+ import os
2
+ os.environ["DSPY_CACHE_DIR"] = "/tmp/.dspy_cache"
3
+
4
+ # --- ALL OTHER IMPORTS MUST BE BELOW THIS FIX ---
5
  import json
6
  from fastapi import HTTPException
7
  from langchain_core.prompts import ChatPromptTemplate
 
92
  return (False, "AI refused to answer the question.")
93
 
94
  print("--- Guardrail: Output OK ---")
95
+ return (True, solution)