Files
dify-plugin-sdks/python/dify_plugin/core/entities/invocation.py
T
Yeuoly 1ec2ff6d6c feat[0.4.0]: add LLMStructuredOutput and LLMStructuredOutputInvocation for s… (#166)
* feat: add LLMStructuredOutput and LLMStructuredOutputInvocation for structured output handling

- Introduced LLMStructuredOutput model class for structured output representation.
- Added LLMStructuredOutputInvocation class to handle invocation with structured output.
- Updated ModelInvocations to include LLMStructuredOutputInvocation.
- Modified InvokeType enum to support LLMStructuredOutput type.

* docs: update README.md to include support for LLM structured output in manifest versioning
2025-06-27 15:54:42 +08:00

33 lines
838 B
Python

from enum import Enum
class InvokeType(Enum):
Tool = "tool"
LLM = "llm"
LLMStructuredOutput = "llm_structured_output"
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}")