claude support function call

This commit is contained in:
lloydzhou
2024-09-02 21:45:47 +08:00
parent 877668b629
commit 801b62543a
6 changed files with 145 additions and 112 deletions

View File

@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { showToast } from "./components/ui-lib";
import Locale from "./locales";
import { RequestMessage } from "./client/api";
import { ServiceProvider } from "./constant";
export function trimTopic(topic: string) {
// Fix an issue where double quotes still show in the Indonesian language
@@ -270,3 +271,13 @@ export function isVisionModel(model: string) {
export function isDalle3(model: string) {
return "dall-e-3" === model;
}
export function showPlugins(provider: ServiceProvider, model: string) {
if (provider == ServiceProvider.OpenAI || provider == ServiceProvider.Azure) {
return true;
}
if (provider == ServiceProvider.Anthropic && !model.includes("claude-2")) {
return true;
}
return false;
}