-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2176969
commit 15cd59a
Showing
4 changed files
with
36 additions
and
9 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,19 @@ | ||
import paramount | ||
|
||
messages = [ | ||
{'role': 'system', 'content': 'You help users with their cake recipes.'}, | ||
{'role': 'user', 'content': 'Hello!'}, | ||
{'role': 'assistant', 'content': 'Hello, how can I help you?'}, | ||
] | ||
|
||
|
||
@paramount.record() | ||
def my_ai_function(message_history, new_question): | ||
# The above inputs become "input_args__message_history", "input_args__new_question" in the recordings csv/table | ||
# LLM invocations happen here | ||
new_message = {'role': 'user', 'content': new_question} | ||
updated_history = message_history + [new_message] | ||
return updated_history # Outputs. This becomes "output__1". Can be used as the chat_list param in paramount.toml | ||
|
||
|
||
my_ai_function(messages, "How do I bake a cake?") |
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