Commit Graph

130 Commits

Author SHA1 Message Date
Harry 6b58e7f924 feat(trigger): enhance GitHub trigger and parameter handling
- 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.
2025-09-03 13:45:29 +08:00
Harry e9df3cbd4a feat(trigger): enhance trigger execution and response 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.
2025-08-30 19:36:24 +08:00
Harry 3a66fc061b refactor(trigger): remove resubscribe functionality and update subscription handling
- 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.
2025-08-29 15:07:26 +08:00
Harry aa417a750f feat(trigger): refactor trigger system with enhanced provider capabilities
- Update trigger provider interface with subscribe/unsubscribe actions
- Implement GitHub issue comment trigger example
- Enhance plugin executor to support trigger operations
- Improve request entity structure for trigger handling
- Remove deprecated push trigger implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-27 21:42:48 +08:00
Harry f05cbce8f8 feat(trigger): implement trigger provider functionality and actions 2025-08-26 20:52:57 +08:00
Harry f2a079f835 Merge remote-tracking branch 'origin/main' into feat/trigger
# Conflicts:
#	python/dify_plugin/core/entities/plugin/request.py
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/provider_config.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/examples/code_based_workflow/.env
#	python/examples/code_based_workflow/provider/code_based_workflow.yaml
#	python/examples/code_based_workflow/tools/llm.py
#	python/examples/code_based_workflow/tools/llm.yaml
#	python/tests/interfaces/tool/test_costruct_tool.py
2025-08-20 22:00:46 +08:00
Maries c6f83a63e1 feat[0.4.2]: Tool OAuth (#179)
* chore: fix ruff issue

* feat(oauth): implement OAuth

* feat(invoke-message): refactor message handling and introduce InvokeMessage class

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* chore: update dify_plugin version to 0.5.0b4 and clean up github.yaml

* chore: update plugin version to 0.1.2 in manifest.yaml

* feat(session): session context and tool backwards invocation credential support

* feat(oauth): session context and tool backwards invocation credential support

* feat: update README and requirements for OAuth support in version 0.4.2

* feat: add .gitignore to exclude IDE files and secret keys

* chore: apply ruff

* feat: bump version to 0.4.2b1

* feat: update GitHub plugin configuration for OAuth support and improve credential handling

* feat: update .gitignore to exclude dify plugin files and public keys

* feat: fix credential validation for GitHub API and bump version to 0.2.1

* feat: update GitHub plugin to support multiple access tokens and bump version to 0.2.5

* chore: apply ruff

* feat: add ToolProviderOAuthError for improved OAuth error handling in GitHub plugin

* chore: apply ruff

* chore: bump version to 0.4.2

* chore: update examples sdk version to 0.4.2

* fix: thread deadlock in PluginRunner when running tests without gevent monkey patching

* feat: add support for refreshing OAuth credentials in Plugin and GitHub provider

* feat: refactor OAuth credential handling to return structured OAuthCredentials object

* apply ruff

* feat: refactor OAuth credential handling to use ToolOAuthCredentials for improved structure

* feat: reorganize imports in __init__.py for improved clarity and structure

* feat: add Microsoft To Do plugin for refresh token example

* chore: apply ruff

* fix: update author in GitHub configuration and clean up Microsoft To Do schema

* chore: bump version to 0.4.2b2 in pyproject.toml

* feat: update Microsoft To Do plugin to handle OAuth token encoding and version bump

* feat:remove inelegant example

* chore: update dify_plugin version to 0.4.2

* chore: bump version to 0.4.2 in pyproject.toml

---------

Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-07-23 13:49:01 +08:00
Yeuoly 132d6572ee feat[0.4.0]: add dynamic select support (#163)
* feat: add dynamic select support

- Introduced ParameterOption class for parameter options with value, label, and optional icon.
- Updated ToolParameterOption to inherit from ParameterOption.
- Added DYNAMIC_SELECT to CommonParameterType enum.
- Implemented fetch_parameter_options method in Tool class for fetching parameter options.
- Created DynamicSelectProtocol for dynamic select functionality.
- Added tests for Tool construction and parameter options fetching.

* feat: implement dynamic parameter fetching functionality

- 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.

* feat: enhance plugin functionality with dynamic parameter options and trigger interface

- Added dynamic parameter fetching capabilities to the Plugin class.
- Introduced TriggerProvider and Trigger classes for managing trigger functionalities.
- Updated Tool interface to enforce implementation of credential validation and OAuth methods.
- Enhanced error messages for NotImplementedError in ToolProvider and Trigger classes.
- Removed deprecated tools and their configurations from the codebase.

* docs: update README.md to include support for `dynamic-select` parameter type in manifest versioning

* chore: remove code_based_workflow
2025-06-27 15:59:22 +08:00
Yeuoly 5415dbafa9 feat: enhance plugin functionality with dynamic parameter options and trigger interface
- Added dynamic parameter fetching capabilities to the Plugin class.
- Introduced TriggerProvider and Trigger classes for managing trigger functionalities.
- Updated Tool interface to enforce implementation of credential validation and OAuth methods.
- Enhanced error messages for NotImplementedError in ToolProvider and Trigger classes.
- Removed deprecated tools and their configurations from the codebase.
2025-06-25 15:03:28 +08:00
Novice 31d2edc099 fix: handle mcp array and object type 2025-06-19 16:54:54 +08:00
Novice 19dc991d25 chore: remove the unused file 2025-05-28 15:48:10 +08:00
Novice f614c4345c feat: add mcp tool type 2025-05-28 15:43:55 +08:00
Yeuoly 6d77e16b7d chore: update dependencies and remove pydub from main requirements (#135)
- Removed `pydub` from the main dependencies in `pyproject.toml`.
- Added `pydub` back to the `requirements.txt` for the OpenAI example.
2025-05-19 22:19:49 +08:00
Yeuoly 038edf957e feat: generate docs automatically (#121)
- Added CLI for generating documentation with `generate-docs` command.
- Introduced `SchemaDocumentationGenerator` to create structured documentation from schemas.
- Implemented `SchemaDoc` class for schema metadata and documentation management.
- Updated `PluginConfiguration` to include descriptions for plugin components.
- Added support for outside reference fields in the SchemaDocumentationGenerator to improve documentation clarity.
- Updated SchemaDoc to include outside_reference_fields parameter.
- Modified various entity classes to utilize outside_reference_fields for better schema representation.
- Introduced new container type checks and helper methods for handling dynamic fields in documentation generation.
2025-04-30 14:48:03 +08:00
QuantumGhost 5cb24625c3 ci(python): Add CI Pipeline for Python SDK (#72)
* chore(python): temporarily disable `UP007` rule in Ruff

Disable the `UP007` rule temporarily due to numerous existing
violations in the current codebase.

* ci(python): add lint and test for Python SDK

* ci: Add mega-linter

* chore(python): Add final newline to markdown files

* fix(python): Fix linter issues by using ruff's auto fix

* fix(python): Fix TRY400 linter violations

Ruff suggests using `logger.exception` to log when
logging an exception, instead of using `logging.error`.

The former logs the exception and the traceback
automatically.

ref: https://docs.astral.sh/ruff/rules/error-instead-of-exception/

* fix(python): fix ruff linter violations

* test(python): Add Test cases for LLM entities

Test the initialization of `LLMResult` and `LLMResultChunk`.

* test(python): Add test for `AgentModelConfig`

Ensures that the `history_prompt_messages` attribute is
not shared between instances of `AgentModelConfig`.

* chore(python): output diffs in Ruff's format check

* style(python): format code with Ruff

* chore(python): Add a bash script for fix and format python code

* chore: add `persist-credentials: false` to checkout action

Enhances security by preventing subsequent
steps from accessing GitHub credentials, reducing
potential attack surfaces.

Ref: https://github.com/actions/checkout#checkout-v4
2025-04-14 20:25:19 +08:00
Yeuoly 12ad9db9b5 enhancement: remove prompt_messages from LLMResult and LLMResultChunk (#88)
* refactor: remove prompt_messages from LLMResult and LLMResultChunk

* fix: add backward compatibility for deprecated prompt_messages field in LLMResult and LLMResultChunk

* fix: set default value for prompt_messages field to an empty list in LLMResult and LLMResultChunk for backward compatibility

* feat: add test for LLMResult to validate prompt_messages field and ensure backward compatibility

* apply ruff
2025-04-11 15:23:05 +08:00
Novice a90dd6782b fix: ReAct Agent add memory 2025-03-26 16:53:36 +08:00
Novice 72d3e1ad03 Merge branch 'main' into feat/agent-memory 2025-03-26 13:20:06 +08:00
QuantumGhost ef530695c7 feat(python): Enable Ruff ruleset (RUF), disable preview mode (#70)
* feat(python): Enable Ruff ruleset (RUF)

Refactor the codebase to address and resolve pre-existing style
violations flagged by the Ruff ruleset.

* feat(python): disable preview mode in Ruff

Preview rules in Ruff are unstable and subject to frequent changes.
Disabling them helps prevent potential confusion for developers.

* chore(python): disable deprecated UP038 rule in Ruff

The UP038 rule is deprecated and its suggested practice is not recommended.
Disabling this rule helps avoid unnecessary code rewrites.
2025-03-25 23:23:00 +09:00
QuantumGhost bf79e6591d feat(python): Enable pycodestyle (W) warning ruleset with ruff (#69)
Refactor codebase to fix pre-existing style issues flagged by the ruleset.
2025-03-24 19:21:00 +08:00
QuantumGhost 9e084d7d09 feat(python): upgrade ruff to v0.11.2, integrate flake8-bandit ruleset for security linting (#65)
* chore(python): update .gitignore for Python SDK

Adjust .gitignore for Python SDK based on the templated generated by
gitignore.io, with minor custom modifications.

* chore: add .editorconfig for consistent formatting

Add a .editorconfig file to enforce consistent file encoding,
indentation, and end-of-line characters across the project.

* chore(python): upgrade ruff version to v0.11.2

* feat(python): Integrate flake8-bandit ruleset for security linting

Enable the flake8-bandit (S) ruleset in ruff to enforce security-related
best practices and mitigate potential vulnerabilities in the codebase.

Suppress existing issues in the current code using `noqa` comments, primarily for
instances of `requests` calls without a specified `timeout` parameter.
2025-03-24 18:00:14 +08:00
GumKey a4da30d106 fix:add function to validate only stream mode model credentials (#47)
* fix:add function to validate only stream mode model credentials

* fix:add function to validate only stream mode model credentials

* fix:add function to validate only stream mode model credentials

* update: Stream credentials validation failed

* update: Stream credentials validation failed

---------

Co-authored-by: Xenos <sm2052@admindeMacBook-Pro.local>
2025-03-24 17:38:02 +08:00
Novice 193c061333 feat: add history message feature 2025-03-24 09:20:08 +08:00
Novice 4f5d318030 feat: agent node add memory 2025-03-17 14:51:29 +08:00
Novice Lee afc8397bc3 feat: add metadata to log 2025-02-07 10:53:20 +08:00
Novice Lee 9db1efdb92 feat: support workflow tools 2025-01-22 13:41:07 +08:00
Novice Lee fb24978387 feat: add agent node log 2025-01-09 08:51:43 +08:00
Novice 43e58b93e7 Merge pull request #7 from langgenius/feat/agent-node
feat: add agent strategy support
2025-01-08 07:50:49 +08:00
Novice Lee 92558f5c07 feat: add agent strategy support 2025-01-08 07:48:27 +08:00
Yeuoly 0774668145 feat: webapp 2025-01-04 00:01:14 +08:00
Yeuoly 82438a99a2 feat: support parameter auto generate 2024-12-26 17:28:42 +08:00
Yeuoly 74c8f073c9 feat: add label to agent log 2024-12-15 18:15:01 +08:00
Yeuoly c93028221c refactor: support agent 2024-12-12 19:15:00 +08:00
Yeuoly a623638d01 refactor: rename agent to agent strategy 2024-12-12 18:26:34 +08:00
Yeuoly 15c14aedf8 feat: agent plugin 2024-12-09 22:01:41 +08:00
Yeuoly 1477f72b70 feat: support mime type and type for File 2024-12-03 15:48:59 +08:00
Yeuoly 435c0da60e refactor: use absolute paths 2024-12-03 15:19:19 +08:00
-LAN- 44a9ec53b6 chore: Use removeprefix
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 22:23:15 +08:00
-LAN- b4b0c29169 refactor: prevent raise-without-from-inside-except
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 22:18:56 +08:00
-LAN- da41fbf0ab refactor: suppressible-exception
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 22:13:06 +08:00
-LAN- 061cf9e456 chore: prevent if-else-block-instead-of-if-exp
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 22:05:48 +08:00
-LAN- 6358a80025 chore: prevent collapsible-if
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:59:13 +08:00
-LAN- 75cec127f4 refactor(tts.py): Use context manager instead of __enter__()
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:42:14 +08:00
-LAN- 4551f79ca3 chore: Fix lines-too-long
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:27:12 +08:00
-LAN- b3e0612e53 chore: Apply format
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:18:36 +08:00
-LAN- 37128aeadd chore: Apply unsafe auto-fixes and check manually
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:17:21 +08:00
-LAN- 5858fe715e chore: Apply formet and auto fix
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:10:36 +08:00
Yeuoly ad6ca50b38 feat: summarize, fix: missing files 2024-12-02 16:00:34 +08:00
Yeuoly 87054e4178 feat: openai compat 2024-11-29 16:46:48 +08:00
Yeuoly 01b46e76ba cleanup 2024-11-29 16:13:23 +08:00