Commit Graph

94 Commits

Author SHA1 Message Date
Yeuoly bace3bfb58 feat(oauth): implement refresh credentials functionality (#408)
* feat(oauth): implement refresh credentials functionality

- Added RefreshCredentials endpoint to handle OAuth credential refresh requests.
- Introduced RequestOAuthRefreshCredentials structure for request validation.
- Updated access types and actions to include refresh credentials.
- Enhanced server routing and controller logic to support the new functionality.
- Updated OAuth entities to include expiration handling for refreshed credentials.

* feat(oauth): add metadata field to OAuthGetCredentialsResult

---------

Co-authored-by: Harry <xh001x@hotmail.com>
2025-07-23 13:11:36 +08:00
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
kinoooolu f096900e62 fix:response data will be discard if tool/llm response buffer overflow (#362)
Co-authored-by: kino.lu <kino.lu@vipshop.com>
2025-06-26 11:44:41 +08:00
Yeuoly 3d28e0ceed feat: Add code generation for plugin controllers and services (#301)
* feat: Add code generation for plugin controllers and services

- Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers.
- Created new files for generated controllers, services, and templates to streamline the plugin invocation process.
- Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files.
- Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features.

* fix
2025-05-23 14:57:56 +08:00
Yeuoly 31d7c7417e feat[0.1.0]: introduce 'run' command for local plugin execution (#283)
* feat: introduce 'run' command for local plugin execution

- Added a new command `run` to launch plugins locally, allowing communication through stdin/stdout.
- Removed the previous `test` command and its associated functionality to streamline the plugin testing process.

* feat: enhance 'run' command with TCP support

- Introduced a new `RunPluginPayload` structure to encapsulate plugin execution parameters.
- Added TCP communication mode to the `run` command, allowing multiple client connections.
- Updated command flags to configure run mode and logging options.
- Implemented client handling and server creation for both stdin/stdout and TCP modes.

* docs: improve comments in RunPlugin function for clarity

- Enhanced comments to provide clearer explanations of the plugin decoding process and the creation of client streams for both stdin/stdout and TCP modes.
- Updated comments to reflect the functionality and behavior of the plugin execution flow.

* refactor: update command structure and enhance plugin invocation handling

- Changed the command structure to add `runPluginCommand` under `pluginCommand` for better organization.
- Introduced `InvokePluginPayload` type to encapsulate plugin invocation details.
- Enhanced `RunPlugin` function to handle responses and errors more effectively, including logging to stdout.
- Updated client handling to support session management and improved error handling during plugin invocation.
- Renamed TCP server creation function for consistency.

* feat: enhance plugin response handling and logging capabilities

- Added a new flag `--response-format` to specify the output format (text or json) for plugin responses.
- Introduced a `logger` to manage logging output to stdout with timestamps and file information.
- Updated `logResponse` and `systemLog` functions to handle different response formats.
- Enhanced `handleClient` and `RunPlugin` functions to utilize the new response format feature.
- Implemented signal handling to clean up temporary directories on shutdown.

* feat: enhance plugin response structure and logging

- Added `InvokeID` to `InvokePluginPayload` and `GenericResponse` for better tracking of plugin invocations.
- Updated `logResponse` to include `InvokeID` in error responses for improved debugging.
- Enhanced client handling in `handleClient` to log plugin readiness and received requests.
- Refactored client stream creation for better readability and consistency.

* feat: add plugin invoke end response type and logging

- Introduced `GENERIC_RESPONSE_TYPE_PLUGIN_INVOKE_END` to enhance response tracking for plugin invocations.
- Updated `handleClient` to log the end of plugin invocation, improving visibility into the plugin lifecycle.

* chore: remove fullfeature tags
2025-05-16 14:20:29 +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
Yeuoly 73a4d93a62 benchmark/local-runtime (#219)
* benchmark/local-runtime

* test

* fix

* fix: add uv

* fix: uv path

* fix: get uv

* done
2025-04-17 00:03:28 +08:00
Yeuoly 7c0db82d8c feat(invocation): add FetchApp method to backwards invocations (#213)
- Introduced FetchApp method in BackwardsInvocation interface to retrieve application data.
- Implemented FetchAppRequest type for request payload with required AppId field.
- Updated RealBackwardsInvocation to handle FetchApp requests and return application data.
- Added mock implementation for FetchApp in the testing suite.
- Enhanced task handling in plugin daemon to support FetchApp invocation.
2025-04-16 18:13:06 +08:00
Yeuoly 0a74b44f11 refactor(plugin_daemon): simplify InvokeTool function and enhance stream handling (#208)
* refactor(plugin_daemon): simplify InvokeTool function and enhance stream handling

- Removed unnecessary complexity from the InvokeTool function by eliminating the blob handling logic and directly returning the response.
- Updated the stream implementation to support blocking writes, allowing for better management of data flow when the buffer is full.
- Added tests for the new blocking write functionality to ensure reliability and performance under high load conditions.

* fix: buffer size
2025-04-15 19:13:24 +08:00
非法操作 e9cd678fad add exist for self.session.storage (#195) 2025-04-11 17:49:30 +08:00
非法操作 25e013618a fix self.session.delete alway success (#12)
* fix self.session.delete alway success

* fix save data always failed

* redis delete response deleted item num

* add deleted num to invocate response
2025-04-11 13:32:52 +08:00
非法操作 b31c142922 fix tts not work well (#74) 2025-03-07 17:40:46 +08: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
Yeuoly 0b41e141af refactor: improve plugin universal event parsing with optional status text (#37) 2025-02-27 16:04:17 +08:00
Yeuoly 6a54d44142 refactor: rename aws_lambda to serverless 2025-02-10 15:04:24 +08:00
Yeuoly 15060ee312 refactor: move entities to pkg 2025-01-06 14:52:02 +08:00
Yeuoly 0d51a59e9d fix: connection closed unexpectedly 2024-12-27 21:45:04 +08:00
Yeuoly a7d1f80ed7 fix: nil pointer dereference of session backwards invocation 2024-12-16 21:04:58 +08:00
Yeuoly 53bd8018fd fix: remove sensitive informations from original endpoint request 2024-12-15 18:07:45 +08:00
Yeuoly 548adf4c0c refactor: rename agent to agent strategy 2024-12-12 18:26:55 +08:00
Yeuoly 7bb4705a48 feat: agent pluign 2024-12-09 22:01:01 +08:00
Yeuoly 407fb941ca feat: support for pprof 2024-12-04 14:15:16 +08:00
Yeuoly d8252c3971 fix: system summarize 2024-12-02 14:26:53 +08:00
Yeuoly 7b145b750a optimize: error messages 2024-11-29 21:55:57 +08:00
Yeuoly 005a32a8d5 fix: InvokeTool response should correctly handle error messages 2024-11-28 19:10:41 +08:00
Yeuoly 2c659c7799 feat: support PluginInvokeError 2024-11-28 17:13:18 +08:00
Yeuoly c20e082cbd fix: discorrect response 2024-11-18 17:10:05 +08:00
Yeuoly 6230ce4f7f feat: support request uploading files 2024-11-14 18:33:38 +08:00
Yeuoly 26fd94ebcd refactor: convert snakecase to camelcase 2024-11-12 21:24:41 +08:00
Yeuoly c3ec7d010a feat: support limitations of persistence storage 2024-11-05 19:05:49 +08:00
Yeuoly d455e29c47 enhancement: support split large blob into small chunks 2024-10-23 16:48:39 +08:00
Yeuoly 9f561c63e3 feat: backwards invoke summary 2024-10-17 19:46:51 +08:00
Yeuoly 59226d36a5 feat: add incoming information into sessions 2024-10-16 15:25:49 +08:00
Yeuoly 1a78a5a903 feat: add incoming session information into requests 2024-10-16 15:00:13 +08:00
Yeuoly 1fae793cdf feat: support tool get runtime parameters 2024-09-29 18:19:50 +08:00
Yeuoly 952de7e4b8 feat: support detailed error message 2024-09-29 12:55:25 +08:00
Yeuoly 9cc4a5bef2 fix: tts 2024-09-26 17:40:43 +08:00
Yeuoly b69398ce4b feat: backwards invoke to nodes 2024-09-24 20:15:46 +08:00
Yeuoly 267d016d3a feat: support cmdline test 2024-09-19 15:57:07 +08:00
Yeuoly 93f1d3b75a fix: ci 2024-09-18 17:35:28 +08:00
Yeuoly fefd3ef53e feat: support cli testing 2024-09-18 17:04:40 +08:00
Yeuoly 0a23ebd3e1 release: aws handler 2024-09-12 23:18:38 +08:00
Yeuoly 72dee6ec68 fix 2024-09-11 19:37:02 +08:00
Yeuoly 5d35741a6c feat: add new interfaces 2024-09-11 19:07:42 +08:00
Yeuoly f179f0f663 feat: add get_tts_model_voices/get_num_tokens/get_model_schema 2024-09-11 18:55:46 +08:00
Yeuoly cdfdbad7eb feat: validate json schema 2024-09-10 20:54:34 +08:00
Yeuoly fb27adfd48 feat: support validate json schema 2024-09-10 19:11:55 +08:00
Yeuoly cda65741b1 feat: install 2024-09-10 18:26:22 +08:00
Yeuoly b397e73e95 feat: support aws installer 2024-09-10 14:52:21 +08:00