-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* reorder readme * Add prompt caching and expand system prompts parameter
- Loading branch information
1 parent
4b00a5f
commit 56dc58c
Showing
9 changed files
with
338 additions
and
82 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
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,26 @@ | ||
from promptic import llm | ||
|
||
# imagine these are long legal documents | ||
legal_document, another_legal_document = ( | ||
"a legal document about Sam", | ||
"a legal document about Jane", | ||
) | ||
|
||
system_prompts = [ | ||
"You are a helpful legal assistant", | ||
"You provide detailed responses based on the provided context", | ||
f"legal document 1: '{legal_document}'", | ||
f"legal document 2: '{another_legal_document}'", | ||
] | ||
|
||
|
||
@llm( | ||
system=system_prompts, | ||
cache=True, # this is the default | ||
) | ||
def legal_chat(message): | ||
"""{message}""" | ||
|
||
|
||
print(legal_chat("which legal document is about Sam?")) | ||
# The legal document about Sam is "legal document 1." |
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
Oops, something went wrong.