feat: Solve the problem of using openai interface protocol for user-defined claude model & add some famous webdav endpoints

This commit is contained in:
butterfly
2024-04-09 20:49:51 +08:00
parent 908ce3bbd9
commit 79f342439a
6 changed files with 49 additions and 7 deletions

21
app/utils/checkers.ts Normal file
View File

@@ -0,0 +1,21 @@
import { useAccessStore } from "../store/access";
import { useAppConfig } from "../store/config";
import { collectModels } from "./model";
export function identifyDefaultClaudeModel(modelName: string) {
const accessStore = useAccessStore.getState();
const configStore = useAppConfig.getState();
const allModals = collectModels(
configStore.models,
[configStore.customModels, accessStore.customModels].join(","),
);
const modelMeta = allModals.find((m) => m.name === modelName);
return (
modelName.startsWith("claude") &&
modelMeta &&
modelMeta.provider?.providerType === "anthropic"
);
}