Commit graph

2536 commits

Author SHA1 Message Date
Max
5602fcd141
Merge pull request #1053 from trheyi/main
Add OpenAPI and Knowledge Base configurations to Xgen settings
2025-07-30 17:15:39 +08:00
Max
fcb59be5b5 Add OpenAPI and Knowledge Base configurations to Xgen settings
- Introduced OpenAPI settings to include base URL configuration.
- Added Knowledge Base settings to capture features, chunkings, embeddings, and converters.
- Enhanced the processXgen function to integrate these configurations into the Xgen settings map, improving extensibility and functionality.
2025-07-30 17:14:55 +08:00
Max
93291022ec
Merge pull request #1052 from trheyi/main
Add Signin API and update file management endpoints
2025-07-30 16:52:42 +08:00
Max
315618da47 Add Signin API and update file management endpoints
- Introduced a comprehensive Signin API for user authentication, supporting multiple OAuth providers (Google, GitHub, Microsoft, Apple).
- Updated the file management API endpoints to use a singular `/file` path instead of `/files`, enhancing consistency across the API.
- Revised README documentation to include detailed descriptions of the new Signin API and updated file management endpoints.
- Enhanced test cases to reflect the changes in endpoint structure and ensure robust coverage for the new Signin functionality.
2025-07-30 16:49:28 +08:00
Max
cdf9e3cc2c
Merge pull request #1051 from trheyi/main
Refactor Agent API to Chat API for AI interactions
2025-07-27 15:36:22 +08:00
Max
1f2eaf6974 Refactor Agent API to Chat API for AI interactions
- Replaced the Agent API with the Chat API, focusing on AI chat completions with full OpenAI client compatibility and real-time streaming capabilities.
- Updated routing to attach chat handlers instead of agent handlers, ensuring OAuth protection for all endpoints.
- Revised README documentation to reflect the new Chat API structure, including detailed descriptions of endpoints, features, and usage examples.
- Removed the deprecated agent files and their associated documentation to streamline the codebase.
2025-07-27 15:35:55 +08:00
Max
fb1be98083
Merge pull request #1050 from trheyi/main
Add Agent API for AI interactions and chat completions
2025-07-27 15:19:27 +08:00
Max
f54d030486 Add Agent API for AI interactions and chat completions
- Introduced the Agent API to facilitate AI agent interactions, including chat completions with real-time streaming capabilities.
- Implemented endpoints for GET and POST requests to handle chat completions, supporting features like context management and assistant selection.
- Updated the README to include comprehensive documentation for the Agent API, detailing its functionalities, key endpoints, and usage examples.
- Enhanced the OpenAPI structure to integrate the new agent handlers into the existing routing system, ensuring OAuth protection for all endpoints.
2025-07-27 15:18:54 +08:00
Max
e2e64bda97
Merge pull request #1049 from trheyi/main
Implement global configuration for PDF and FFmpeg in converters
2025-07-27 14:48:23 +08:00
Max
723bd8257c Implement global configuration for PDF and FFmpeg in converters
- Added global configuration support for PDF and FFmpeg in the Knowledge Base, allowing converters to utilize default settings.
- Introduced functions to set and get global configurations for PDF and FFmpeg, enhancing flexibility in converter options.
- Updated OCR and Video converters to leverage global settings, with tests ensuring proper functionality and overrides.
- Enhanced test cases to validate the use of global configurations and property overrides, improving test coverage and reliability.
2025-07-27 14:47:49 +08:00
Max
c301784d89
Merge pull request #1048 from trheyi/main
Remove unused provider.go file and enhance chunking options in chunki…
2025-07-27 11:44:46 +08:00
Max
b88e108444 Remove unused provider.go file and enhance chunking options in chunking.go, converter.go, embedding.go, extractor.go, and fetcher.go with detailed property extraction and default values. Update comments for clarity and consistency across providers. 2025-07-27 11:44:19 +08:00
Max
f63c8de301
Merge pull request #1047 from trheyi/main
Refactor storage tests to use unique filenames with UUIDs
2025-07-27 10:06:22 +08:00
Max
8471343311 Refactor storage tests to use unique filenames with UUIDs
- Introduced a `generateTestFileName` function to create unique test filenames for both local and S3 storage tests, reducing conflicts during test execution.
- Updated test cases to utilize the new filename generation method, ensuring consistent and unique identifiers for uploaded files across various scenarios.
- Enhanced readability and maintainability of test code by replacing hardcoded filenames with dynamically generated ones.
2025-07-27 10:05:50 +08:00
Max
8705aee5e5
Merge pull request #1046 from trheyi/main
Implement LocalPath functionality for attachment management
2025-07-27 09:49:25 +08:00
Max
c3b374f043 Implement LocalPath functionality for attachment management
- Added LocalPath method to the Manager and Storage interfaces to retrieve the absolute path and content type of files.
- Enhanced local and S3 storage implementations to support LocalPath, including handling gzipped files and content type detection.
- Introduced comprehensive tests for LocalPath functionality, covering various file types, non-existent files, and gzipped content.
- Updated AddFile API to utilize LocalPath for retrieving file information, improving error handling and response consistency.
2025-07-27 09:48:49 +08:00
Max
a39184c2fa
Merge pull request #1045 from trheyi/main
Enhance attachment management with file storage improvements
2025-07-26 19:26:13 +08:00
Max
070ff59225 Enhance attachment management with file storage improvements
- Refactored the attachment manager to support file uploads with a new storage path and improved metadata handling.
- Implemented chunked uploads and direct content retrieval, enhancing performance and flexibility.
- Updated the file management API to include comprehensive operations for file uploads, downloads, and metadata management.
- Added support for multiple storage backends, including local and S3, with improved error handling and validation.
- Enhanced test coverage for file operations, ensuring reliability and consistency across different storage implementations.
2025-07-26 19:25:41 +08:00
Max
4deb845701
Merge pull request #1044 from trheyi/main
Update S3 tests
2025-07-26 11:07:55 +08:00
Max
0fe42b517f Update S3 storage tests to use UUIDs for file identifiers
- Modified test cases in `storage_test.go` to generate unique file IDs using UUIDs, ensuring no conflicts during tests.
- Updated the download test for non-existent files to utilize a UUID-based identifier, enhancing test reliability.
2025-07-26 11:07:20 +08:00
Max
5d5d0d4ce9 Improve error messages in S3 storage operations
- Enhanced error handling in the S3 storage implementation by including the fileID in error messages for upload, upload chunk, merge chunks, and download operations. This change provides clearer context for debugging and improves the overall error reporting mechanism.
2025-07-25 19:15:18 +08:00
Max
18547852b7 Update S3 configuration in CI workflows
- Replaced the S3_CACHE_PATH variable with S3_PUBLIC_URL in both `pr-test.yml` and `unit-test.yml` workflows, enhancing the integration with S3 by providing a public URL for access.
- This change aligns with the ongoing improvements to S3-related environment variables for better deployment and testing processes.
2025-07-25 19:05:42 +08:00
Max
aab4fde9b4
Merge pull request #1043 from trheyi/main
Add S3 configuration to CI workflows
2025-07-25 18:29:07 +08:00
Max
d8cc1f2390 Add S3 configuration to CI workflows
- Added S3-related environment variables to both `pr-test.yml` and `unit-test.yml` workflows, enabling integration with S3 for testing and deployment.
- Included API, access key, secret key, bucket, and cache path settings to facilitate S3 interactions during CI processes.
2025-07-25 18:28:41 +08:00
Max
6a894df269
Merge pull request #1042 from trheyi/main
Enhance attachment model and add local uploader support
2025-07-25 18:16:24 +08:00
Max
2f13dbbffb Enhance attachment model and add local uploader support
- Introduced a new `Groups` field in the `Attachment` struct to support categorization of attachments.
- Integrated `types.MetaInfo` into `ManagerOption` for improved metadata handling.
- Added a local uploader for attachments, enabling file uploads from a specified local path.
- Updated asset management functions to reflect changes in file metadata and structure.
2025-07-25 18:15:51 +08:00
Max
2376d13979
Merge pull request #1041 from trheyi/main
Refactor attachment handling and enhance upload options
2025-07-25 17:25:54 +08:00
Max
435b482c38 Refactor attachment handling and enhance upload options
- Updated the API to include new upload options for handling different storage types: chat, knowledge, and assets.
- Improved group building logic for attachment uploads based on user, chat, and assistant IDs.
- Removed deprecated attachment files and refactored related code to streamline the attachment management process.
- Enhanced error handling for required fields in upload options, ensuring better validation and user feedback.
2025-07-25 17:25:12 +08:00
Max
51d15e3afd
Merge pull request #1040 from trheyi/main
Implement file and segment management API endpoints with error handling
2025-07-25 16:35:52 +08:00
Max
1c4fd3d20c Implement file and segment management API endpoints with error handling
- Added AddFile, AddText, AddURL, and AddSegments functions to handle file and segment uploads, including JSON request parsing and validation.
- Integrated error handling for invalid requests and uninitialized Knowledge Base instances, ensuring robust API responses.
- Enhanced response structures for success and error cases, improving consistency across the API.
- Updated AutoDetectConverter function to use a single content type parameter instead of multiple content types.
2025-07-25 16:35:19 +08:00
Max
106c107666
Merge pull request #1039 from trheyi/main
Remove obsolete configuration and test files for Knowledge Base
2025-07-25 11:36:54 +08:00
Max
7fa825a334 Remove obsolete configuration and test files for Knowledge Base
- Deleted config.go, config_test.go, types.go, and related test files to streamline the codebase and remove deprecated components.
- Refactored Knowledge Base loading logic to utilize updated configuration structures, enhancing clarity and maintainability.
- Updated references in kb.go to align with the new configuration types, ensuring compatibility with the latest changes.
2025-07-25 11:36:15 +08:00
Max
29a4ad0912
Merge pull request #1038 from trheyi/main
Implement environment variable resolution in configuration parsing an…
2025-07-24 17:09:28 +08:00
Max
bb64eef20d Implement environment variable resolution in configuration parsing and enhance collection management API
- Added a new test for resolving environment variables during configuration parsing, ensuring that environment variables are correctly substituted in the configuration.
- Refactored the configuration handling to resolve environment variables immediately after parsing, improving the clarity and usability of the configuration structure.
- Enhanced the collection management API by standardizing error responses and success responses using a custom response structure, improving consistency across endpoints.
- Implemented cleanup logic for test collections to ensure proper resource management during testing.
2025-07-24 17:08:58 +08:00
Max
6d6230fe5f
Merge pull request #1037 from trheyi/main
Remove deprecated test files and refactor OAuth response handling
2025-07-24 15:53:55 +08:00
Max
8d35e824ae Remove deprecated test files and refactor OAuth response handling
- Deleted obsolete test files for various OpenAPI components, including config_test.go, dsl_test.go, hello_test.go, oauth_test.go, oauth_token_test.go, and openapi_test.go, to streamline the codebase.
- Refactored OAuth response handling by integrating response methods from the response package, ensuring consistent error and success responses across OAuth endpoints.
- Enhanced error handling and response structure for improved clarity and maintainability, aligning with best practices for API responses.
2025-07-24 15:53:29 +08:00
Max
f2234d96d4
Merge pull request #1036 from trheyi/main
Refactor Knowledge Base loading in Load and Reload functions
2025-07-23 18:01:12 +08:00
Max
40519e8429 Refactor Knowledge Base loading in Load and Reload functions
- Moved Knowledge Base loading logic from the Load function to ensure it is consistently handled in both Load and Reload functions.
- Improved error handling by printing errors during Knowledge Base loading in the Reload function, enhancing user feedback.
2025-07-23 17:56:51 +08:00
Max
d8e0130787
Merge pull request #1035 from trheyi/main
Enhance CI workflows and Knowledge Base integration
2025-07-23 17:42:59 +08:00
Max
d25ce68ab9 Enhance CI workflows and Knowledge Base integration
- Updated GitHub Actions workflows to use the latest Ubuntu version and added services for Neo4j, Qdrant, and FastEmbed.
- Integrated FFmpeg and additional utilities into the CI environment, ensuring they are installed and tested during the workflow.
- Implemented environment variable resolution in the Knowledge Base configuration, allowing dynamic configuration based on environment settings.
- Added tests for environment variable resolution in the Knowledge Base configuration, ensuring correct parsing and handling of variables.
2025-07-23 17:42:10 +08:00
Max
694b3f589d
Merge pull request #1034 from trheyi/main
Add Knowledge Base configuration and integration with GraphRag
2025-07-23 17:08:47 +08:00
Max
b76afe23bf Add Knowledge Base configuration and integration with GraphRag
- Introduced a new configuration structure for the Knowledge Base, supporting vector and graph database configurations.
- Implemented JSON parsing methods for loading configurations from files and converting them to JSON format.
- Enhanced the Knowledge Base instance to integrate with GraphRag, allowing for dynamic configuration of vector and graph stores.
- Added feature detection capabilities to determine available functionalities based on the current configuration.
- Updated the Knowledge Base loading process to read from a specified configuration file, improving flexibility and usability.
2025-07-23 17:07:38 +08:00
Max
b0f15fbc92
Merge pull request #1033 from trheyi/main
Add Knowledge Base API endpoints and integrate with OpenAPI router
2025-07-23 15:20:33 +08:00
Max
aae1bccf88 Add Knowledge Base API endpoints and integrate with OpenAPI router
- Introduced the Knowledge Base (KB) API by creating a new kb package with various endpoints for collection and document management, segment management, and search functionalities.
- Updated the OpenAPI router to attach the KB API, ensuring OAuth protection for all endpoints.
- Implemented logging for configuration validation to enhance error handling and user feedback.
2025-07-23 15:19:40 +08:00
Max
1589380d38
Merge pull request #1032 from trheyi/main
Deprecate studio API functions and comment out implementation details
2025-07-22 17:41:30 +08:00
Max
a921a76778 Deprecate studio API functions and comment out implementation details
- Marked the studio API functions (Start, Load, loadDSL, loadScripts) as deprecated, returning an error message to indicate their status.
- Commented out the implementation details of these functions to prevent execution of deprecated functionality, ensuring clarity in the codebase.
2025-07-22 17:41:03 +08:00
Max
2e630c5b03
Merge pull request #1031 from trheyi/main
Deprecate studio API functions and comment out test cases
2025-07-22 17:30:13 +08:00
Max
7bdeec85f9 Deprecate studio API functions and comment out test cases
- Marked the studio API functions (Start, Load, loadDSL, loadScripts) as deprecated, returning an error message to indicate their status.
- Commented out all test cases in studio_test.go to prevent execution of deprecated functionality, ensuring clarity in the test suite.
2025-07-22 17:29:42 +08:00
Max
d3077c217c
Merge pull request #1030 from trheyi/main
Remove hello world endpoints and refactor routing to use new hello pa…
2025-07-22 16:55:49 +08:00
Max
92d21c5389 Remove hello world endpoints and refactor routing to use new hello package
- Deleted the existing hello world handlers from hello.go to streamline the codebase.
- Updated openapi.go to attach the new hello package for handling hello world routes, ensuring OAuth protection is applied correctly.
- Enhanced the README.md to reflect the new structure and provide comprehensive documentation for the hello world API endpoints.
2025-07-22 16:55:24 +08:00