pixie-prompts 0.1.9__py3-none-any.whl → 0.1.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pixie/prompts/file_watcher.py +7 -7
- pixie/prompts/prompt.py +2 -2
- pixie/prompts/storage.py +5 -1
- {pixie_prompts-0.1.9.dist-info → pixie_prompts-0.1.10.dist-info}/METADATA +1 -1
- pixie_prompts-0.1.10.dist-info/RECORD +13 -0
- {pixie_prompts-0.1.9.dist-info → pixie_prompts-0.1.10.dist-info}/WHEEL +1 -1
- pixie_prompts-0.1.9.dist-info/RECORD +0 -13
- {pixie_prompts-0.1.9.dist-info → pixie_prompts-0.1.10.dist-info}/entry_points.txt +0 -0
- {pixie_prompts-0.1.9.dist-info → pixie_prompts-0.1.10.dist-info}/licenses/LICENSE +0 -0
pixie/prompts/file_watcher.py
CHANGED
|
@@ -10,7 +10,11 @@ from watchdog.observers import Observer
|
|
|
10
10
|
import asyncio
|
|
11
11
|
import logging
|
|
12
12
|
|
|
13
|
-
from pixie.prompts.storage import
|
|
13
|
+
from pixie.prompts.storage import (
|
|
14
|
+
PromptLoadError,
|
|
15
|
+
get_storage_root_directory,
|
|
16
|
+
initialize_prompt_storage,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
logger = logging.getLogger(__name__)
|
|
16
20
|
|
|
@@ -398,12 +402,8 @@ async def stop_storage_watcher() -> None:
|
|
|
398
402
|
|
|
399
403
|
|
|
400
404
|
def init_prompt_storage():
|
|
401
|
-
"""Initialize prompt storage and return lifespan context manager.
|
|
402
|
-
|
|
403
|
-
Storage directory is read from PIXIE_PROMPT_STORAGE_DIR environment variable,
|
|
404
|
-
defaulting to '.pixie/prompts'.
|
|
405
|
-
"""
|
|
406
|
-
storage_directory = os.getenv("PIXIE_PROMPT_STORAGE_DIR", ".pixie/prompts")
|
|
405
|
+
"""Initialize prompt storage and return lifespan context manager."""
|
|
406
|
+
storage_directory = get_storage_root_directory()
|
|
407
407
|
try:
|
|
408
408
|
initialize_prompt_storage()
|
|
409
409
|
except PromptLoadError as e:
|
pixie/prompts/prompt.py
CHANGED
|
@@ -49,7 +49,7 @@ key is the id() of the compiled string."""
|
|
|
49
49
|
def _find_matching_prompt(obj):
|
|
50
50
|
if isinstance(obj, str):
|
|
51
51
|
for compiled in _compiled_prompt_registry.values():
|
|
52
|
-
if compiled.value
|
|
52
|
+
if compiled.value in obj:
|
|
53
53
|
return compiled
|
|
54
54
|
return None
|
|
55
55
|
elif isinstance(obj, dict):
|
|
@@ -76,7 +76,7 @@ def get_compiled_prompt(text: str) -> CompiledPrompt | None:
|
|
|
76
76
|
if direct_match:
|
|
77
77
|
return direct_match
|
|
78
78
|
for compiled in _compiled_prompt_registry.values():
|
|
79
|
-
if compiled.value
|
|
79
|
+
if compiled.value in text:
|
|
80
80
|
return compiled
|
|
81
81
|
try:
|
|
82
82
|
obj = json.loads(text)
|
pixie/prompts/storage.py
CHANGED
|
@@ -260,6 +260,10 @@ class _FilePromptStorage(PromptStorage):
|
|
|
260
260
|
_storage_instance: PromptStorage | None = None
|
|
261
261
|
|
|
262
262
|
|
|
263
|
+
def get_storage_root_directory() -> str:
|
|
264
|
+
return os.getenv("PIXIE_PROMPT_STORAGE_DIR", ".pixie/prompts")
|
|
265
|
+
|
|
266
|
+
|
|
263
267
|
def _ensure_storage_initialized() -> PromptStorage:
|
|
264
268
|
"""Ensure storage is initialized, initializing it if necessary.
|
|
265
269
|
|
|
@@ -268,7 +272,7 @@ def _ensure_storage_initialized() -> PromptStorage:
|
|
|
268
272
|
"""
|
|
269
273
|
global _storage_instance
|
|
270
274
|
if _storage_instance is None:
|
|
271
|
-
storage_directory =
|
|
275
|
+
storage_directory = get_storage_root_directory()
|
|
272
276
|
_storage_instance = _FilePromptStorage(storage_directory, raise_on_error=False)
|
|
273
277
|
logger.info(
|
|
274
278
|
"Auto-initialized prompt storage at directory: %s", storage_directory
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pixie/prompts/__init__.py,sha256=ZueU9cJ7aiVHBQYH4g3MXAFtjQwTfvvpy3d8ZTtBQ2c,396
|
|
2
|
+
pixie/prompts/file_watcher.py,sha256=TAFY8tx5w--qUvpNX_L3ag5heCHJcZ1YO_10t8k9Sc0,14253
|
|
3
|
+
pixie/prompts/graphql.py,sha256=jzTGVedsl_QoONUwV5gIZFgqlvpYBug97UhyAJ0_B3o,12258
|
|
4
|
+
pixie/prompts/prompt.py,sha256=tmjWZZEDxGzcMh6U0AQ0KsW7ae2wQYbswsSLhpuenQ0,12384
|
|
5
|
+
pixie/prompts/prompt_management.py,sha256=gq5Eklqy2_Sq8jATVae4eANNmyFE8s8a9cedxWs2P_Y,2816
|
|
6
|
+
pixie/prompts/server.py,sha256=gaZ4ws78f2381Zvegphy0yit1pAYZvm4kC7SJeGqYrs,7817
|
|
7
|
+
pixie/prompts/storage.py,sha256=ochThc9WxefQMX3qHiarG6pZk6_1UGS-zLKOK6EiKXE,14894
|
|
8
|
+
pixie/prompts/utils.py,sha256=ssAb4HdwZX__Fq50i2-DFsYXD5vpsYEliA_XI8GPx3Y,21929
|
|
9
|
+
pixie_prompts-0.1.10.dist-info/METADATA,sha256=fJmXKktwaOFx-eGC1PxJP78jxOghJ_pPxCxxM6OMknM,4719
|
|
10
|
+
pixie_prompts-0.1.10.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
11
|
+
pixie_prompts-0.1.10.dist-info/entry_points.txt,sha256=SWOSFuUXDxkJMmf28u7E0Go_LcEpofz7NAlV70Cp8Es,48
|
|
12
|
+
pixie_prompts-0.1.10.dist-info/licenses/LICENSE,sha256=nZoehBpdSXe6iTF2ZWzM-fgXdXECUZ0J8LrW_1tBwyk,1064
|
|
13
|
+
pixie_prompts-0.1.10.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
pixie/prompts/__init__.py,sha256=ZueU9cJ7aiVHBQYH4g3MXAFtjQwTfvvpy3d8ZTtBQ2c,396
|
|
2
|
-
pixie/prompts/file_watcher.py,sha256=E_CnoKrBHGngHev_fN9Ycx16dcHUqn3NSqwXKVRwBqQ,14359
|
|
3
|
-
pixie/prompts/graphql.py,sha256=jzTGVedsl_QoONUwV5gIZFgqlvpYBug97UhyAJ0_B3o,12258
|
|
4
|
-
pixie/prompts/prompt.py,sha256=SPxrzbGWnEfEdyzWUJUy-evs-YIbha7bPeHAHKtCdw4,12384
|
|
5
|
-
pixie/prompts/prompt_management.py,sha256=gq5Eklqy2_Sq8jATVae4eANNmyFE8s8a9cedxWs2P_Y,2816
|
|
6
|
-
pixie/prompts/server.py,sha256=gaZ4ws78f2381Zvegphy0yit1pAYZvm4kC7SJeGqYrs,7817
|
|
7
|
-
pixie/prompts/storage.py,sha256=n4tTpociWx53SmsVK2nN5lr-6IRBsgJlFmlvld5XKBc,14811
|
|
8
|
-
pixie/prompts/utils.py,sha256=ssAb4HdwZX__Fq50i2-DFsYXD5vpsYEliA_XI8GPx3Y,21929
|
|
9
|
-
pixie_prompts-0.1.9.dist-info/METADATA,sha256=-MREsNXN5D76yLBkVUisnVewU4akwUUGQDOwSrDEdQo,4718
|
|
10
|
-
pixie_prompts-0.1.9.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
|
|
11
|
-
pixie_prompts-0.1.9.dist-info/entry_points.txt,sha256=SWOSFuUXDxkJMmf28u7E0Go_LcEpofz7NAlV70Cp8Es,48
|
|
12
|
-
pixie_prompts-0.1.9.dist-info/licenses/LICENSE,sha256=nZoehBpdSXe6iTF2ZWzM-fgXdXECUZ0J8LrW_1tBwyk,1064
|
|
13
|
-
pixie_prompts-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|