From e0a015c4769ce6b640b98542a9628d632e0d65ba Mon Sep 17 00:00:00 2001 From: poroyo <132068975+poroyo@users.noreply.github.com> Date: Thu, 7 Nov 2024 03:19:32 +0900 Subject: [PATCH 1/2] Add role-cbs support to custom HTML --- src/lib/ChatScreens/Chat.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ChatScreens/Chat.svelte b/src/lib/ChatScreens/Chat.svelte index 3eac694b..0d657363 100644 --- a/src/lib/ChatScreens/Chat.svelte +++ b/src/lib/ChatScreens/Chat.svelte @@ -206,7 +206,7 @@ function RenderGUIHtml(html:string){ try { const parser = new DOMParser() - const doc = parser.parseFromString(risuChatParser(html ?? ''), 'text/html') + const doc = parser.parseFromString(risuChatParser(html ?? '', {cbsConditions: getCbsCondition()}), 'text/html') console.log(doc.body) return doc.body } catch (error) { @@ -590,4 +590,4 @@ {/if} - \ No newline at end of file + From 3bbb2ace7d285950e2b0e8da2d2a8517658d6bfa Mon Sep 17 00:00:00 2001 From: heshiqi Date: Fri, 8 Nov 2024 14:18:37 +0800 Subject: [PATCH 2/2] Fix AWS Support AWS Claude model calling no longer support direct calling, but support Cross-region inference instead. All Cross-region inference model profile IDs equal to original model name with "us." in the beginning. Reference: https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/inference-profiles --- src/ts/process/request.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ts/process/request.ts b/src/ts/process/request.ts index 2e62314f..6dd4420d 100644 --- a/src/ts/process/request.ts +++ b/src/ts/process/request.ts @@ -2059,12 +2059,12 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model' "anthropic.claude-3-5-sonnet-20241022-v2:0" ]; - const awsModel = + const awsModel = "us." + ( raiModel.includes("3-5-sonnet-20241022") ? modelIDs[6] : raiModel.includes("3-5-sonnet-20240620") ? modelIDs[5] : raiModel.includes("3-opus") ? modelIDs[4] : raiModel.includes("3-sonnet") ? modelIDs[3] : - modelIDs[2]; + modelIDs[2]); const url = `https://${host}/model/${awsModel}/invoke${stream ? "-with-response-stream" : ""}` const params = {