Commit graph

2993 commits

Author SHA1 Message Date
Max
d46ba65b38
Merge pull request #1104 from trheyi/main
Refactor extractor to extraction provider and update related configur…
2025-08-13 16:48:56 +08:00
Max
6acea5b004 Refactor extractor to extraction provider and update related configurations
- Renamed extractor provider to extraction provider across the codebase for consistency and clarity.
- Updated references in configuration files, provider factories, and asset management to reflect the new terminology.
- Removed the extractor provider implementation and associated test files, streamlining the provider structure.
- Adjusted test cases and documentation to align with the new extraction provider framework.
2025-08-13 16:32:30 +08:00
Max
6130907dec
Merge pull request #1103 from trheyi/main
Refactor provider option resolution to require provider type
2025-08-13 16:08:55 +08:00
Max
82788e82a9 Refactor provider option resolution to require provider type
- Updated the resolveProviderOption function to include providerType as a required parameter, enhancing error handling for missing provider types.
- Simplified the provider retrieval logic to directly fetch providers based on the specified type, improving clarity and maintainability.
- Removed redundant comments and streamlined the code for better readability.
2025-08-13 16:06:09 +08:00
Max
735228d797
Merge pull request #1102 from trheyi/main
Update asset modification timestamps and add support for application/…
2025-08-13 11:14:43 +08:00
Max
c9fdb2c01c Update asset modification timestamps and add support for application/octet-stream in attachment.local.yao
- Updated modification timestamps for various asset files to reflect recent changes.
- Added support for "application/octet-stream" MIME type in the attachment.local.yao file to enhance file upload capabilities.
2025-08-13 11:12:52 +08:00
Max
0ddd2e0354
Merge pull request #1101 from trheyi/main
Implement knowledge base configuration retrieval
2025-08-12 18:36:10 +08:00
Max
71b78bc23b Implement knowledge base configuration retrieval and enhance collection/document handling
- Added GetConfig function to retrieve the knowledge base configuration, ensuring proper initialization checks.
- Refactored CreateCollection, AddFile, AddText, and AddURL functions to utilize the new GetConfig method for improved error handling and database record management.
- Introduced preparation functions (PrepareCreateCollection, PrepareAddFile, PrepareAddText, PrepareAddURL) to streamline request handling and database data preparation.
- Enhanced error responses and rollback mechanisms for document and collection operations, improving robustness and clarity in error handling.
2025-08-12 18:35:30 +08:00
Max
d3e649ebfe Add default collection and document model settings in Config struct
- Introduced default values for CollectionModel and DocumentModel in the Config struct to ensure proper initialization.
- Updated UnmarshalJSON method to set these defaults if not explicitly configured, enhancing the robustness of the configuration handling.
2025-08-12 17:31:38 +08:00
Max
6699c11097
Merge pull request #1100 from trheyi/main
Refactor knowledge base model structure to support new collection and…
2025-08-12 17:21:40 +08:00
Max
bab6eec3c3 Refactor knowledge base model structure to support new collection and document formats
- Replaced the existing kb.mod.yao file with two new files: collection.mod.yao and document.mod.yao, enhancing the organization of knowledge base models.
- Updated references in system and test models to reflect the new structure, ensuring compatibility with the updated model paths.
- Adjusted asset loading functions to accommodate the new model files, improving the overall asset management system.
2025-08-12 17:20:45 +08:00
Max
759a87177c
Merge pull request #1099 from trheyi/main
Refactor document management handlers to improve request validation a…
2025-08-12 11:42:37 +08:00
Max
862733d1f4 Refactor document management handlers to improve request validation and async processing
- Introduced a Validator interface and a validateRequest function to streamline request validation across handlers.
- Added checkKBInstance function to ensure the knowledge base instance is initialized before processing requests.
- Implemented handleAsync function to manage asynchronous processing for file and text addition.
- Updated AddFile and AddText functions to utilize the new validation and async handling logic.
- Added async variants for AddFile and AddText to support non-blocking operations.
- Enhanced AddURL and its async variant with similar validation and processing improvements.
2025-08-12 11:41:48 +08:00
Max
4d9d4f9ae4
Merge pull request #1098 from trheyi/main
Add provider settings retrieval and update CreateCollection request structure
2025-08-12 11:11:29 +08:00
Max
fe49cc5fa1 Update collection tests to reflect new embedding provider configuration
- Modified test cases for CreateCollection, RemoveCollection, and CollectionIntegration to use the new embedding provider and option values.
- Removed outdated fields related to the previous embedding model and added locale support for provider reading.
- Ensured consistency in the configuration structure across all relevant tests.
2025-08-12 11:10:35 +08:00
Max
b7ad7bfed7 Add provider settings retrieval and update CreateCollection request structure
- Introduced ProviderSettings type to encapsulate provider configuration details.
- Implemented getProviderSettings function to resolve provider settings based on provider ID and option value.
- Updated CreateCollection function to utilize provider settings, including dimension and metadata enhancements.
- Refactored CreateCollectionRequest to include a new CreateCollectionConfig struct for better organization of embedding provider details.
2025-08-12 11:06:19 +08:00
Max
9be07f8482
Merge pull request #1097 from trheyi/main
Add tests for Structured and Semantic schema retrieval
2025-08-10 17:21:49 +08:00
Max
d750365ed9 Add tests for Structured and Semantic schema retrieval
- Introduced new test cases for Structured and Semantic providers to validate schema retrieval functionality.
- Updated existing tests across various providers to ensure they check for non-nil schemas, enhancing error handling and test coverage.
- Ensured consistency in error messages for schema validation across different provider tests.
2025-08-10 17:21:13 +08:00
Max
f82d4066d1
Merge pull request #1096 from trheyi/main
Refactor provider schemas to utilize bindata for enhanced localizatio…
2025-08-10 15:52:58 +08:00
Max
eb1bf43d61 Refactor provider schemas to utilize bindata for enhanced localization support
- Updated Schema methods for various providers (OpenAI, Fastembed, MCP, OCR, Office, UTF8, Video, Vision, Whisper) to retrieve schemas from bindata, improving localization capabilities.
- Removed outdated JSON files for embedding, extractor, and fetcher providers, streamlining the data structure.
- Enhanced the overall provider management by ensuring schemas are dynamically loaded based on locale, facilitating better multi-language support.
2025-08-10 15:51:34 +08:00
Max
f70f675d45
Merge pull request #1095 from trheyi/main
Update test for Config struct to clarify feature computation timing
2025-08-09 17:29:20 +08:00
Max
6ffc847382 Update test for Config struct to clarify feature computation timing
- Modified the test case for UnmarshalJSON in config_test.go to specify that features are not computed during the unmarshalling process but rather after providers are loaded.
- Added comments to explain the manual computation of features for testing purposes, ensuring clarity in the test logic.
2025-08-09 17:28:57 +08:00
Max
6950a1481a
Merge pull request #1094 from trheyi/main
Refactor KnowledgeBase loading process to compute features after prov…
2025-08-09 17:14:21 +08:00
Max
65d04bb583 Refactor KnowledgeBase loading process to compute features after provider loading
- Moved the computation of features in the Config struct to occur after loading providers, ensuring that all necessary data is available for accurate feature computation.
- Updated comments for clarity regarding the loading sequence of providers and feature computation.
2025-08-09 17:13:52 +08:00
Max
7af1eae1fb
Merge pull request #1093 from trheyi/main
Enhance knowledge base provider management with multi-language support
2025-08-09 16:58:33 +08:00
Max
4bdd921d4c Enhance knowledge base provider management with multi-language support
- Implemented loading of providers from directories, allowing for multi-language configurations.
- Updated the KnowledgeBase struct to include a Providers field for managing provider configurations.
- Refactored GetProviders and GetProvider methods to utilize the new multi-language provider system, improving localization support.
- Added comprehensive test cases to validate provider loading and retrieval functionality across different languages.
2025-08-09 16:57:23 +08:00
Max
e6c5631b57
Merge pull request #1092 from trheyi/main
Add provider management functionality and enhance schema retrieval
2025-08-09 11:24:32 +08:00
Max
0251bdc8d7 Add provider management functionality and enhance schema retrieval
- Implemented GetProviders and GetProvider methods to retrieve providers based on type and ID, improving the knowledge base's provider management capabilities.
- Enhanced the Schema methods for chunking providers to retrieve schemas from bindata, ensuring better integration with the overall system.
- Updated OpenAPI routes to include endpoints for provider management, allowing for easier access to provider information via HTTP requests.
2025-08-09 11:23:51 +08:00
Max
d8fe1fabf0
Merge pull request #1091 from trheyi/main
Update Schema methods to include locale parameter for providers
2025-08-09 09:12:14 +08:00
Max
08c83e09e6 Update Schema methods to include locale parameter for providers
- Modified Schema methods across various providers (chunking, embedding, extractor, fetcher, converters) to accept an additional locale parameter, enhancing localization support.
- Updated corresponding test cases to reflect the changes in method signatures and ensure proper functionality with the new locale argument.
2025-08-09 09:11:25 +08:00
Max
8c4e08ef7c
Merge pull request #1090 from trheyi/main
Refactor Config struct to ensure consistent JSON/YAML field handling
2025-08-08 17:44:00 +08:00
Max
28368a31b0 Refactor Config struct to ensure consistent JSON/YAML field handling
- Updated the Config struct to include `omitempty` for optional fields in JSON and YAML serialization, ensuring that empty values are omitted from the output.
- Enhanced the Provider struct and related configurations to maintain consistency in field definitions and improve clarity in the codebase.
2025-08-08 17:41:45 +08:00
Max
8794e414a3
Merge pull request #1089 from trheyi/main
Add UpdateCollectionMetadata functionality
2025-08-07 08:06:13 +08:00
Max
c63dfa2112 Add UpdateCollectionMetadata functionality
- Implemented UpdateCollectionMetadata function to handle metadata updates for existing collections.
- Added request structure and validation for updating collection metadata.
- Integrated new endpoint in the router for updating collection metadata via PUT request.
2025-08-07 08:05:19 +08:00
Max
d41ddf464d
Merge pull request #1088 from trheyi/main
Add uploader configuration and default value in Config
2025-08-06 10:08:47 +08:00
Max
d653d2a51d Add uploader configuration and default value in Config
- Introduced Uploader field in the Config struct to allow optional file uploader configuration.
- Implemented logic to set a default uploader value if not explicitly configured during JSON unmarshalling.
2025-08-06 10:08:19 +08:00
Max
a7a8a75b1c
Merge pull request #1087 from trheyi/main
Update collection validation to ignore empty collection name error
2025-08-05 17:27:33 +08:00
Max
1119b99c0d Update collection validation to ignore empty collection name error
- Modified the validation logic in the CreateCollectionRequest to allow the "collection name cannot be empty" error to be ignored during CreateCollectionOptions validation, improving flexibility in request handling.
2025-08-05 16:39:48 +08:00
Max
b4de3f4e5e
Merge pull request #1086 from trheyi/main
Add OpenAPI OAuth handling in defaultGuard
2025-08-05 12:17:00 +08:00
Max
54bf6c1ed2 Add OpenAPI OAuth handling in defaultGuard
- Implemented guardOpenapiOauth function for OAuth token validation and session ID management.
- Enhanced defaultGuard to check for OpenAPI OAuth requests and process them accordingly.
- Added utility functions for access token and session ID retrieval from requests.
2025-08-05 12:16:14 +08:00
Max
dda37b93bd
Merge pull request #1085 from trheyi/main
Add OpenAPI OAuth support in guards
2025-08-05 11:37:47 +08:00
Max
f464638213 Add OpenAPI OAuth support in guards
- Introduced guardOpenapiOauth function to handle OAuth token validation and session ID retrieval.
- Updated guardCookieJWT and guardBearerJWT functions to integrate OpenAPI OAuth checks.
- Enhanced backward compatibility for existing cookie-based JWT handling.
- Added utility functions for access token and session ID extraction from requests.
2025-08-05 11:36:44 +08:00
Max
9e2ec76b11
Merge pull request #1084 from trheyi/main
Enhance hello world endpoints with query string and post payload logging
2025-08-05 09:28:54 +08:00
Max
4a2106371e Enhance hello world endpoints with query string and post payload logging
- Added functionality to capture and return the raw query string and post payload in the JSON response for both public and protected hello world endpoints.
- Improved response structure to include additional context for debugging and client-side processing.
2025-08-05 09:28:25 +08:00
Max
a7ec1d8573
Merge pull request #1083 from trheyi/main
Enhance refresh token functionality and response handling
2025-08-04 16:53:49 +08:00
Max
5657c75201 Enhance refresh token functionality and response handling
- Updated MakeRefreshToken and generateRefreshToken methods to accept an optional expiresIn parameter for customizable token expiration.
- Modified storeRefreshTokenWithScope to handle dynamic expiration times based on the provided parameter.
- Enhanced the authback function to send cookies with access and refresh tokens, including their respective expiration times.
- Updated LoginResponse structure to include RefreshTokenExpiresIn for better client-side management of token lifetimes.
- Adjusted client configuration to set default refresh token expiration duration.
2025-08-04 16:52:57 +08:00
Max
9f6ad4ab17
Merge pull request #1082 from trheyi/main
Add scope field to dynamic client registration tests
2025-08-04 11:20:11 +08:00
Max
c1b28f3b69 Add scope field to dynamic client registration tests
- Updated test cases for dynamic client registration to include a scope field with values "openid profile email".
- Ensured that tests reflect the expected behavior when scope is provided, enhancing validation coverage for client registration requests.
2025-08-04 11:19:45 +08:00
Max
4987a36f26
Merge pull request #1081 from trheyi/main
Update OAuth client configuration and ID generation methods
2025-08-04 11:06:14 +08:00
Max
4682c20903 Update OAuth client configuration and ID generation methods
- Added support for numeric ID generation in the OAuth service, replacing the previous NanoID approach for better compatibility.
- Refactored client ID and secret generation methods to be public and renamed them for consistency.
- Enhanced dynamic client registration to allow optional client ID usage.
- Updated client configuration loading to include validation and registration of clients if not found.
- Improved error handling and logging for client configuration processes.
- Adjusted tests to reflect changes in ID generation and client configuration handling.
2025-08-04 11:04:56 +08:00