-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add templates module and update version (#98)
* Add templates module and update version * Add import statement to __init__.py and remove blank lines from templates.py * Change API request method from GET to POST in get_prompt_template function * Refactor get_prompt_template function signature * Refactor GetPromptTemplate class to remove optional types * Refactor get() function signature in templates.py Update get_prompt_template() function signature in utils.py
- Loading branch information
1 parent
81206f5
commit 87d2036
Showing
6 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import Union | ||
|
||
from promptlayer.types.prompt_template import GetPromptTemplate | ||
from promptlayer.utils import get_prompt_template | ||
|
||
|
||
def get(prompt_name: str, params: Union[GetPromptTemplate, None] = None): | ||
return get_prompt_template(prompt_name, params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import prompt_template | ||
|
||
__all__ = ["prompt_template"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import Dict, TypedDict | ||
|
||
|
||
class GetPromptTemplate(TypedDict, total=False): | ||
version: int | ||
label: str | ||
provider: str | ||
input_variables: Dict[str, str] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "promptlayer" | ||
version = "0.4.0" | ||
version = "0.4.1" | ||
description = "PromptLayer is a platform for prompt engineering and tracks your LLM requests." | ||
authors = ["Magniv <[email protected]>"] | ||
license = "Apache-2.0" | ||
|