mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 10:25:23 -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
27 lines
585 B
Python
27 lines
585 B
Python
from collections.abc import Mapping
|
|
|
|
from dify_plugin.core.entities.invocation import InvokeType
|
|
from dify_plugin.core.runtime import BackwardsInvocation
|
|
|
|
|
|
class FetchAppInvocation(BackwardsInvocation[dict]):
|
|
def get(
|
|
self,
|
|
app_id: str,
|
|
) -> Mapping:
|
|
"""
|
|
Invoke chat app
|
|
"""
|
|
response = self._backwards_invoke(
|
|
InvokeType.FetchApp,
|
|
dict,
|
|
{
|
|
"app_id": app_id,
|
|
},
|
|
)
|
|
|
|
for data in response:
|
|
return data
|
|
|
|
raise Exception("No response")
|