Add from modellist
This commit is contained in:
@@ -598,7 +598,6 @@ export const LLMModels: LLMModel[] = [
|
|||||||
LLMFlags.hasFirstSystemPrompt,
|
LLMFlags.hasFirstSystemPrompt,
|
||||||
LLMFlags.hasStreaming
|
LLMFlags.hasStreaming
|
||||||
],
|
],
|
||||||
recommended: true,
|
|
||||||
parameters: ClaudeParameters,
|
parameters: ClaudeParameters,
|
||||||
tokenizer: LLMTokenizer.Claude
|
tokenizer: LLMTokenizer.Claude
|
||||||
},
|
},
|
||||||
@@ -619,6 +618,40 @@ export const LLMModels: LLMModel[] = [
|
|||||||
parameters: [...ClaudeParameters, 'thinking_tokens'],
|
parameters: [...ClaudeParameters, 'thinking_tokens'],
|
||||||
tokenizer: LLMTokenizer.Claude
|
tokenizer: LLMTokenizer.Claude
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Claude 4 Sonnet (20250514)",
|
||||||
|
id: 'claude-sonnet-4-20250514',
|
||||||
|
shortName: "4 Sonnet",
|
||||||
|
provider: LLMProvider.Anthropic,
|
||||||
|
format: LLMFormat.Anthropic,
|
||||||
|
flags: [
|
||||||
|
LLMFlags.hasPrefill,
|
||||||
|
LLMFlags.hasImageInput,
|
||||||
|
LLMFlags.hasFirstSystemPrompt,
|
||||||
|
LLMFlags.hasStreaming,
|
||||||
|
LLMFlags.claudeThinking
|
||||||
|
],
|
||||||
|
recommended: true,
|
||||||
|
parameters: [...ClaudeParameters, 'thinking_tokens'],
|
||||||
|
tokenizer: LLMTokenizer.Claude
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Claude 4 Opus (20250514)",
|
||||||
|
id: 'claude-opus-4-20250514',
|
||||||
|
shortName: "4 Opus",
|
||||||
|
provider: LLMProvider.Anthropic,
|
||||||
|
format: LLMFormat.Anthropic,
|
||||||
|
flags: [
|
||||||
|
LLMFlags.hasPrefill,
|
||||||
|
LLMFlags.hasImageInput,
|
||||||
|
LLMFlags.hasFirstSystemPrompt,
|
||||||
|
LLMFlags.hasStreaming,
|
||||||
|
LLMFlags.claudeThinking
|
||||||
|
],
|
||||||
|
recommended: true,
|
||||||
|
parameters: [...ClaudeParameters, 'thinking_tokens'],
|
||||||
|
tokenizer: LLMTokenizer.Claude
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Claude 3.5 Haiku",
|
name: "Claude 3.5 Haiku",
|
||||||
id: 'claude-3-5-haiku-latest',
|
id: 'claude-3-5-haiku-latest',
|
||||||
@@ -1057,6 +1090,26 @@ export const LLMModels: LLMModel[] = [
|
|||||||
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
|
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
|
||||||
tokenizer: LLMTokenizer.GoogleCloud,
|
tokenizer: LLMTokenizer.GoogleCloud,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Gemini Flash 2.5 Preview (05/20)",
|
||||||
|
id: 'gemini-2.5-flash-preview-05-20',
|
||||||
|
provider: LLMProvider.GoogleCloud,
|
||||||
|
format: LLMFormat.GoogleCloud,
|
||||||
|
flags: [LLMFlags.geminiBlockOff,LLMFlags.hasImageInput, LLMFlags.poolSupported, LLMFlags.hasAudioInput, LLMFlags.hasVideoInput, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole, LLMFlags.geminiThinking],
|
||||||
|
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
|
||||||
|
tokenizer: LLMTokenizer.GoogleCloud,
|
||||||
|
recommended: true
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: "Gemini Flash 2.5 PRO TTS",
|
||||||
|
// id: 'gemini-2.5-pro-tts',
|
||||||
|
// provider: LLMProvider.GoogleCloud,
|
||||||
|
// format: LLMFormat.GoogleCloud,
|
||||||
|
// flags: [LLMFlags.geminiBlockOff,LLMFlags.hasImageInput, LLMFlags.poolSupported, LLMFlags.hasAudioInput, LLMFlags.hasVideoInput, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole, LLMFlags.geminiThinking, LLMFlags.hasAudioOutput],
|
||||||
|
// parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
|
||||||
|
// tokenizer: LLMTokenizer.GoogleCloud,
|
||||||
|
// recommended: true
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "Gemini Flash 2.0 Thinking 1219",
|
name: "Gemini Flash 2.0 Thinking 1219",
|
||||||
id: 'gemini-2.0-flash-thinking-exp-1219',
|
id: 'gemini-2.0-flash-thinking-exp-1219',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { risuChatParser } from "../parser.svelte";
|
|||||||
import { SignatureV4 } from "@smithy/signature-v4";
|
import { SignatureV4 } from "@smithy/signature-v4";
|
||||||
import { HttpRequest } from "@smithy/protocol-http";
|
import { HttpRequest } from "@smithy/protocol-http";
|
||||||
import { Sha256 } from "@aws-crypto/sha256-js";
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
||||||
import { supportsInlayImage, writeInlayImage } from "./files/inlays";
|
import { setInlayAsset, supportsInlayImage, writeInlayImage } from "./files/inlays";
|
||||||
import { Capacitor } from "@capacitor/core";
|
import { Capacitor } from "@capacitor/core";
|
||||||
import { getFreeOpenRouterModel } from "../model/openrouter";
|
import { getFreeOpenRouterModel } from "../model/openrouter";
|
||||||
import { runTransformers } from "./transformers";
|
import { runTransformers } from "./transformers";
|
||||||
@@ -2167,6 +2167,12 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
delete body.systemInstruction
|
delete body.systemInstruction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(arg.modelInfo.flags.includes(LLMFlags.hasAudioOutput)){
|
||||||
|
body.generation_config.responseModalities = [
|
||||||
|
'TEXT', 'AUDIO'
|
||||||
|
]
|
||||||
|
arg.useStreaming = false
|
||||||
|
}
|
||||||
if(arg.imageResponse){
|
if(arg.imageResponse){
|
||||||
body.generation_config.responseModalities = [
|
body.generation_config.responseModalities = [
|
||||||
'TEXT', 'IMAGE'
|
'TEXT', 'IMAGE'
|
||||||
@@ -2515,11 +2521,26 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
if(part.inlineData){
|
if(part.inlineData){
|
||||||
const imgHTML = new Image()
|
const imgHTML = new Image()
|
||||||
const id = crypto.randomUUID()
|
const id = crypto.randomUUID()
|
||||||
imgHTML.src = `data:${part.inlineData.mimeType};base64,${part.inlineData.data}`
|
|
||||||
await writeInlayImage(imgHTML, {
|
if(part.inlineData.mimeType.startsWith('image/')){
|
||||||
id: id
|
|
||||||
})
|
imgHTML.src = `data:${part.inlineData.mimeType};base64,${part.inlineData.data}`
|
||||||
rDatas[rDatas.length-1] += (`\n{{inlayeddata::${id}}}\n`)
|
await writeInlayImage(imgHTML, {
|
||||||
|
id: id
|
||||||
|
})
|
||||||
|
rDatas[rDatas.length-1] += (`\n{{inlayeddata::${id}}}\n`)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
const id = v4()
|
||||||
|
await setInlayAsset(id, {
|
||||||
|
name: 'gemini-audio',
|
||||||
|
type: 'audio',
|
||||||
|
data: `data:${part.inlineData.mimeType};base64,${part.inlineData.data}`,
|
||||||
|
height: 0,
|
||||||
|
width: 0,
|
||||||
|
ext: part.inlineData.mimeType.split('/')[1],
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user