mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
25 lines
996 B
Python
25 lines
996 B
Python
from flask_restful import Resource, reqparse
|
|
|
|
from controllers.console import api
|
|
from controllers.console.wraps import account_initialization_required, setup_required
|
|
from libs.login import login_required
|
|
from services.advanced_prompt_template_service import AdvancedPromptTemplateService
|
|
|
|
|
|
class AdvancedPromptTemplateList(Resource):
|
|
@setup_required
|
|
@login_required
|
|
@account_initialization_required
|
|
def get(self):
|
|
parser = reqparse.RequestParser()
|
|
parser.add_argument("app_mode", type=str, required=True, location="args")
|
|
parser.add_argument("model_mode", type=str, required=True, location="args")
|
|
parser.add_argument("has_context", type=str, required=False, default="true", location="args")
|
|
parser.add_argument("model_name", type=str, required=True, location="args")
|
|
args = parser.parse_args()
|
|
|
|
return AdvancedPromptTemplateService.get_prompt(args)
|
|
|
|
|
|
api.add_resource(AdvancedPromptTemplateList, "/app/prompt-templates")
|