mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 21:44:27 +00:00
feat(chatbot): implement chatbot sidebar, message view, history mode and sse stream
This commit is contained in:
+6
@@ -774,4 +774,10 @@ export * from "./context_assets_count.js";
|
||||
export * from "./remove_from_context.js";
|
||||
export * from "./hide_chatbot.js";
|
||||
export * from "./show_chatbot.js";
|
||||
export * from "./new_chat.js";
|
||||
export * from "./shumai_agent.js";
|
||||
export * from "./history.js";
|
||||
export * from "./send.js";
|
||||
export * from "./no_history_sessions.js";
|
||||
export * from "./delete_session_confirm.js";
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
|
||||
+7
-1
@@ -775,4 +775,10 @@ export * from './chatbot_drag_drop_hint.js'
|
||||
export * from './context_assets_count.js'
|
||||
export * from './remove_from_context.js'
|
||||
export * from './hide_chatbot.js'
|
||||
export * from './show_chatbot.js'
|
||||
export * from './show_chatbot.js'
|
||||
export * from './new_chat.js'
|
||||
export * from './shumai_agent.js'
|
||||
export * from './history.js'
|
||||
export * from './send.js'
|
||||
export * from './no_history_sessions.js'
|
||||
export * from './delete_session_confirm.js'
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Are you sure you want to delete this chat session?" |
|
||||
*
|
||||
* @param {Delete_Session_ConfirmInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const delete_session_confirm: ((inputs?: Delete_Session_ConfirmInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Delete_Session_ConfirmInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Delete_Session_ConfirmInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Delete_Session_ConfirmInputs */
|
||||
|
||||
const en_delete_session_confirm = /** @type {(inputs: Delete_Session_ConfirmInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Are you sure you want to delete this chat session?`)
|
||||
};
|
||||
|
||||
const zh_delete_session_confirm = /** @type {(inputs: Delete_Session_ConfirmInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`您确定要删除此会话记录吗?`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Are you sure you want to delete this chat session?" |
|
||||
*
|
||||
* @param {Delete_Session_ConfirmInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const delete_session_confirm = /** @type {((inputs?: Delete_Session_ConfirmInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Delete_Session_ConfirmInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_delete_session_confirm(inputs)
|
||||
return zh_delete_session_confirm(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "History" |
|
||||
*
|
||||
* @param {HistoryInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const history: ((inputs?: HistoryInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<HistoryInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type HistoryInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} HistoryInputs */
|
||||
|
||||
const en_history = /** @type {(inputs: HistoryInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`History`)
|
||||
};
|
||||
|
||||
const zh_history = /** @type {(inputs: HistoryInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`历史记录`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "History" |
|
||||
*
|
||||
* @param {HistoryInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const history = /** @type {((inputs?: HistoryInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<HistoryInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_history(inputs)
|
||||
return zh_history(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "New Chat" |
|
||||
*
|
||||
* @param {New_ChatInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const new_chat: ((inputs?: New_ChatInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<New_ChatInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type New_ChatInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} New_ChatInputs */
|
||||
|
||||
const en_new_chat = /** @type {(inputs: New_ChatInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`New Chat`)
|
||||
};
|
||||
|
||||
const zh_new_chat = /** @type {(inputs: New_ChatInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`开启新会话`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "New Chat" |
|
||||
*
|
||||
* @param {New_ChatInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const new_chat = /** @type {((inputs?: New_ChatInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<New_ChatInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_new_chat(inputs)
|
||||
return zh_new_chat(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No chat history found." |
|
||||
*
|
||||
* @param {No_History_SessionsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_history_sessions: ((inputs?: No_History_SessionsInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_History_SessionsInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_History_SessionsInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_History_SessionsInputs */
|
||||
|
||||
const en_no_history_sessions = /** @type {(inputs: No_History_SessionsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`No chat history found.`)
|
||||
};
|
||||
|
||||
const zh_no_history_sessions = /** @type {(inputs: No_History_SessionsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`暂无历史会话记录`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No chat history found." |
|
||||
*
|
||||
* @param {No_History_SessionsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_history_sessions = /** @type {((inputs?: No_History_SessionsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_History_SessionsInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_history_sessions(inputs)
|
||||
return zh_no_history_sessions(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Send" |
|
||||
*
|
||||
* @param {SendInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const send: ((inputs?: SendInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<SendInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type SendInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} SendInputs */
|
||||
|
||||
const en_send = /** @type {(inputs: SendInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Send`)
|
||||
};
|
||||
|
||||
const zh_send = /** @type {(inputs: SendInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`发送`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Send" |
|
||||
*
|
||||
* @param {SendInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const send = /** @type {((inputs?: SendInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<SendInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_send(inputs)
|
||||
return zh_send(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Shumai Agent" |
|
||||
*
|
||||
* @param {Shumai_AgentInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const shumai_agent: ((inputs?: Shumai_AgentInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Shumai_AgentInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Shumai_AgentInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Shumai_AgentInputs */
|
||||
|
||||
const en_shumai_agent = /** @type {(inputs: Shumai_AgentInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Shumai Agent`)
|
||||
};
|
||||
|
||||
const zh_shumai_agent = /** @type {(inputs: Shumai_AgentInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`数脉智能体`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Shumai Agent" |
|
||||
*
|
||||
* @param {Shumai_AgentInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const shumai_agent = /** @type {((inputs?: Shumai_AgentInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Shumai_AgentInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_shumai_agent(inputs)
|
||||
return zh_shumai_agent(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user