mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
refactor: schemas
This commit is contained in:
parent
cf403302a9
commit
142e22a3fe
@ -1,4 +1,4 @@
|
||||
import {z, ZodObject} from 'zod';
|
||||
import {ZodObject} from 'zod';
|
||||
import {CoreAssistantMessage, CoreUserMessage} from 'ai';
|
||||
import {SEARCH_PROVIDER, STEP_SLEEP} from "./config";
|
||||
import {readUrl, removeAllLineBreaks} from "./tools/read";
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import {AnswerAction} from "../types";
|
||||
import i18nJSON from './i18n.json';
|
||||
|
||||
export function buildMdFromAnswer(answer: AnswerAction) {
|
||||
// Standard footnote regex
|
||||
@ -129,8 +130,7 @@ export function removeHTMLtags(text: string) {
|
||||
|
||||
export function getI18nText(key: string, lang = 'en', params: Record<string, string> = {}) {
|
||||
// 获取i18n数据
|
||||
const i18nData = require('./i18n.json');
|
||||
|
||||
const i18nData = i18nJSON as Record<string, any>;
|
||||
// 确保语言代码存在,如果不存在则使用英语作为后备
|
||||
if (!i18nData[lang]) {
|
||||
console.error(`Language '${lang}' not found, falling back to English.`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user