feat: introduce WeKnora Lite edition with lightweight configuration and deployment
- Added a new `.env.lite.example` file for the Lite version, providing a minimal configuration template. - Updated `.env.example` to remove deprecated variables and include new Docreader settings. - Enhanced Docker configurations to support the Lite version, including a new Dockerfile for the Docreader service. - Introduced a Makefile target for building and running the Lite version, along with packaging capabilities. - Created GitHub workflows for building and releasing Lite binaries, including Homebrew formula support. - Implemented a new service file for managing the Lite version as a system service. This update enables a streamlined, single-binary deployment of WeKnora, reducing external dependencies and simplifying setup.
This commit is contained in:
@@ -82,24 +82,13 @@ export interface KBModelConfigRequest {
|
||||
chunkSize: number
|
||||
chunkOverlap: number
|
||||
separators: string[]
|
||||
parserEngineRules?: { file_types: string[]; engine: string }[]
|
||||
}
|
||||
multimodal: {
|
||||
enabled: boolean
|
||||
storageType?: 'cos' | 'minio'
|
||||
cos?: {
|
||||
secretId: string
|
||||
secretKey: string
|
||||
region: string
|
||||
bucketName: string
|
||||
appId: string
|
||||
pathPrefix: string
|
||||
}
|
||||
minio?: {
|
||||
bucketName: string
|
||||
useSSL: boolean
|
||||
pathPrefix: string
|
||||
}
|
||||
}
|
||||
/** 存储引擎选择:"local" | "minio" | "cos",影响文档上传与文档内图片存储 */
|
||||
storageProvider?: string
|
||||
nodeExtract: {
|
||||
enabled: boolean
|
||||
text: string
|
||||
|
||||
@@ -106,6 +106,10 @@ export function downKnowledgeDetails(id: string) {
|
||||
return getDown(`/api/v1/knowledge/${id}/download`);
|
||||
}
|
||||
|
||||
export function previewKnowledgeFile(id: string) {
|
||||
return getDown(`/api/v1/knowledge/${id}/preview`);
|
||||
}
|
||||
|
||||
/** @param idsQueryString - query string with ids (e.g. ids=xxx&ids=yyy) */
|
||||
export function batchQueryKnowledge(idsQueryString: string, kbId?: string, agentId?: string) {
|
||||
let qs = idsQueryString;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { get, put } from '@/utils/request'
|
||||
import { get, post, put } from '@/utils/request'
|
||||
|
||||
export interface SystemInfo {
|
||||
version: string
|
||||
edition?: string
|
||||
commit_id?: string
|
||||
build_time?: string
|
||||
go_version?: string
|
||||
@@ -110,3 +111,115 @@ export interface ListMinioBucketsResponse {
|
||||
export function listMinioBuckets(): Promise<{ data: ListMinioBucketsResponse }> {
|
||||
return get('/api/v1/system/minio/buckets')
|
||||
}
|
||||
|
||||
export interface ParserEngineInfo {
|
||||
Name: string
|
||||
Description: string
|
||||
FileTypes: string[]
|
||||
Available?: boolean
|
||||
UnavailableReason?: string
|
||||
}
|
||||
|
||||
/** 解析引擎配置(引擎相关存租户;docreader 地址由环境变量配置) */
|
||||
export interface ParserEngineConfig {
|
||||
docreader_addr?: string
|
||||
docreader_transport?: string
|
||||
mineru_endpoint?: string
|
||||
mineru_api_key?: string
|
||||
mineru_api_base_url?: string
|
||||
// MinerU 自建参数
|
||||
mineru_model?: string
|
||||
mineru_enable_formula?: boolean | null
|
||||
mineru_enable_table?: boolean | null
|
||||
mineru_enable_ocr?: boolean | null
|
||||
mineru_language?: string
|
||||
// MinerU 云 API 参数
|
||||
mineru_cloud_model?: string
|
||||
mineru_cloud_enable_formula?: boolean | null
|
||||
mineru_cloud_enable_table?: boolean | null
|
||||
mineru_cloud_enable_ocr?: boolean | null
|
||||
mineru_cloud_language?: string
|
||||
}
|
||||
|
||||
export interface ParserEnginesResponse {
|
||||
data: ParserEngineInfo[]
|
||||
docreader_addr?: string
|
||||
/** 连接方式:grpc | http,由服务端环境/配置决定 */
|
||||
docreader_transport?: string
|
||||
connected?: boolean
|
||||
}
|
||||
|
||||
export function getParserEngines(): Promise<ParserEnginesResponse> {
|
||||
return get('/api/v1/system/parser-engines')
|
||||
}
|
||||
|
||||
/** 使用当前填写的参数检测引擎可用性(不保存),用于填写新参数后即时测试 */
|
||||
export function checkParserEngines(config: ParserEngineConfig): Promise<ParserEnginesResponse> {
|
||||
return post('/api/v1/system/parser-engines/check', config)
|
||||
}
|
||||
|
||||
export function getParserEngineConfig(): Promise<{ data: ParserEngineConfig }> {
|
||||
return get('/api/v1/tenants/kv/parser-engine-config')
|
||||
}
|
||||
|
||||
export function updateParserEngineConfig(config: ParserEngineConfig): Promise<{ data: ParserEngineConfig }> {
|
||||
return put('/api/v1/tenants/kv/parser-engine-config', config)
|
||||
}
|
||||
|
||||
export function reconnectDocReader(addr: string): Promise<ParserEnginesResponse & { msg?: string }> {
|
||||
return post('/api/v1/system/docreader/reconnect', { addr })
|
||||
}
|
||||
|
||||
// ---- 存储引擎配置(租户级,供文档/图片存储与 docreader 使用) ----
|
||||
|
||||
export interface StorageEngineConfig {
|
||||
default_provider: string // "local" | "minio" | "cos"
|
||||
local?: { path_prefix: string }
|
||||
minio?: { mode: string; endpoint: string; access_key_id: string; secret_access_key: string; bucket_name: string; use_ssl: boolean; path_prefix: string }
|
||||
cos?: {
|
||||
secret_id: string
|
||||
secret_key: string
|
||||
region: string
|
||||
bucket_name: string
|
||||
app_id: string
|
||||
path_prefix: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface StorageEngineStatusItem {
|
||||
name: string
|
||||
available: boolean
|
||||
description: string
|
||||
}
|
||||
|
||||
export interface GetStorageEngineStatusResponse {
|
||||
engines: StorageEngineStatusItem[]
|
||||
minio_env_available: boolean
|
||||
}
|
||||
|
||||
export function getStorageEngineConfig(): Promise<{ data: StorageEngineConfig }> {
|
||||
return get('/api/v1/tenants/kv/storage-engine-config')
|
||||
}
|
||||
|
||||
export function updateStorageEngineConfig(config: StorageEngineConfig): Promise<{ data: StorageEngineConfig }> {
|
||||
return put('/api/v1/tenants/kv/storage-engine-config', config)
|
||||
}
|
||||
|
||||
export function getStorageEngineStatus(): Promise<{ data: GetStorageEngineStatusResponse }> {
|
||||
return get('/api/v1/system/storage-engine-status')
|
||||
}
|
||||
|
||||
export interface StorageCheckRequest {
|
||||
provider: string // "minio" | "cos"
|
||||
minio?: StorageEngineConfig['minio']
|
||||
cos?: StorageEngineConfig['cos']
|
||||
}
|
||||
|
||||
export interface StorageCheckResponse {
|
||||
ok: boolean
|
||||
message: string
|
||||
}
|
||||
|
||||
export function checkStorageEngine(req: StorageCheckRequest): Promise<{ data: StorageCheckResponse }> {
|
||||
return post('/api/v1/system/storage-engine-check', req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user