forked from langgenius/dify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: advanced prompt backend (langgenius#1301)
Co-authored-by: takatost <[email protected]>
- Loading branch information
1 parent
2d1cb07
commit 42a5b3e
Showing
61 changed files
with
762 additions
and
576 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
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,26 @@ | ||
from flask_restful import Resource, reqparse | ||
|
||
from controllers.console import api | ||
from controllers.console.setup import setup_required | ||
from controllers.console.wraps import account_initialization_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() | ||
|
||
service = AdvancedPromptTemplateService() | ||
return service.get_prompt(args) | ||
|
||
api.add_resource(AdvancedPromptTemplateList, '/app/prompt-templates') |
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
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
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
Oops, something went wrong.