Files
DeepTutor/web/components/math-animator/MathAnimatorConfigPanel.tsx
Bingxi Zhao (Frank) 5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00

60 lines
1.9 KiB
TypeScript

"use client";
import { useTranslation } from "react-i18next";
import type { MathAnimatorFormConfig } from "@/lib/math-animator-types";
import { Field, INPUT_CLS } from "@/components/chat/home/composer-field";
interface MathAnimatorConfigPanelProps {
value: MathAnimatorFormConfig;
onChange: (next: MathAnimatorFormConfig) => void;
}
export default function MathAnimatorConfigPanel({
value,
onChange,
}: MathAnimatorConfigPanelProps) {
const { t } = useTranslation();
const update = <K extends keyof MathAnimatorFormConfig>(
key: K,
val: MathAnimatorFormConfig[K],
) => onChange({ ...value, [key]: val });
return (
<div className="flex flex-wrap items-end gap-x-3 gap-y-2 px-3.5 py-2.5">
<Field label="Output" width="w-[100px]">
<select
value={value.output_mode}
onChange={(e) => update("output_mode", e.target.value as MathAnimatorFormConfig["output_mode"])}
className={`${INPUT_CLS} w-full`}
>
<option value="video">{t("Video")}</option>
<option value="image">{t("Image")}</option>
</select>
</Field>
<Field label="Quality" width="w-[100px]">
<select
value={value.quality}
onChange={(e) => update("quality", e.target.value as MathAnimatorFormConfig["quality"])}
className={`${INPUT_CLS} w-full`}
>
<option value="low">{t("Low")}</option>
<option value="medium">{t("Medium")}</option>
<option value="high">{t("High")}</option>
</select>
</Field>
<Field label="Style Hint" width="min-w-[160px] flex-1">
<input
type="text"
value={value.style_hint}
onChange={(e) => update("style_hint", e.target.value)}
placeholder={t("Style, pacing, color...")}
className={`${INPUT_CLS} w-full`}
/>
</Field>
</div>
);
}