Commit Graph

48 Commits

Author SHA1 Message Date
Yeuoly 6d6fb3892e feat: add InvokeLLMWithStructuredOutput functionality (#369)
* feat: add InvokeLLMWithStructuredOutput functionality

- Introduced a new method InvokeLLMWithStructuredOutput to the BackwardsInvocation interface for handling structured output requests.
- Added corresponding request and response types to support structured output.
- Implemented the method in both RealBackwardsInvocation and MockedDifyInvocation for testing purposes.
- Updated permission handling and task execution for the new structured output invocation type.

This enhancement allows for more flexible and detailed responses from the LLM, improving the overall functionality of the invocation system.

* refactor: enhance LLMResultChunkWithStructuredOutput structure

- Updated the LLMResultChunkWithStructuredOutput type to include additional fields: Model, SystemFingerprint, and Delta.
- Added comments to clarify the reasoning behind the structure and the use of type embedding for JSON marshaling.

This change improves the clarity and functionality of the LLMResultChunkWithStructuredOutput type, ensuring proper JSON serialization.

* refactor: streamline LLMResultChunk construction in InvokeLLMWithStructuredOutput

- Simplified the construction of LLMResultChunk and LLMResultChunkWithStructuredOutput by removing unnecessary type embedding.
- Enhanced readability and maintainability of the code while preserving functionality.

This change contributes to cleaner code and improved clarity in the handling of structured output responses.
2025-06-30 12:07:46 +08:00
Yeuoly a70d808dd0 feat(dynamic_select): implement dynamic parameter fetching functionality (#358)
* feat(dynamic_select): implement dynamic parameter fetching functionality

- Added FetchDynamicParameterOptions function to handle dynamic parameter selection.
- Introduced new access type and action for dynamic select in access_types.
- Updated HTTP server routes to include the new endpoint for fetching dynamic parameters.
- Created necessary service and controller files for dynamic select operations.

* refactor(access_types): rename dynamic select access type to dynamic parameter

- Updated access type constants to reflect the change from PLUGIN_ACCESS_TYPE_DYNAMIC_SELECT to PLUGIN_ACCESS_TYPE_DYNAMIC_PARAMETER.
- Adjusted related references in the PluginDispatchers and FetchDynamicParameterOptions function to maintain consistency.
2025-06-27 19:24:59 +08:00
Novice 0167554a03 feat: add mcp tool type (#315) 2025-05-30 14:05:20 +08:00
Byron.wang b3c68cbeec add packaged file info when plugin package larger than max size (#312) 2025-05-27 13:02:25 +08:00
Yeuoly 478c98da5c fix: signature dose not work as expected, if upload new pkg to old dify (#311)
- Updated the  method in the  interface to remove the  parameter, simplifying its usage.
- Introduced a new  function to provide a default verification structure.
- Added a  file to store verification data, improving the plugin signing process.
- Enhanced tests in  to validate the verification process, ensuring proper handling of success and failure scenarios.
- Refactored related code to accommodate the new verification structure and improve overall maintainability.
2025-05-26 13:10:34 +08:00
Yeuoly 9a1da25d59 feat: Enhance plugin signing with authorized category verification (#293)
* feat: Enhance plugin signing with authorized category verification

- Added support for an `authorized_category` flag in the signature command to validate the category before signing.
- Updated the `Sign` function to accept a verification parameter, allowing for category-based signing.
- Enhanced error handling for invalid categories during the signing process.
- Updated tests to cover new verification scenarios and ensure proper functionality with the authorized category.

* fix

* fix

* test

* test: Add unit test for plugin verification without verification field

- Introduced a new test case to verify the behavior of plugins that lack a verification field.
- Updated the signature_test.go file to include the test, ensuring proper functionality of the signing process.
- Removed the outdated verifier_test.go file and associated test data to streamline the codebase.
2025-05-21 20:05:45 +08:00
Yeuoly d02885674a feat: add repository URL support for plugin manifest (#262)
* feat: add repository URL support for plugin manifest

- Introduced a new optional flag for specifying the plugin repository URL during initialization.
- Updated the InitPluginWithFlags function to handle the new repository parameter.
- Enhanced profile management to include repository input.
- Modified related tests to validate the new repository functionality.

* fix: improve input validation in profile checkRule method

- Updated the checkRule method to ensure cursor is within valid range before checking for empty input values. This change prevents potential out-of-bounds errors and enhances the robustness of the input validation process.
2025-05-07 18:35:38 +08:00
Yeuoly d13fb55f4f Refactor/oauth parameters (#247)
* feat: implement OAuth functionality in plugin daemon

- Added OAuth service methods for getting authorization URLs and credentials.
- Updated access types to include OAuth-related actions.
- Created new controller for handling OAuth requests.
- Introduced entities for OAuth results and requests.
- Enhanced plugin entities to support OAuth schema in tool declarations.

* feat: add OAuth endpoints for authorization and credentials retrieval

- Introduced new POST endpoints for obtaining authorization URLs and credentials in the OAuth controller.
- Enhanced the plugin dispatch group to include these new OAuth routes, improving integration with OAuth services.

* refactor: clean up OAuth entity and request structures

- Removed unused validation logic and constants from the OAuth entity file.
- Added required provider field to OAuth request structures for better validation and clarity.
2025-04-27 14:35:43 +08:00
Yeuoly d80630acd5 feat: implement OAuth functionality (#245)
* feat: implement OAuth functionality in plugin daemon

- Added OAuth service methods for getting authorization URLs and credentials.
- Updated access types to include OAuth-related actions.
- Created new controller for handling OAuth requests.
- Introduced entities for OAuth results and requests.
- Enhanced plugin entities to support OAuth schema in tool declarations.

* feat: add OAuth endpoints for authorization and credentials retrieval

- Introduced new POST endpoints for obtaining authorization URLs and credentials in the OAuth controller.
- Enhanced the plugin dispatch group to include these new OAuth routes, improving integration with OAuth services.
2025-04-27 13:59:57 +08:00
Chieh Wang 1121069521 feat: Add Citations and Attributions to Agent Node (#236)
* feat: support var-selector params & surpport retriever_resources messsage

* opt: rename var-selector to any
2025-04-27 13:41:21 +08:00
Yeuoly ea67e810dd feat: add backward compatibility for LLMResultChunk and new test case (#240)
- Implemented a compatibility layer in LLMResultChunk to ensure backward compatibility with the old format by adding a `PromptMessages` field.
- Added a new test case `TestLLMResultChunkCompatibility` to verify the JSON marshaling behavior of the updated LLMResultChunk structure.
2025-04-24 13:37:46 +08:00
Yeuoly 280caa3ae0 Fix/windows remap assets (#212)
* refactor(plugin_packager): update Assets method to use OS-independent path separator

- Modified the Assets method in FSPluginDecoder and PluginDecoderHelper to accept a separator argument, ensuring compatibility across different operating systems.
- Updated the Assets method in ZipPluginDecoder to use '/' as the separator for zip files, addressing issue #166.
- Improved code readability by adjusting formatting in the ZipPluginDecoder struct.

* fix: add tests
2025-04-16 17:51:17 +08:00
Junjie.M 99cad2ae51 feat: agent strategy parameter add help field (#211) 2025-04-16 17:22:13 +08:00
Yeuoly c952664139 Feat/support minimal dify version required (#203)
* feat(plugin): add version requirement functionality to plugin initialization

- Introduced a new `version_require` sub-menu to handle minimal Dify version input.
- Updated the plugin initialization process to include the new version requirement.
- Enhanced the `PluginMeta` struct to store the minimal Dify version.
- Added validation for the minimal Dify version input to ensure correctness.

* fix(plugin): rename MinimalDifyVersion to MinimumDifyVersion for consistency

- Updated the `PluginMeta` struct to change the field name from `MinimalDifyVersion` to `MinimumDifyVersion`.
- Adjusted the plugin initialization logic to reflect the new field name, ensuring proper handling of version requirements.
2025-04-14 20:02:34 +08:00
Yeuoly d74cfea892 enhancement(llm): remove non-required PromptMessages field from LLMResultChunk (#194) 2025-04-11 14:52:11 +08:00
Junyan Qin (Chin) a577e462c6 feat: add supports for provider to register array[tool] type field 2025-04-07 16:14:59 +08:00
Yeuoly eed91f2359 feat: add X-Original-Host header handling in endpoint requests and improve request redirection URL construction 2025-04-07 13:28:53 +09:00
kurokobo 01747753f7 feat: add tests for third-party signature verification 2025-04-02 13:48:08 +00:00
kurokobo c8fc7907c9 fix: move test files to testdata 2025-04-02 13:48:08 +00:00
kurokobo 6f75bcca43 feat: verify plugin with public keys specified in environment variable in addition to official one 2025-04-02 13:48:04 +00:00
kurokobo ee1a0dca15 feat: add signature subcommand to cli to generate key pair, sign, and verify difypkg file 2025-04-01 14:20:23 +00:00
Yeuoly bc30461567 Merge pull request #163 from langgenius/fix/friendly-identity
fix: enhance error message for invalid plugin unique identifier
2025-03-30 21:10:15 +09:00
Yeuoly 90cc50a153 fix: enhance error message for invalid plugin unique identifier 2025-03-30 20:24:52 +09:00
Yeuoly 084c4a24ad feat: add ConvertAnyMap function and corresponding tests for map conversion 2025-03-29 02:02:59 +09:00
Novice e14a209411 fix: handle the feature field JSON marshal 2025-03-27 13:55:07 +08:00
Novice a58a279105 fix: the list entity unmashal 2025-03-26 13:07:29 +08:00
Novice 75f07820c2 feat: Agent plugin add features tag 2025-03-24 09:21:21 +08:00
kurokobo bc4c60f93e fix: respect resolution settings for vision sent from api 2025-03-16 13:12:15 +00:00
Yeuoly 1944a829d2 feat: add plugin access action to session write method (#64)
Modify session write method to include a new plugin access action parameter across multiple runtime implementations. This change allows for more granular tracking and handling of plugin interactions by introducing an optional action context to the write method.
2025-03-06 14:51:32 +08:00
Che Kun 8ccedd3a53 Add missing url field of PromptMessageContent (#49)
MultiModal content supports both base64 and url format, but lost in dify-plugin-daemon server
2025-03-04 16:36:10 +08:00
非法操作 9c79301db2 fix tool provider panel not display help message (#50)
* fix tool provider panel not display help message

* fix
2025-03-04 16:27:30 +08:00
Yeuoly 4dbea42603 refactor: make user ID optional in plugin user identity (#41) 2025-02-28 12:48:00 +08:00
-LAN- de7ecbefe2 fix: make description field optional in PromptMessageTool (#38) 2025-02-28 10:47:13 +08:00
Yeuoly 0b41e141af refactor: improve plugin universal event parsing with optional status text (#37) 2025-02-27 16:04:17 +08:00
Yeuoly 109050dc16 feat: add JSON marshaling for empty slices in LLM token request 2025-02-26 19:04:54 +08:00
Yeuoly f006bd7f0b fix: improve error logging and session handling in serverless runtime 2025-02-26 15:50:08 +08:00
Yeuoly 6a54d44142 refactor: rename aws_lambda to serverless 2025-02-10 15:04:24 +08:00
Yeuoly 975f9d5c31 fix: move packager to pkg 2025-02-06 18:16:49 +08:00
Yeuoly 50550604ce fix: remove test for empty prompt message content 2025-02-05 12:37:07 +08:00
Yeuoly 472c9da356 fix: remove fmt.Println 2025-02-05 12:34:57 +08:00
Yeuoly ff64f54c26 fix: sync schema of prompt message content 2025-02-05 12:33:38 +08:00
Yeuoly fc3cba5f2c fix: add Plugins.* to PluginDeclaration.Category() 2025-01-24 17:29:42 +08:00
Yeuoly 39449ca3de fix: disbaled spaces and uppercase in tool identity 2025-01-22 15:57:32 +08:00
Yeuoly b2f77fd3b9 fix: using parameter_rule.name as the default paramter.label 2025-01-13 17:17:02 +08:00
Yeuoly 3e6e49671d fix: agent output schema 2025-01-09 14:19:49 +08:00
Yeuoly 0f94beb9ff feat: add command line support to agent 2025-01-08 15:11:08 +08:00
Yeuoly 63f1688fa4 fix: add credentials to ValidateCredentialsResult 2025-01-07 18:44:35 +08:00
Yeuoly 15060ee312 refactor: move entities to pkg 2025-01-06 14:52:02 +08:00