prompty 0.1.48__py3-none-any.whl → 0.1.49__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.
- prompty/__init__.py +2 -1
- prompty/utils.py +3 -2
- {prompty-0.1.48.dist-info → prompty-0.1.49.dist-info}/METADATA +5 -4
- {prompty-0.1.48.dist-info → prompty-0.1.49.dist-info}/RECORD +7 -7
- {prompty-0.1.48.dist-info → prompty-0.1.49.dist-info}/WHEEL +0 -0
- {prompty-0.1.48.dist-info → prompty-0.1.49.dist-info}/entry_points.txt +0 -0
- {prompty-0.1.48.dist-info → prompty-0.1.49.dist-info}/licenses/LICENSE +0 -0
prompty/__init__.py
CHANGED
@@ -12,7 +12,7 @@ from .core import (
|
|
12
12
|
)
|
13
13
|
from .invoker import InvokerFactory
|
14
14
|
from .parsers import PromptyChatParser
|
15
|
-
from .renderers import Jinja2Renderer
|
15
|
+
from .renderers import Jinja2Renderer, MustacheRenderer
|
16
16
|
from .tracer import trace
|
17
17
|
from .utils import (
|
18
18
|
load_global_config,
|
@@ -22,6 +22,7 @@ from .utils import (
|
|
22
22
|
)
|
23
23
|
|
24
24
|
InvokerFactory.add_renderer("jinja2", Jinja2Renderer)
|
25
|
+
InvokerFactory.add_renderer("mustache", MustacheRenderer)
|
25
26
|
InvokerFactory.add_parser("prompty.chat", PromptyChatParser)
|
26
27
|
|
27
28
|
|
prompty/utils.py
CHANGED
@@ -37,14 +37,15 @@ def _find_global_config(prompty_path: Path = Path.cwd()) -> typing.Union[Path, N
|
|
37
37
|
prompty_config = list(Path.cwd().glob("**/prompty.json"))
|
38
38
|
|
39
39
|
if len(prompty_config) > 0:
|
40
|
-
|
40
|
+
sorted_list = sorted(
|
41
41
|
[
|
42
42
|
c
|
43
43
|
for c in prompty_config
|
44
44
|
if len(c.parent.parts) <= len(prompty_path.parts)
|
45
45
|
],
|
46
46
|
key=lambda p: len(p.parts),
|
47
|
-
)
|
47
|
+
)
|
48
|
+
return sorted_list[-1] if len(sorted_list) > 0 else None
|
48
49
|
else:
|
49
50
|
return None
|
50
51
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: prompty
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.49
|
4
4
|
Summary: Prompty is a new asset class and format for LLM prompts that aims to provide observability, understandability, and portability for developers. It includes spec, tooling, and a runtime. This Prompty runtime supports Python
|
5
5
|
Author-Email: Seth Juarez <seth.juarez@microsoft.com>
|
6
6
|
License: MIT
|
@@ -37,16 +37,17 @@ Examples prompty file:
|
|
37
37
|
```markdown
|
38
38
|
---
|
39
39
|
name: Basic Prompt
|
40
|
-
description: A basic prompt that uses the
|
40
|
+
description: A basic prompt that uses the gpt-3.5-turbo chat API to answer questions
|
41
41
|
authors:
|
42
42
|
- sethjuarez
|
43
43
|
- jietong
|
44
44
|
model:
|
45
45
|
api: chat
|
46
46
|
configuration:
|
47
|
-
api_version:
|
47
|
+
api_version: 2024-10-21
|
48
48
|
azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT}
|
49
49
|
azure_deployment: ${env:AZURE_OPENAI_DEPLOYMENT:gpt-35-turbo}
|
50
|
+
type: azure_openai
|
50
51
|
sample:
|
51
52
|
firstName: Jane
|
52
53
|
lastName: Doe
|
@@ -76,7 +77,7 @@ Download the [VS Code extension here](https://marketplace.visualstudio.com/items
|
|
76
77
|
The Python runtime is a simple way to run your prompts in Python. The runtime is available as a Python package and can be installed using pip. Depending on the type of prompt you are running, you may need to install additional dependencies. The runtime is designed to be extensible and can be customized to fit your needs.
|
77
78
|
|
78
79
|
```bash
|
79
|
-
pip install prompty[azure]
|
80
|
+
pip install "prompty[azure]"
|
80
81
|
```
|
81
82
|
|
82
83
|
Simple usage example:
|
@@ -1,8 +1,8 @@
|
|
1
|
-
prompty-0.1.
|
2
|
-
prompty-0.1.
|
3
|
-
prompty-0.1.
|
4
|
-
prompty-0.1.
|
5
|
-
prompty/__init__.py,sha256=
|
1
|
+
prompty-0.1.49.dist-info/METADATA,sha256=me6Z8gphAgWMs0lfuSOjf7E2afCeNCI_y_-5mkxO_9k,9337
|
2
|
+
prompty-0.1.49.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
prompty-0.1.49.dist-info/entry_points.txt,sha256=a3i7Kvf--3DOkkv9VQpstwaNKgsnXwDGaPL18lPpKeI,60
|
4
|
+
prompty-0.1.49.dist-info/licenses/LICENSE,sha256=KWSC4z9cfML_t0xThoQYjzTdcZQj86Y_mhXdatzU-KM,1052
|
5
|
+
prompty/__init__.py,sha256=Nq49LsDwe8smD51MLsjGDlk6soc3knKoXkAmdUJNibA,16937
|
6
6
|
prompty/azure/__init__.py,sha256=zBxzOMQCwtiz2CsI8gNWzr7T2ZJHF3TZNIUtvfuaEQI,309
|
7
7
|
prompty/azure/executor.py,sha256=MWeBwprLY2NmPySoOq-K3qMui5lPlMYMh5ktb3S7mgo,9367
|
8
8
|
prompty/azure/processor.py,sha256=gNmUkPBoSLPE0t7IVJUxGdwZ2otiycDE4Fu6L1vurZI,5330
|
@@ -22,5 +22,5 @@ prompty/serverless/__init__.py,sha256=ILtbqhy6E-wWodbnq-_aftruTGk1Z0EI9zURFH4FEC
|
|
22
22
|
prompty/serverless/executor.py,sha256=QZXeFTXv_aT22rbBBgBFLtdAJqGp4W8GS3H3Rtoy8bE,8936
|
23
23
|
prompty/serverless/processor.py,sha256=d42MalWRf8RUpHRiueqAPAj_nGmJSMUE2yL-Tgxrss4,3754
|
24
24
|
prompty/tracer.py,sha256=GYJsFfsF5uexv1RANENX_Xm5sOnIcQHT_LLAtr6JocU,12158
|
25
|
-
prompty/utils.py,sha256=
|
26
|
-
prompty-0.1.
|
25
|
+
prompty/utils.py,sha256=0EmzWgRWPe6IgHOzoIy0k4_BMDUN4FHo0iITD-g1Ny8,2904
|
26
|
+
prompty-0.1.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|