Go knowledge compiler with scheduler-driven dataset compilation (#17913)

Ports dataset knowledge compilation (wiki/graph/tree/mindmap) to the Go
scheduler with a status contract, aligns wiki storage/retrieval with
Python, sizes prompts by content_length, and resolves embedding batch
size from provider capability.
This commit is contained in:
Zhichang Yu
2026-08-06 15:54:00 +08:00
committed by GitHub
parent addc5acdc0
commit 2e37997ab9
116 changed files with 6678 additions and 1942 deletions

View File

@@ -10,7 +10,7 @@ import {
} from '@/interfaces/request/knowledge';
import api from '@/utils/api';
import nextRequest from '@/utils/next-request';
import registerServer from '@/utils/register-server';
import registerServer, { registerNextServer } from '@/utils/register-server';
import request from '@/utils/request';
const {
@@ -287,6 +287,20 @@ export const runIndex = (datasetId: string, indexType: string) =>
export const traceIndex = (datasetId: string, indexType: string) =>
request.get(api.traceIndex(datasetId, indexType));
// getDatasetCompilationStatus reads the Go scheduler compile-status contract
// (GET /datasets/:id/compilation/status), used by API_PROXY_SCHEME=go/hybrid to
// replace the legacy traceIndex task-progress endpoint. Route it through the
// service-layer proxy (registerNextServer -> next-request) like the rest of the
// *-service.ts HTTP proxies.
const compilationStatusProxy = registerNextServer({
getDatasetCompilationStatus: {
url: (datasetId: string) => api.compilationStatus(datasetId),
method: 'get',
},
} as const);
export const getDatasetCompilationStatus = (datasetId: string) =>
compilationStatusProxy.getDatasetCompilationStatus(datasetId);
// Using RESTful API: GET /api/v1/datasets/{dataset_id}/documents
export const listDocument = (
params?: IFetchKnowledgeListRequestParams,