from collections.abc import Generatorfrom dify_plugin.entities.tool import ToolInvokeMessagefrom dify_plugin import Toolfrom dify_plugin.entities.workflow_node import ModelConfig, ParameterConfigclassParameterExtractorTool(Tool):def_invoke(self,tool_parameters:dict ) -> Generator[ToolInvokeMessage,None,None]: response = self.session.workflow_node.parameter_extractor.invoke( parameters=[ParameterConfig( name="name", description="name of the person", required=True, type="string", ) ], model=ModelConfig( provider="langgenius/openai/openai", name="gpt-4o-mini", completion_params={}, ), query="My name is John Doe", instruction="Extract the name of the person", )yield self.create_text_message(response.outputs["name"])