Spaces:
Sleeping
Sleeping
Update prompts/prompts.py
Browse files- prompts/prompts.py +13 -2
prompts/prompts.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import yaml
|
|
|
|
| 2 |
|
| 3 |
def load_prompts():
|
| 4 |
files = ["prompts/base.yml", "prompts/contenteval.yml", "prompts/planning.yml"]
|
|
@@ -77,5 +78,15 @@ def print_default_prompt_templates(
|
|
| 77 |
except Exception as e:
|
| 78 |
print(f"[error] failed to export defaults: {e}")
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import yaml
|
| 2 |
+
import io, contextlib
|
| 3 |
|
| 4 |
def load_prompts():
|
| 5 |
files = ["prompts/base.yml", "prompts/contenteval.yml", "prompts/planning.yml"]
|
|
|
|
| 78 |
except Exception as e:
|
| 79 |
print(f"[error] failed to export defaults: {e}")
|
| 80 |
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
# from prompts.prompts import print_default_prompt_templates # import at top of file
|
| 84 |
+
|
| 85 |
+
def _print_defaults_wrapper():
|
| 86 |
+
from prompts.prompts import print_default_prompt_templates
|
| 87 |
+
buf = io.StringIO()
|
| 88 |
+
with contextlib.redirect_stdout(buf):
|
| 89 |
+
print_default_prompt_templates(endpoint_url=self.endpoint_uri)
|
| 90 |
+
return buf.getvalue().strip() or "(no output)"
|
| 91 |
+
|
| 92 |
+
|