mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
- Replaced `fetchWithAuth` with a generic `fetch` function across various API modules for consistency. - Updated `useThreadStream` and `useThreadHistory` hooks to manage chat history loading, including loading states and pagination. - Introduced `LoadMoreHistoryIndicator` component for better user experience when loading more chat history. - Enhanced message handling in `MessageList` to accommodate new loading states and history management. - Added support for run messages in the thread context, improving the overall message handling logic. - Updated translations for loading indicators in English and Chinese.
21 lines
587 B
TypeScript
21 lines
587 B
TypeScript
import { fetch } from "@/core/api/fetcher";
|
|
import { getBackendBaseURL } from "@/core/config";
|
|
|
|
import type { MCPConfig } from "./types";
|
|
|
|
export async function loadMCPConfig() {
|
|
const response = await fetch(`${getBackendBaseURL()}/api/mcp/config`);
|
|
return response.json() as Promise<MCPConfig>;
|
|
}
|
|
|
|
export async function updateMCPConfig(config: MCPConfig) {
|
|
const response = await fetch(`${getBackendBaseURL()}/api/mcp/config`, {
|
|
method: "PUT",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify(config),
|
|
});
|
|
return response.json();
|
|
}
|