Files
Yeuoly ca736effd7 feat(invocation): add FetchAppInvocation and update type hints for improved clarity (#100)
* 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
2025-04-16 20:25:39 +08:00

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")