- Updated the GmailMessageEvent class to handle both added and deleted messages, improving event management.
- Introduced a new `cancelled` field in TriggerInvokeEventResponse to indicate event cancellation.
- Enhanced error handling with EventIgnoreError for cases with no relevant messages.
- Updated YAML documentation to reflect changes in event behavior and output schema.
* refactor: update model provider to use ModelFactory for instance management
* refactor: integrate ModelFactory for model instance mapping in tests
* refactor: remove unused imports and clean up test files
- Updated version in pyproject.toml and requirements.txt to 0.6.0b13.
- Changed 'raw_http_response' to 'response' in TriggerDispatchResponse model for clarity.
- Updated GitHub trigger manifest version to 1.3.8.
- Added user_id field to EventDispatch and TriggerDispatchResponse models to track the user triggering events.
- Updated GitHub trigger provider to include user_id in event dispatching.
- Modified star event parameters in YAML to simplify naming conventions from "star_created" and "star_deleted" to "created" and "deleted".
- Bumped plugin version in manifest.yaml from 1.3.5 to 1.3.6 to reflect these changes.
- Added subscription handling to the EventRuntime and TriggerInvokeEventRequest classes, improving the management of event subscriptions.
- Updated the PluginExecutor to include subscription details when invoking events, ensuring better integration with subscription-based workflows.
- Modified test cases to reflect the new subscription structure, enhancing test coverage and reliability.
These changes improve the overall functionality and clarity of the subscription system within the plugin.
- Modified the `_get_oauth_provider_instance` method in `PluginExecutor` to accept a `Session` parameter and return the appropriate OAuth provider instance.
- Updated the `get_supported_oauth_provider_cls` method in `PluginRegistration` to `get_supported_oauth_provider`, improving its signature and functionality.
- Enhanced type annotations across methods to improve clarity and type safety.
These changes streamline the OAuth provider handling and improve code maintainability.
- Enhanced type annotations in the PluginExecutor by adding Mapping to the import statements for better type safety.
- Reformatted the docstring in TriggerSubscriptionConstructor to improve readability by breaking long lines into multiple lines.
These changes contribute to better code clarity and maintainability across the plugin.
- Updated the PluginExecutor and related classes to improve type annotations and clarity, particularly in methods handling OAuth credentials and trigger subscriptions.
- Refactored the PluginRegistration and TriggerFactory classes to streamline the retrieval of trigger providers and event handlers, ensuring better type safety and consistency.
- Adjusted the YAML loader function to specify return types, enhancing code readability and maintainability.
These changes improve the overall structure and usability of the trigger subscription system, making it more robust and easier to understand.
- Updated the version in pyproject.toml from 0.6.0b6 to 0.6.0b7.
- Renamed trigger-related methods and classes for clarity, changing invoke_trigger to invoke_trigger_event and updating associated request and response classes.
- Adjusted event handling in the GithubTrigger class to improve event dispatching.
These changes ensure the plugin is up-to-date and enhance the clarity and functionality of event handling.
- Simplified import statements across various files by reordering and consolidating imports for better readability.
- Refactored the PluginRegistration class to improve the clarity of the configuration handling logic, ensuring more concise checks for subscription constructors.
These changes enhance code maintainability and readability throughout the plugin structure.
- Updated the version of dify_plugin from 0.6.0b5 to 0.6.0b6 in pyproject.toml.
This change ensures that the project dependencies are aligned with the latest plugin version.
- Introduced new event mappings for issue comments in the GithubTrigger class, enhancing event handling capabilities.
- Updated the TriggerSubscribeRequest to allow for optional selected_events.
- Modified the YAML configuration to change the 'triggers' parameter to 'events' and added options for issue comments.
These changes improve the flexibility and clarity of event handling in the GitHub trigger implementation.
- Renamed the 'triggers' attribute to 'events' in TriggerDispatchResponse for consistency with event terminology.
- Updated method signatures in IssueOpenedEvent to use Mapping instead of dict for better type clarity.
These changes enhance the coherence of the codebase and align with the recent terminology updates across the project.
- Renamed classes and methods related to triggers to use "Event" terminology for consistency and clarity.
- Updated the PluginExecutor, PluginRegistration, and TriggerFactory to reflect the new event handling structure.
- Adjusted YAML configurations and example implementations to align with the new event definitions.
- Enhanced the .gitignore file to include .DS_Store and ensure cleaner project management.
These changes improve the overall coherence of the codebase and enhance the clarity of event-driven functionality.
- Removed the deprecated IssuesTrigger class and replaced it with a more focused IssueOpenedTrigger class to handle specific events when a new issue is opened.
- Updated the GitHub trigger YAML configuration to reflect changes in the subscription schema and parameters.
- Enhanced the validation logic for issue parameters, including title patterns, labels, assignees, authors, milestones, and body content.
- Improved the overall structure and clarity of the trigger implementation, ensuring better maintainability and functionality.
These changes contribute to a more efficient and organized handling of GitHub issue events, enhancing the plugin's responsiveness to user interactions.
- Adjusted import order in request.py for consistency.
- Enhanced the description formatting in trigger.py for better clarity.
- Streamlined exception handling and method signatures in github.py for improved readability.
- Simplified dictionary construction in message_delivered.py to enhance clarity.
- Consolidated return statements in test_trigger_factory.py for better organization.
These changes contribute to a cleaner and more maintainable codebase, improving overall readability and consistency across the project.
- Consolidated logic in PluginRegistration for determining subscription constructor classes.
- Simplified method signatures in TriggerFactory for better readability.
- Updated import paths in providers.py to reflect the new module structure.
- Introduced comprehensive tests for the TriggerFactory to ensure robust functionality.
These changes improve code clarity and maintainability while enhancing the overall structure of the trigger management system.
- Added TriggerSubscriptionConstructorRuntime for managing subscription credentials and session data.
- Refactored PluginExecutor to utilize the new trigger subscription constructor for improved event handling.
- Updated PluginRegistration to support the new trigger subscription constructor interface.
- Introduced example-lark-trigger dependency in pyproject.toml for enhanced functionality.
- Cleaned up and standardized trigger-related classes and interfaces for better maintainability.
These changes improve the overall structure and functionality of the trigger subscription system, ensuring a more robust and flexible event handling process.
- Eliminated the DatasourceProviderMapping class to streamline the codebase.
- This change enhances maintainability by reducing complexity in the plugin registration module.
- Reformatted the definition of PluginAccessAction to enhance code clarity.
- Removed an unnecessary blank line in the TriggerInvokeRequest class.
These changes contribute to better code organization and maintainability.
- Included DatasourceActions in the merged PluginAccessAction for enhanced access control.
- Added a blank line for improved readability in the TriggerInvokeRequest class.
These changes improve the structure and functionality of the plugin request handling.
- Updated type hints in `setup.py` and `__init__.py` for better clarity and compatibility with newer Python versions.
- Improved descriptions in `trigger.py` for better understanding of output variables.
- Added new dynamic options fetching for repositories in `github.py`, enhancing user experience.
- Updated `manifest.yaml` to reflect the new version 100.1.1 and included additional localization for Japanese.
- Cleaned up and standardized code in various files for improved readability and maintainability.
These changes enhance the overall functionality and usability of the GitHub trigger integration, ensuring a more robust event handling process.
- Refactored `TriggerInvokeResponse` to use `Mapping[str, Any]` for event representation.
- Renamed `properties` to `variables` in the `Event` class for clarity and updated the description accordingly.
- Expanded the event options in the GitHub trigger configuration to allow selection of all events.
- Removed the deprecated `issue_comment` trigger implementation and its associated files.
- Bumped version in `manifest.yaml` to 0.0.9 to reflect these changes.
These updates improve the flexibility and clarity of the GitHub trigger integration, allowing for a broader range of event handling.
* fix latency calc
* feat: add timing context management to AIModel for latency tracking
- Introduced a new TimingContextRaceConditionError to handle race conditions in multi-threaded environments.
- Implemented a timing_context method in AIModel to track request timing and prevent concurrent usage.
- Updated various model classes (LargeLanguageModel, ModerationModel, RerankModel, Speech2TextModel, TextEmbeddingModel, TTSModel) to utilize the new timing context for latency calculations.
- Added tests to validate timing context behavior under concurrent and sequential usage scenarios.
* feat: implement ModelFactory for dynamic model instance creation
- Added ModelFactory class to generate stateless model instances based on provider configurations and model classes.
- Updated PluginRegistration to utilize ModelFactory for managing model instances, enhancing code organization and maintainability.
* feat: add unit tests for model registry and mock model provider
- Introduced a new test file for validating model registry functionality.
- Implemented mock classes for model provider and LLM to facilitate testing.
- Added tests to ensure correct model instance retrieval from the registry.
* apply ruff
---------
Co-authored-by: Yeuoly <admin@srmxy.cn>
- Updated `IssueCommentTrigger` and `GithubProvider` to support multiple event selections for GitHub triggers.
- Introduced a new `multiple` field in the trigger parameters to allow users to select multiple events.
- Implemented dynamic fetching of repository options based on OAuth credentials.
- Bumped version in `manifest.yaml` to 0.0.7 to reflect these enhancements.
This update improves the flexibility and usability of the GitHub trigger integration.
- Updated `PluginExecutor` to return a result upon validating provider credentials.
- Renamed `ValidateProviderCredentials` to `ValidateTriggerCredentials` for consistency in trigger actions.
- Improved the `PluginRegistration` class to return OAuth schemas for registered providers.
- Added new error classes for better handling of trigger provider credential validation and OAuth errors.
- Refactored HTTP request and response serialization/deserialization for improved clarity and functionality.
- Enhanced GitHub provider to utilize new error handling and validation mechanisms.
This commit improves the overall structure and error management of the trigger system, ensuring better integration and usability.
- Renamed `WebhookValidationError` to `TriggerValidationError` for consistency in error handling across trigger operations.
- Updated references to the new `TriggerValidationError` in the GitHub provider and trigger interfaces.
- Enhanced the `TriggerProvider` class to raise the new validation error for webhook signature issues.
- Adjusted the `IssueCommentTrigger` to return the correct event response type.
- Improved type hints and imports in various modules for better clarity and organization.
- Updated the GitHub trigger provider to include dynamic parameter options for user selection.
- Refactored the subscription schema to improve parameter definitions and added support for new credential types.
- Enhanced logging for installed triggers to provide clearer information.
- Adjusted the manifest versioning and naming conventions for better clarity and consistency.
- Replaced `parse_raw_request` and `convert_response_to_raw_data` with `deserialize_request` and `serialize_response` for better clarity and functionality.
- Enhanced the `PluginExecutor` methods to utilize the new request and response utilities.
- Updated type hints in the `Subscription` class to use `Mapping` instead of `dict` for improved type safety.
- Refactored HTTP parsing logic to support a wider range of content types and improve overall request handling.
- Introduced new response entities for trigger operations: TriggerInvokeResponse, TriggerDispatchResponse, TriggerSubscriptionResponse, TriggerUnsubscribeResponse, and TriggerRefreshResponse.
- Updated PluginExecutor methods to utilize the new response structures, improving clarity and consistency in trigger handling.
- Enhanced HTTP request parsing and response conversion utilities for better integration with various content types.
- Refactored GitHub provider to align with the updated trigger dispatch and subscription handling mechanisms.
- Removed the resubscribe_trigger method and its associated request entity.
- Updated subscription parameters to streamline the subscribe and unsubscribe processes.
- Enhanced the trigger provider interface to utilize the new subscription schema.
- Adjusted GitHub provider implementation to align with the updated subscription structure.