mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat(api): add CHECKBOX parameter type to plugin and tool entities
- Introduced CHECKBOX as a new parameter type in CommonParameterType and PluginParameterType. - Updated as_normal_type and cast_parameter_value functions to handle CHECKBOX type. - Enhanced ToolParameter class to include CHECKBOX for consistency across parameter types. These changes expand the parameter capabilities within the API, allowing for more versatile input options.
This commit is contained in:
@ -6,7 +6,13 @@ from typing import Any, Optional, Union
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from core.entities.provider_entities import ProviderConfig
|
||||
from core.plugin.entities.parameters import PluginParameterAutoGenerate, PluginParameterOption, PluginParameterTemplate
|
||||
from core.plugin.entities.parameters import (
|
||||
PluginParameterAutoGenerate,
|
||||
PluginParameterOption,
|
||||
PluginParameterTemplate,
|
||||
as_normal_type,
|
||||
cast_parameter_value,
|
||||
)
|
||||
from core.tools.entities.common_entities import I18nObject
|
||||
|
||||
|
||||
@ -24,6 +30,13 @@ class TriggerParameterType(StrEnum):
|
||||
OBJECT = "object"
|
||||
ARRAY = "array"
|
||||
DYNAMIC_SELECT = "dynamic-select"
|
||||
CHECKBOX = "checkbox"
|
||||
|
||||
def as_normal_type(self):
|
||||
return as_normal_type(self)
|
||||
|
||||
def cast_value(self, value: Any):
|
||||
return cast_parameter_value(self, value)
|
||||
|
||||
|
||||
class TriggerParameter(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user