mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 18:35:29 -04:00
24c77fafae
- Added DynamicParameterFetchParameterOptionsRequest class for dynamic parameter requests. - Introduced DynamicParameterActions enum for action types related to dynamic parameters. - Enhanced PluginExecutor with methods to handle dynamic parameter fetching. - Updated Tool interface to include a method for fetching parameter options. - Documented the DynamicSelectProtocol for clarity on its usage.
22 lines
720 B
Python
22 lines
720 B
Python
from typing import Protocol
|
|
|
|
from dify_plugin.entities import ParameterOption
|
|
|
|
|
|
class DynamicSelectProtocol(Protocol):
|
|
def fetch_parameter_options(self, parameter: str) -> list[ParameterOption]:
|
|
"""
|
|
Fetch the parameter options.
|
|
|
|
Classes that implement this protocol should have at least one parameter with type `dynamic-select`.
|
|
|
|
At some scenarios, we don't know the available options,
|
|
it could not be defined in the plugin directly.
|
|
|
|
But we can fetch the options from the external service such as Slack,
|
|
by providing the access token of the user, we could fetch the channel list of the user.
|
|
|
|
That's what this protocol is for.
|
|
"""
|
|
...
|