mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 16:38:04 +08:00
Merge main
This commit is contained in:
@ -38,6 +38,7 @@ class PluginInvokeLLMApi(Resource):
|
||||
|
||||
return compact_generate_response(generator())
|
||||
|
||||
|
||||
class PluginInvokeTextEmbeddingApi(Resource):
|
||||
@setup_required
|
||||
@plugin_inner_api_only
|
||||
@ -113,6 +114,7 @@ class PluginInvokeNodeApi(Resource):
|
||||
def post(self, user_id: str, tenant_model: Tenant, payload: RequestInvokeNode):
|
||||
pass
|
||||
|
||||
|
||||
class PluginInvokeAppApi(Resource):
|
||||
@setup_required
|
||||
@plugin_inner_api_only
|
||||
@ -134,6 +136,7 @@ class PluginInvokeAppApi(Resource):
|
||||
PluginAppBackwardsInvocation.convert_to_event_stream(response)
|
||||
)
|
||||
|
||||
|
||||
class PluginInvokeEncryptApi(Resource):
|
||||
@setup_required
|
||||
@plugin_inner_api_only
|
||||
@ -145,6 +148,7 @@ class PluginInvokeEncryptApi(Resource):
|
||||
"""
|
||||
return PluginEncrypter.invoke_encrypt(tenant_model, payload)
|
||||
|
||||
|
||||
api.add_resource(PluginInvokeLLMApi, '/invoke/llm')
|
||||
api.add_resource(PluginInvokeTextEmbeddingApi, '/invoke/text-embedding')
|
||||
api.add_resource(PluginInvokeRerankApi, '/invoke/rerank')
|
||||
|
||||
@ -48,6 +48,7 @@ def get_tenant(view: Optional[Callable] = None):
|
||||
else:
|
||||
return decorator(view)
|
||||
|
||||
|
||||
def plugin_data(view: Optional[Callable] = None, *, payload_type: type[BaseModel]):
|
||||
def decorator(view_func):
|
||||
def decorated_view(*args, **kwargs):
|
||||
|
||||
@ -63,6 +63,7 @@ def enterprise_inner_api_user_auth(view):
|
||||
|
||||
return decorated
|
||||
|
||||
|
||||
def plugin_inner_api_only(view):
|
||||
@wraps(view)
|
||||
def decorated(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user