mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-23 02:45:37 -04:00
ca736effd7
* feat(invocation): add FetchAppInvocation and update type hints for improved clarity - Introduced FetchAppInvocation class to handle fetching app data. - Updated type hints in ToolInvokeMessage and related classes to use Mapping for better type safety. - Added FetchApp enum value to InvokeType for consistency in invocation types. * apply ruff
32 lines
788 B
Python
32 lines
788 B
Python
from enum import Enum
|
|
|
|
|
|
class InvokeType(Enum):
|
|
Tool = "tool"
|
|
LLM = "llm"
|
|
TextEmbedding = "text_embedding"
|
|
Rerank = "rerank"
|
|
TTS = "tts"
|
|
Speech2Text = "speech2text"
|
|
Moderation = "moderation"
|
|
NodeParameterExtractor = "node_parameter_extractor"
|
|
NodeQuestionClassifier = "node_question_classifier"
|
|
App = "app"
|
|
Storage = "storage"
|
|
UploadFile = "upload_file"
|
|
SYSTEM_SUMMARY = "system_summary"
|
|
FetchApp = "fetch_app"
|
|
|
|
@classmethod
|
|
def value_of(cls, value: str) -> "InvokeType":
|
|
"""
|
|
Get value of given mode.
|
|
|
|
:param value: type
|
|
:return: mode
|
|
"""
|
|
for mode in cls:
|
|
if mode.value == value:
|
|
return mode
|
|
raise ValueError(f"invalid type value {value}")
|