mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 17:06:42 +08:00
Add Go service/handler tests for API contract parity (#16905)
This commit is contained in:
@@ -11,10 +11,6 @@ import {
|
||||
import { ISetLangfuseConfigRequestBody } from '@/interfaces/request/system';
|
||||
import { DEFAULT_LANGUAGE_CODE, supportedLanguages } from '@/locales/config';
|
||||
import kbService from '@/services/knowledge-service';
|
||||
import {
|
||||
getBackendLanguage,
|
||||
subscribeBackendLanguage,
|
||||
} from '@/utils/backend-runtime';
|
||||
import userService, {
|
||||
addTenantUser,
|
||||
agreeTenant,
|
||||
@@ -22,9 +18,12 @@ import userService, {
|
||||
listTenant,
|
||||
listTenantUser,
|
||||
} from '@/services/user-service';
|
||||
import {
|
||||
getBackendLanguage,
|
||||
subscribeBackendLanguage,
|
||||
} from '@/utils/backend-runtime';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import { useSyncExternalStore } from 'react';
|
||||
import { useCallback, useMemo, useState, useSyncExternalStore } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useWarnEmptyModel } from './use-warn-empty-model';
|
||||
@@ -165,8 +164,11 @@ export const useSelectParserList = (): Array<{
|
||||
const parserList = useMemo(() => {
|
||||
// Go backend: prefer the dynamic pipeline catalog from the API.
|
||||
if (backendLang === 'go') {
|
||||
const pipelineList: Array<{ parser_id: string; title: string; dsl: Record<string, any> }> =
|
||||
pipelineListData?.data ?? [];
|
||||
const pipelineList: Array<{
|
||||
parser_id: string;
|
||||
title: string;
|
||||
dsl: Record<string, any>;
|
||||
}> = pipelineListData?.data ?? [];
|
||||
if (pipelineList.length > 0) {
|
||||
const labelFromAPI = (parserId: string, title: string) => {
|
||||
const key = `knowledgeConfiguration.parserLabel.${parserId}`;
|
||||
|
||||
@@ -95,7 +95,9 @@ describe('parseModelUuid — right-anchored', () => {
|
||||
});
|
||||
|
||||
test('preserves embedded "@" in the model name (LM Studio)', () => {
|
||||
expect(parseModelUuid('text-embedding-nomic-embed-text-v1.5@q8_0@lmstudio')).toEqual({
|
||||
expect(
|
||||
parseModelUuid('text-embedding-nomic-embed-text-v1.5@q8_0@lmstudio'),
|
||||
).toEqual({
|
||||
modelName: 'text-embedding-nomic-embed-text-v1.5@q8_0',
|
||||
factoryId: 'lmstudio',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user