Spaces:
Running
Running
| 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() | |