新增AI的功能与页面,扩展了国际化功能
This commit is contained in:
@@ -28,12 +28,33 @@ export interface ChatRead {
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface OptimizePeqPayload {
|
||||
name?: string;
|
||||
brand?: string;
|
||||
model?: string;
|
||||
preamp?: number;
|
||||
canDel?: number;
|
||||
autoPre?: number;
|
||||
filters?: Array<{
|
||||
type: number | string;
|
||||
fc?: number;
|
||||
frequency?: number;
|
||||
gain: number;
|
||||
q: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface MessageRead {
|
||||
id: string;
|
||||
role: "user" | "assistant";
|
||||
content: string;
|
||||
created_at: string;
|
||||
/** 0: 默认聊天, 1: 摘要, 2: 优化记录, 3: 标题生成 */
|
||||
type: number;
|
||||
before_peq: OptimizePeqPayload | null;
|
||||
after_peq: OptimizePeqPayload | null;
|
||||
applied: boolean;
|
||||
applied_at: string | null;
|
||||
}
|
||||
|
||||
export interface ToolUseBlock {
|
||||
@@ -88,6 +109,14 @@ export async function clearChat(chatId: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateMessageApplied(messageId: string, applied: boolean): Promise<void> {
|
||||
const url = `${getAIBaseUrl()}/sse/update_message_applied?message_id=${encodeURIComponent(
|
||||
messageId,
|
||||
)}&applied=${applied ? "true" : "false"}`;
|
||||
const res = await fetch(url, { method: "POST" });
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
|
||||
}
|
||||
|
||||
export async function sendToolResult(toolUseId: string, content: { ok: boolean; content?: any; message?: string }): Promise<void> {
|
||||
await fetch(`${getAIBaseUrl()}/chat/tool_result`, {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user