File size: 494 Bytes
479f67b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
r"""_summary_
-*- coding: utf-8 -*-

Module : prompt.utils

File Name : utils.py

Description : prompt utils

Creation Date : 2024-11-09

Author : Frank Kang([email protected])
"""
import sys
from .pool import PromptPool, Prompt


def get_prompt() -> Prompt:
    key = sys._getframe(1).f_code.co_name
    pool = PromptPool.get()
    if key not in pool.entities:
        raise FileNotFoundError('could not find prompt file by function name {}'.format(key))
    else:
        return pool[key]