-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprompts.py
More file actions
37 lines (29 loc) · 899 Bytes
/
Copy pathprompts.py
File metadata and controls
37 lines (29 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""PythonHere prompt sections for ``%%there ai``."""
from importlib.resources import files
from herethere.there.ai import register_ai_prompt, set_ai_prompts
PYTHONHERE_AI_ACTIVE_PROMPTS = (
"kivy-runtime",
"kivy-kv",
"android-runtime",
"jnius",
"android-permissions",
"android-packages",
"android-media",
"plyer",
)
PYTHONHERE_AI_PROMPTS = (
*PYTHONHERE_AI_ACTIVE_PROMPTS,
"able",
"midi",
)
def _read_prompt(name: str) -> str:
return (
files("pythonhere.magic_here")
.joinpath("prompts", f"{name}.md")
.read_text(encoding="utf-8")
)
def register_pythonhere_ai_prompts() -> None:
"""Register PythonHere Android/Kivy prompt sections as the active AI stack."""
for name in PYTHONHERE_AI_PROMPTS:
register_ai_prompt(name, _read_prompt(name))
set_ai_prompts("default", *PYTHONHERE_AI_ACTIVE_PROMPTS)