Spaces:
Running
Running
File size: 586 Bytes
12d3e1a 7fa7a9c d32424b 7fa7a9c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from setup.easy_imports import ChatPromptTemplate
class Prompt:
def __init__(self):
pass
def create_prompt_template(self, system_prompt, user_prompt):
prompt_template = ChatPromptTemplate.from_messages(
[("system", system_prompt), ("user", user_prompt)]
)
return prompt_template
def create_and_invoke_prompt(self, user_prompt, system_prompt="", dynamic_dict={}):
return ChatPromptTemplate.from_messages(
[("system", system_prompt), ("user", user_prompt)]
).invoke(dynamic_dict)
prompt = Prompt()
|