mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-11 01:10:11 +01:00
[FEAT] Add support for gemini-1.5-flash-latest model (#1502)
* add support for gemini-1.5-flash-latest * update comment in gemini LLM provider
This commit is contained in:
parent
961630f7d5
commit
cc7e7fb3ac
@ -30,7 +30,11 @@ export default function GeminiLLMOptions({ settings }) {
|
|||||||
required={true}
|
required={true}
|
||||||
className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
|
className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
|
||||||
>
|
>
|
||||||
{["gemini-pro", "gemini-1.5-pro-latest"].map((model) => {
|
{[
|
||||||
|
"gemini-pro",
|
||||||
|
"gemini-1.5-pro-latest",
|
||||||
|
"gemini-1.5-flash-latest",
|
||||||
|
].map((model) => {
|
||||||
return (
|
return (
|
||||||
<option key={model} value={model}>
|
<option key={model} value={model}>
|
||||||
{model}
|
{model}
|
||||||
|
@ -10,7 +10,7 @@ export const DISABLED_PROVIDERS = [
|
|||||||
];
|
];
|
||||||
const PROVIDER_DEFAULT_MODELS = {
|
const PROVIDER_DEFAULT_MODELS = {
|
||||||
openai: [],
|
openai: [],
|
||||||
gemini: ["gemini-pro", "gemini-1.5-pro-latest"],
|
gemini: ["gemini-pro", "gemini-1.5-pro-latest", "gemini-1.5-flash-latest"],
|
||||||
anthropic: [
|
anthropic: [
|
||||||
"claude-instant-1.2",
|
"claude-instant-1.2",
|
||||||
"claude-2.0",
|
"claude-2.0",
|
||||||
|
@ -17,8 +17,12 @@ class GeminiLLM {
|
|||||||
this.gemini = genAI.getGenerativeModel(
|
this.gemini = genAI.getGenerativeModel(
|
||||||
{ model: this.model },
|
{ model: this.model },
|
||||||
{
|
{
|
||||||
// Gemini-1.5-pro is only available on the v1beta API.
|
// Gemini-1.5-pro and Gemini-1.5-flash are only available on the v1beta API.
|
||||||
apiVersion: this.model === "gemini-1.5-pro-latest" ? "v1beta" : "v1",
|
apiVersion:
|
||||||
|
this.model === "gemini-1.5-pro-latest" ||
|
||||||
|
this.model === "gemini-1.5-flash-latest"
|
||||||
|
? "v1beta"
|
||||||
|
: "v1",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.limits = {
|
this.limits = {
|
||||||
@ -95,7 +99,11 @@ class GeminiLLM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isValidChatCompletionModel(modelName = "") {
|
isValidChatCompletionModel(modelName = "") {
|
||||||
const validModels = ["gemini-pro", "gemini-1.5-pro-latest"];
|
const validModels = [
|
||||||
|
"gemini-pro",
|
||||||
|
"gemini-1.5-pro-latest",
|
||||||
|
"gemini-1.5-flash-latest",
|
||||||
|
];
|
||||||
return validModels.includes(modelName);
|
return validModels.includes(modelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,11 @@ function supportedTranscriptionProvider(input = "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validGeminiModel(input = "") {
|
function validGeminiModel(input = "") {
|
||||||
const validModels = ["gemini-pro", "gemini-1.5-pro-latest"];
|
const validModels = [
|
||||||
|
"gemini-pro",
|
||||||
|
"gemini-1.5-pro-latest",
|
||||||
|
"gemini-1.5-flash-latest",
|
||||||
|
];
|
||||||
return validModels.includes(input)
|
return validModels.includes(input)
|
||||||
? null
|
? null
|
||||||
: `Invalid Model type. Must be one of ${validModels.join(", ")}.`;
|
: `Invalid Model type. Must be one of ${validModels.join(", ")}.`;
|
||||||
|
Loading…
Reference in New Issue
Block a user