mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 16:38:04 +08:00
refactor tools
This commit is contained in:
@ -10,6 +10,7 @@ from core.plugin.backwards_invocation.app import PluginAppBackwardsInvocation
|
||||
from core.plugin.backwards_invocation.model import PluginModelBackwardsInvocation
|
||||
from core.plugin.entities.request import (
|
||||
RequestInvokeApp,
|
||||
RequestInvokeEncrypt,
|
||||
RequestInvokeLLM,
|
||||
RequestInvokeModeration,
|
||||
RequestInvokeNode,
|
||||
@ -132,6 +133,14 @@ class PluginInvokeAppApi(Resource):
|
||||
PluginAppBackwardsInvocation.convert_to_event_stream(response)
|
||||
)
|
||||
|
||||
class PluginInvokeEncryptApi(Resource):
|
||||
@setup_required
|
||||
@plugin_inner_api_only
|
||||
@get_tenant
|
||||
@plugin_data(payload_type=RequestInvokeEncrypt)
|
||||
def post(self, user_id: str, tenant_model: Tenant, payload: RequestInvokeEncrypt):
|
||||
""""""
|
||||
|
||||
api.add_resource(PluginInvokeLLMApi, '/invoke/llm')
|
||||
api.add_resource(PluginInvokeTextEmbeddingApi, '/invoke/text-embedding')
|
||||
api.add_resource(PluginInvokeRerankApi, '/invoke/rerank')
|
||||
|
||||
@ -46,6 +46,8 @@ def enterprise_inner_api_user_auth(view):
|
||||
user_id = user_id.split(" ")[1]
|
||||
|
||||
inner_api_key = request.headers.get("X-Inner-Api-Key")
|
||||
if not inner_api_key:
|
||||
raise ValueError("inner api key not found")
|
||||
|
||||
data_to_sign = f"DIFY {user_id}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user