19fa1e97c3
* feat: implement backend logic * feat: implement api/config endpoint * rename the symbol * feat: re-implement configuration at client-side * feat: add client-side of deep thinking * fix backend bug * feat: add reasoning block * docs: update readme * fix: translate into English * fix: change icon to lightbulb * feat: ignore more bad cases * feat: adjust thinking layout, and implement auto scrolling * docs: add comments --------- Co-authored-by: Henry Li <henry1943@163.com>
26 lines
578 B
TypeScript
26 lines
578 B
TypeScript
import { type DeerFlowConfig } from "../config/types";
|
|
|
|
import { resolveServiceURL } from "./resolve-service-url";
|
|
|
|
declare global {
|
|
interface Window {
|
|
__deerflowConfig: DeerFlowConfig;
|
|
}
|
|
}
|
|
|
|
export async function loadConfig() {
|
|
const res = await fetch(resolveServiceURL("./config"));
|
|
const config = await res.json();
|
|
return config;
|
|
}
|
|
|
|
export function getConfig(): DeerFlowConfig {
|
|
if (
|
|
typeof window === "undefined" ||
|
|
typeof window.__deerflowConfig === "undefined"
|
|
) {
|
|
throw new Error("Config not loaded");
|
|
}
|
|
return window.__deerflowConfig;
|
|
}
|