mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-18 17:35:55 +08:00
feat: support auto generate and template
This commit is contained in:
parent
51cc63d9ce
commit
b34d815883
@ -40,11 +40,24 @@ class PluginParameterType(enum.StrEnum):
|
|||||||
SYSTEM_FILES = CommonParameterType.SYSTEM_FILES.value
|
SYSTEM_FILES = CommonParameterType.SYSTEM_FILES.value
|
||||||
|
|
||||||
|
|
||||||
|
class PluginParameterAutoGenerate(BaseModel):
|
||||||
|
class Type(enum.StrEnum):
|
||||||
|
PROMPT_INSTRUCTION = "prompt_instruction"
|
||||||
|
|
||||||
|
type: Type
|
||||||
|
|
||||||
|
|
||||||
|
class PluginParameterTemplate(BaseModel):
|
||||||
|
enabled: bool = Field(default=False, description="Whether the parameter is jinja enabled")
|
||||||
|
|
||||||
|
|
||||||
class PluginParameter(BaseModel):
|
class PluginParameter(BaseModel):
|
||||||
name: str = Field(..., description="The name of the parameter")
|
name: str = Field(..., description="The name of the parameter")
|
||||||
label: I18nObject = Field(..., description="The label presented to the user")
|
label: I18nObject = Field(..., description="The label presented to the user")
|
||||||
placeholder: Optional[I18nObject] = Field(default=None, description="The placeholder presented to the user")
|
placeholder: Optional[I18nObject] = Field(default=None, description="The placeholder presented to the user")
|
||||||
scope: str | None = None
|
scope: str | None = None
|
||||||
|
auto_generate: Optional[PluginParameterAutoGenerate] = None
|
||||||
|
template: Optional[PluginParameterTemplate] = None
|
||||||
required: bool = False
|
required: bool = False
|
||||||
default: Optional[Union[float, int, str]] = None
|
default: Optional[Union[float, int, str]] = None
|
||||||
min: Optional[Union[float, int]] = None
|
min: Optional[Union[float, int]] = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user