mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove vertexai_service_account_json from oai_settings. And google.js.
This commit is contained in:
@@ -237,7 +237,6 @@ const sensitiveFields = [
|
|||||||
'custom_include_headers',
|
'custom_include_headers',
|
||||||
'vertexai_project_id',
|
'vertexai_project_id',
|
||||||
'vertexai_region',
|
'vertexai_region',
|
||||||
'vertexai_service_account_json',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -312,7 +311,6 @@ export const settingsToUpdate = {
|
|||||||
vertexai_auth_mode: ['#vertexai_auth_mode', 'vertexai_auth_mode', false, true],
|
vertexai_auth_mode: ['#vertexai_auth_mode', 'vertexai_auth_mode', false, true],
|
||||||
vertexai_project_id: ['#vertexai_project_id', 'vertexai_project_id', false, true],
|
vertexai_project_id: ['#vertexai_project_id', 'vertexai_project_id', false, true],
|
||||||
vertexai_region: ['#vertexai_region', 'vertexai_region', false, true],
|
vertexai_region: ['#vertexai_region', 'vertexai_region', false, true],
|
||||||
vertexai_service_account_json: ['#vertexai_service_account_json', 'vertexai_service_account_json', false, true],
|
|
||||||
use_alt_scale: ['#use_alt_scale', 'use_alt_scale', true, true],
|
use_alt_scale: ['#use_alt_scale', 'use_alt_scale', true, true],
|
||||||
squash_system_messages: ['#squash_system_messages', 'squash_system_messages', true, false],
|
squash_system_messages: ['#squash_system_messages', 'squash_system_messages', true, false],
|
||||||
image_inlining: ['#openai_image_inlining', 'image_inlining', true, false],
|
image_inlining: ['#openai_image_inlining', 'image_inlining', true, false],
|
||||||
@@ -397,7 +395,6 @@ const default_settings = {
|
|||||||
vertexai_auth_mode: 'express',
|
vertexai_auth_mode: 'express',
|
||||||
vertexai_project_id: '',
|
vertexai_project_id: '',
|
||||||
vertexai_region: 'us-central1',
|
vertexai_region: 'us-central1',
|
||||||
vertexai_service_account_json: '',
|
|
||||||
use_alt_scale: false,
|
use_alt_scale: false,
|
||||||
squash_system_messages: false,
|
squash_system_messages: false,
|
||||||
image_inlining: false,
|
image_inlining: false,
|
||||||
@@ -485,7 +482,6 @@ const oai_settings = {
|
|||||||
vertexai_auth_mode: 'express',
|
vertexai_auth_mode: 'express',
|
||||||
vertexai_project_id: '',
|
vertexai_project_id: '',
|
||||||
vertexai_region: 'us-central1',
|
vertexai_region: 'us-central1',
|
||||||
vertexai_service_account_json: '',
|
|
||||||
use_alt_scale: false,
|
use_alt_scale: false,
|
||||||
squash_system_messages: false,
|
squash_system_messages: false,
|
||||||
image_inlining: false,
|
image_inlining: false,
|
||||||
@@ -3836,7 +3832,6 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
|
|||||||
vertexai_auth_mode: settings.vertexai_auth_mode,
|
vertexai_auth_mode: settings.vertexai_auth_mode,
|
||||||
vertexai_project_id: settings.vertexai_project_id,
|
vertexai_project_id: settings.vertexai_project_id,
|
||||||
vertexai_region: settings.vertexai_region,
|
vertexai_region: settings.vertexai_region,
|
||||||
vertexai_service_account_json: settings.vertexai_service_account_json,
|
|
||||||
use_alt_scale: settings.use_alt_scale,
|
use_alt_scale: settings.use_alt_scale,
|
||||||
squash_system_messages: settings.squash_system_messages,
|
squash_system_messages: settings.squash_system_messages,
|
||||||
image_inlining: settings.image_inlining,
|
image_inlining: settings.image_inlining,
|
||||||
@@ -5586,10 +5581,6 @@ async function onVertexAIValidateServiceAccount() {
|
|||||||
// Save to backend secret storage
|
// Save to backend secret storage
|
||||||
await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, jsonContent);
|
await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, jsonContent);
|
||||||
|
|
||||||
// Clear the textarea and update settings
|
|
||||||
$('#vertexai_service_account_json').val('');
|
|
||||||
oai_settings.vertexai_service_account_json = '';
|
|
||||||
|
|
||||||
// Show success status
|
// Show success status
|
||||||
updateVertexAIServiceAccountStatus(true, `Project: ${serviceAccount.project_id}, Email: ${serviceAccount.client_email}`);
|
updateVertexAIServiceAccountStatus(true, `Project: ${serviceAccount.project_id}, Email: ${serviceAccount.client_email}`);
|
||||||
|
|
||||||
@@ -5607,7 +5598,6 @@ async function onVertexAIValidateServiceAccount() {
|
|||||||
*/
|
*/
|
||||||
async function onVertexAIClearServiceAccount() {
|
async function onVertexAIClearServiceAccount() {
|
||||||
$('#vertexai_service_account_json').val('');
|
$('#vertexai_service_account_json').val('');
|
||||||
oai_settings.vertexai_service_account_json = '';
|
|
||||||
|
|
||||||
// Clear from backend secret storage
|
// Clear from backend secret storage
|
||||||
await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, '');
|
await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, '');
|
||||||
@@ -5622,8 +5612,6 @@ async function onVertexAIClearServiceAccount() {
|
|||||||
*/
|
*/
|
||||||
function onVertexAIServiceAccountJsonChange() {
|
function onVertexAIServiceAccountJsonChange() {
|
||||||
const jsonContent = String($(this).val()).trim();
|
const jsonContent = String($(this).val()).trim();
|
||||||
// Don't save to settings automatically - only save when validated
|
|
||||||
// oai_settings.vertexai_service_account_json = jsonContent;
|
|
||||||
|
|
||||||
if (jsonContent) {
|
if (jsonContent) {
|
||||||
// Auto-validate when content is pasted
|
// Auto-validate when content is pasted
|
||||||
|
@@ -31,13 +31,8 @@ export async function getVertexAIAuth(request) {
|
|||||||
}
|
}
|
||||||
throw new Error('API key is required for Vertex AI Express mode');
|
throw new Error('API key is required for Vertex AI Express mode');
|
||||||
} else if (authMode === 'full') {
|
} else if (authMode === 'full') {
|
||||||
// Try to get service account JSON from backend storage first
|
// Get service account JSON from backend storage
|
||||||
let serviceAccountJson = readSecret(request.user.directories, SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT);
|
const serviceAccountJson = readSecret(request.user.directories, SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT);
|
||||||
|
|
||||||
// If not found in backend storage, try from request body (for backward compatibility)
|
|
||||||
if (!serviceAccountJson) {
|
|
||||||
serviceAccountJson = request.body.vertexai_service_account_json;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (serviceAccountJson) {
|
if (serviceAccountJson) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user