Commit Graph

146 Commits

Author SHA1 Message Date
Harry 64d1f8fdde refactor: update type hints and improve error handling in datasource examples 2025-09-24 14:48:36 +08:00
Harry 4821ef2552 feat: add datasource plugin examples 2025-09-24 14:34:21 +08:00
Harry a9f514d169 feat: update datasource output_schema 2025-08-25 18:57:07 +08:00
Harry 5e2e2844ab : update datasource output_schema 2025-08-25 18:56:23 +08:00
Harry cc28036c9a chore: bump to 0.5.0b11 2025-08-07 17:21:50 +08:00
Harry e126c70b01 chore: apply ruff 2025-07-31 22:59:45 +08:00
Harry d7e109f760 feat: built-in json schema 2025-07-31 22:58:57 +08:00
Harry f3aa56fa04 feat: update notion datasource 2025-07-31 21:52:24 +08:00
Harry 4c0c0f2d3b feat: add online drive plugin example 2025-07-31 21:51:47 +08:00
Harry 530f83697d feat: datasource 2025-07-30 11:30:09 +08:00
Harry 8c0a630fdd chore: apply ruff 2025-07-29 22:06:33 +08:00
Harry 01deb74621 feat: add OAuth credential refresh functionality and update Notion datasource 2025-07-29 22:04:59 +08:00
Harry 8d552ae069 feat: examples 2025-07-29 18:48:16 +08:00
Harry 56db20fc40 Merge branch 'main' into feat/datasource
# Conflicts:
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/core/runtime.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/agent.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/errors/tool.py
#	python/dify_plugin/integration/run.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/examples/github/manifest.yaml
#	python/examples/github/provider/github.py
#	python/examples/github/provider/github.yaml
#	python/examples/github/requirements.txt
#	python/examples/github/tools/github_repositories.py
#	python/examples/github/tools/github_repository_readme.py
#	python/pyproject.toml
2025-07-29 18:44:38 +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
Harry f9b82334e4 chore: update version numbers in manifest and requirements for release 2025-07-18 21:32:02 +08:00
Harry 6bf1431954 feat: enhance type hints and improve error handling in Notion datasource 2025-07-18 20:04:46 +08:00
Harry 6e3a6fc4d4 feat(notion): add Notion datasource plugin with OAuth support and initial implementation 2025-07-18 19:43:31 +08:00
Harry 1621c0c1ed chore: update plugin version to 0.1.2 in manifest.yaml 2025-07-11 22:38:05 +08:00
Harry 8db6eeaf5c chore: update dify_plugin version to 0.5.0b4 and clean up github.yaml 2025-07-11 22:35:54 +08:00
Harry 88f6f63905 feat(plugin-oauth): add credential_id and credential_type to tool parameters 2025-07-11 14:27:05 +08:00
Harry 799bea4c41 feat(invoke-message): refactor message handling and introduce InvokeMessage class 2025-07-07 17:33:23 +08:00
Harry 0ec96aea2a feat(oauth): implement OAuth 2025-07-07 15:16:56 +08:00
Harry 2aedda0652 chore: fix ruff issue 2025-07-06 16:37:04 +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
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