Skip to content

Commit

Permalink
1.83.1 (#313)
Browse files Browse the repository at this point in the history
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
  • Loading branch information
kwaroran authored Mar 16, 2024
2 parents b331a2b + e7dda40 commit 226095e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "RisuAI",
"version": "1.83.0"
"version": "1.83.1"
},
"tauri": {
"allowlist": {
Expand Down
1 change: 1 addition & 0 deletions src/lib/Setting/Pages/BotSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<OptionInput value="claude-instant-v1.1-100k">claude-instant-v1.1-100k</OptionInput>
<OptionInput value="claude-3-opus-20240229">claude-3-opus-20240229</OptionInput>
<OptionInput value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</OptionInput>
<!-- <OptionInput value="claude-3-haiku-202403079">claude-3-haiku-20240307</OptionInput> -->
<OptionInput value="custom">Custom</OptionInput>
</SelectInput>
{#if $DataBase.proxyRequestModel === 'custom'}
Expand Down
16 changes: 11 additions & 5 deletions src/ts/process/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1514,18 +1514,24 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'

const AMZ_HOST = "bedrock-runtime.%REGION%.amazonaws.com";
const host = AMZ_HOST.replace("%REGION%", region);
const stream = false
const CLAUDE_3_COMPAT_MODEL = "anthropic.claude-3-sonnet-20240229-v1:0";
const stream = false; // todo?

// https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html
const modelIDs = [
"anthropic.claude-v2",
"anthropic.claude-v2:1",
"anthropic.claude-3-haiku-20240307-v1:0",
"anthropic.claude-3-sonnet-20240229-v1:0",
];

// AWS currently only supports one v3 model.
const awsModel = CLAUDE_3_COMPAT_MODEL;
const awsModel = raiModel.includes("haiku") ? modelIDs[2] : modelIDs[3];
const url = `https://${host}/model/${awsModel}/invoke${stream ? "-with-response-stream" : ""}`

const params = {
messages : claudeChat,
system: systemPrompt.trim(),
max_tokens: maxTokens,
// stop_sequences: ["user:", "assistant:", "system:"],
// stop_sequences: null,
temperature: temperature,
top_p: db.top_p,
top_k: db.top_k,
Expand Down
2 changes: 1 addition & 1 deletion src/ts/storage/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';

export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false)
export let appVer = "1.83.0"
export let appVer = "1.83.1"
export let webAppSubVer = ''

export function setDatabase(data:Database){
Expand Down
11 changes: 5 additions & 6 deletions src/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,18 @@ export function BufferToText(data:Uint8Array){

export function encodeMultilangString(data:{[code:string]:string}){
let result = ''
if(data.en){
result = data.en
if(data.xx){
result = data.xx
}
for(const key in data){
result = `${result}\n<div hidden x-recc-lang="${key}">${data[key]}</div>`

result = `${result}\n# \`${key}\`\n${data[key]}`
}
return result
return result.trim()
}

export function parseMultilangString(data:string){
let result:{[code:string]:string} = {}
const regex = /<div hidden x-recc-lang="(.+?)">(.*?)<\/div>/g
const regex = /# `(.+?)`\n([\s\S]+?)(?=\n# `|$)/g
let m:RegExpExecArray
while ((m = regex.exec(data)) !== null) {
if (m.index === regex.lastIndex) {
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.83.0"}
{"version":"1.83.1"}

0 comments on commit 226095e

Please sign in to comment.