mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into qr-popout-hide
This commit is contained in:
@@ -2437,7 +2437,7 @@
|
||||
<option value="claude">Claude</option>
|
||||
<option value="cohere">Cohere</option>
|
||||
<option value="groq">Groq</option>
|
||||
<option value="makersuite">Google MakerSuite</option>
|
||||
<option value="makersuite">Google AI Studio</option>
|
||||
<option value="mistralai">MistralAI</option>
|
||||
<option value="openrouter">OpenRouter</option>
|
||||
<option value="perplexity">Perplexity</option>
|
||||
@@ -2800,7 +2800,7 @@
|
||||
</div>
|
||||
</form>
|
||||
<form id="makersuite_form" data-source="makersuite" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||
<h4 data-i18n="MakerSuite API Key">MakerSuite API Key</h4>
|
||||
<h4 data-i18n="Google AI Studio API Key">Google AI Studio API Key</h4>
|
||||
<div class="flex-container">
|
||||
<input id="api_key_makersuite" name="api_key_makersuite" class="text_pole flex1" maxlength="500" value="" type="text" autocomplete="off">
|
||||
<div title="Clear your API key" data-i18n="[title]Clear your API key" class="menu_button fa-solid fa-circle-xmark clear-api-key" data-key="api_key_makersuite"></div>
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "طريقة بديلة",
|
||||
"AI21 API Key": "مفتاح API لـ AI21",
|
||||
"AI21 Model": "نموذج AI21",
|
||||
"MakerSuite API Key": "مفتاح واجهة برمجة تطبيقات MakerSuite",
|
||||
"Google AI Studio API Key": "مفتاح واجهة برمجة تطبيقات Google AI Studio",
|
||||
"Google Model": "نموذج جوجل",
|
||||
"MistralAI API Key": "مفتاح واجهة برمجة التطبيقات MistralAI",
|
||||
"MistralAI Model": "نموذج ميسترال آي آي",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Alternative Methode",
|
||||
"AI21 API Key": "AI21 API-Schlüssel",
|
||||
"AI21 Model": "AI21-Modell",
|
||||
"MakerSuite API Key": "MakerSuite API-Schlüssel",
|
||||
"Google AI Studio API Key": "Google AI Studio API-Schlüssel",
|
||||
"Google Model": "Google-Modell",
|
||||
"MistralAI API Key": "MistralAI API-Schlüssel",
|
||||
"MistralAI Model": "MistralAI-Modell",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Método alternativo",
|
||||
"AI21 API Key": "Clave API de AI21",
|
||||
"AI21 Model": "Modelo de AI21",
|
||||
"MakerSuite API Key": "Clave API de MakerSuite",
|
||||
"Google AI Studio API Key": "Clave API de Google AI Studio",
|
||||
"Google Model": "Modelo de Google",
|
||||
"MistralAI API Key": "Clave API de MistralAI",
|
||||
"MistralAI Model": "Modelo MistralAI",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Méthode alternative",
|
||||
"AI21 API Key": "Clé API AI21",
|
||||
"AI21 Model": "Modèle AI21",
|
||||
"MakerSuite API Key": "Clé API MakerSuite",
|
||||
"Google AI Studio API Key": "Clé API Google AI Studio",
|
||||
"Google Model": "Modèle Google",
|
||||
"MistralAI API Key": "Clé API MistralAI",
|
||||
"MistralAI Model": "Modèle MistralAI",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Aðferð Bakmenn",
|
||||
"AI21 API Key": "Lykill API fyrir AI21",
|
||||
"AI21 Model": "AI21 Módel",
|
||||
"MakerSuite API Key": "MakerSuite API lykill",
|
||||
"Google AI Studio API Key": "Google AI Studio API lykill",
|
||||
"Google Model": "Google líkan",
|
||||
"MistralAI API Key": "MistralAI API lykill",
|
||||
"MistralAI Model": "MistralAI líkan",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Metodo alternativo",
|
||||
"AI21 API Key": "Chiave API di AI21",
|
||||
"AI21 Model": "Modello AI21",
|
||||
"MakerSuite API Key": "Chiave API MakerSuite",
|
||||
"Google AI Studio API Key": "Chiave API Google AI Studio",
|
||||
"Google Model": "Modello Google",
|
||||
"MistralAI API Key": "Chiave API MistralAI",
|
||||
"MistralAI Model": "Modello MistralAI",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "代替手法",
|
||||
"AI21 API Key": "AI21のAPIキー",
|
||||
"AI21 Model": "AI21モデル",
|
||||
"MakerSuite API Key": "MakerSuite APIキー",
|
||||
"Google AI Studio API Key": "Google AI Studio APIキー",
|
||||
"Google Model": "Google モデル",
|
||||
"MistralAI API Key": "MistralAI API キー",
|
||||
"MistralAI Model": "MistralAI モデル",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "대체 방법",
|
||||
"AI21 API Key": "AI21 API 키",
|
||||
"AI21 Model": "AI21 모델",
|
||||
"MakerSuite API Key": "MakerSuite API 키",
|
||||
"Google AI Studio API Key": "Google AI Studio API 키",
|
||||
"Google Model": "구글 모델",
|
||||
"MistralAI API Key": "MistralAI API 키",
|
||||
"MistralAI Model": "MistralAI 모델",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Método Alternativo",
|
||||
"AI21 API Key": "Chave da API AI21",
|
||||
"AI21 Model": "Modelo AI21",
|
||||
"MakerSuite API Key": "Chave API MakerSuite",
|
||||
"Google AI Studio API Key": "Chave API Google AI Studio",
|
||||
"Google Model": "Modelo Google",
|
||||
"MistralAI API Key": "Chave de API MistralAI",
|
||||
"MistralAI Model": "Modelo MistralAI",
|
||||
|
@@ -722,7 +722,7 @@
|
||||
"Proxy Server URL": "Адрес прокси-сервера",
|
||||
"MistralAI Model": "Модель MistralAI",
|
||||
"MistralAI API Key": "Ключ от API MistralAI",
|
||||
"MakerSuite API Key": "Ключ от API MakerSuite",
|
||||
"Google AI Studio API Key": "Ключ от API Google AI Studio",
|
||||
"Google Model": "Модель Google",
|
||||
"Cohere API Key": "Ключ от API Cohere",
|
||||
"Cohere Model": "Модель Cohere",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Альтернативний метод",
|
||||
"AI21 API Key": "Ключ API для AI21",
|
||||
"AI21 Model": "Модель AI21",
|
||||
"MakerSuite API Key": "Ключ API MakerSuite",
|
||||
"Google AI Studio API Key": "Ключ API Google AI Studio",
|
||||
"Google Model": "Модель Google",
|
||||
"MistralAI API Key": "Ключ API MistralAI",
|
||||
"MistralAI Model": "Модель MistralAI",
|
||||
|
@@ -390,7 +390,7 @@
|
||||
"Alt Method": "Phương pháp thay thế",
|
||||
"AI21 API Key": "Khóa API của AI21",
|
||||
"AI21 Model": "Mô hình AI21",
|
||||
"MakerSuite API Key": "Khóa API MakerSuite",
|
||||
"Google AI Studio API Key": "Khóa API Google AI Studio",
|
||||
"Google Model": "Mô hình Google",
|
||||
"MistralAI API Key": "Khóa API MistralAI",
|
||||
"MistralAI Model": "Mô hình MistralAI",
|
||||
|
@@ -406,7 +406,7 @@
|
||||
"Alt Method": "备用方法",
|
||||
"AI21 API Key": "AI21 API 密钥",
|
||||
"AI21 Model": "AI21 模型",
|
||||
"MakerSuite API Key": "MakerSuite API 密钥",
|
||||
"Google AI Studio API Key": "Google AI Studio API 密钥",
|
||||
"Google Model": "Google 模型",
|
||||
"MistralAI API Key": "MistralAI API 密钥",
|
||||
"MistralAI Model": "MistralAI 模型",
|
||||
|
@@ -391,7 +391,7 @@
|
||||
"Alt Method": "替代方法",
|
||||
"AI21 API Key": "AI21 API 金鑰",
|
||||
"AI21 Model": "AI21 模型",
|
||||
"MakerSuite API Key": "MakerSuite API 金鑰",
|
||||
"Google AI Studio API Key": "Google AI Studio API 金鑰",
|
||||
"Google Model": "Google 模型",
|
||||
"MistralAI API Key": "MistralAI API 金鑰",
|
||||
"MistralAI Model": "MistralAI 模型",
|
||||
|
@@ -242,7 +242,7 @@ import { DragAndDropHandler } from './scripts/dragdrop.js';
|
||||
import { INTERACTABLE_CONTROL_CLASS, initKeyboard } from './scripts/keyboard.js';
|
||||
import { initDynamicStyles } from './scripts/dynamic-styles.js';
|
||||
import { SlashCommandEnumValue, enumTypes } from './scripts/slash-commands/SlashCommandEnumValue.js';
|
||||
import { enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js';
|
||||
import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js';
|
||||
|
||||
//exporting functions and vars for mods
|
||||
export {
|
||||
@@ -1879,8 +1879,12 @@ export function messageFormatting(mes, ch_name, isSystem, isUser, messageId) {
|
||||
}
|
||||
|
||||
if (Number(messageId) === 0 && !isSystem && !isUser) {
|
||||
const mesBeforeReplace = mes;
|
||||
const chatMessage = chat[messageId];
|
||||
mes = substituteParams(mes, undefined, ch_name);
|
||||
chat[messageId] && (chat[messageId].mes = mes);
|
||||
if (chatMessage && chatMessage.mes === mesBeforeReplace && chatMessage.extra?.display_text !== mesBeforeReplace) {
|
||||
chatMessage.mes = mes;
|
||||
}
|
||||
}
|
||||
|
||||
mesForShowdownParse = mes;
|
||||
@@ -8380,6 +8384,12 @@ const CONNECT_API_MAP = {
|
||||
button: '#api_button_openai',
|
||||
source: chat_completion_sources.OPENAI,
|
||||
},
|
||||
// Google alias
|
||||
'google': {
|
||||
selected: 'openai',
|
||||
button: '#api_button_openai',
|
||||
source: chat_completion_sources.MAKERSUITE,
|
||||
},
|
||||
// OpenRouter special naming, to differentiate between chat comp and text comp
|
||||
'openrouter': {
|
||||
selected: 'openai',
|
||||
@@ -8465,7 +8475,7 @@ async function disableInstructCallback() {
|
||||
/**
|
||||
* @param {string} text API name
|
||||
*/
|
||||
async function connectAPISlash(_, text) {
|
||||
async function connectAPISlash(args, text) {
|
||||
if (!text.trim()) {
|
||||
for (const [key, config] of Object.entries(CONNECT_API_MAP)) {
|
||||
if (config.selected !== main_api) continue;
|
||||
@@ -8488,12 +8498,15 @@ async function connectAPISlash(_, text) {
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
console.error('FIXME: The current API is not in the API map');
|
||||
return '';
|
||||
}
|
||||
|
||||
const apiConfig = CONNECT_API_MAP[text.toLowerCase()];
|
||||
if (!apiConfig) {
|
||||
toastr.error(`Error: ${text} is not a valid API`);
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
$(`#main_api option[value='${apiConfig.selected || text}']`).prop('selected', true);
|
||||
@@ -8513,14 +8526,18 @@ async function connectAPISlash(_, text) {
|
||||
$(apiConfig.button).trigger('click');
|
||||
}
|
||||
|
||||
toastr.info(`API set to ${text}, trying to connect..`);
|
||||
const quiet = isTrueBoolean(args?.quiet);
|
||||
const toast = quiet ? jQuery() : toastr.info(`API set to ${text}, trying to connect..`);
|
||||
|
||||
try {
|
||||
await waitUntilCondition(() => online_status !== 'no_connection', 10000, 100);
|
||||
console.log('Connection successful');
|
||||
} catch {
|
||||
console.log('Could not connect after 5 seconds, skipping.');
|
||||
console.log('Could not connect after 10 seconds, skipping.');
|
||||
}
|
||||
|
||||
toastr.clear(toast);
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8979,6 +8996,15 @@ jQuery(async function () {
|
||||
name: 'api',
|
||||
callback: connectAPISlash,
|
||||
returns: 'the current API',
|
||||
namedArgumentList: [
|
||||
SlashCommandNamedArgument.fromProps({
|
||||
name: 'quiet',
|
||||
description: 'Suppress the toast message on connection',
|
||||
typeList: [ARGUMENT_TYPE.BOOLEAN],
|
||||
defaultValue: 'false',
|
||||
enumList: commonEnumProviders.boolean('trueFalse')(),
|
||||
}),
|
||||
],
|
||||
unnamedArgumentList: [
|
||||
SlashCommandArgument.fromProps({
|
||||
description: 'API to connect to',
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<option value="zerooneai">01.AI (Yi)</option>
|
||||
<option value="anthropic">Anthropic</option>
|
||||
<option value="custom" data-i18n="Custom (OpenAI-compatible)">Custom (OpenAI-compatible)</option>
|
||||
<option value="google">Google MakerSuite</option>
|
||||
<option value="google">Google AI Studio</option>
|
||||
<option value="koboldcpp">KoboldCpp</option>
|
||||
<option value="llamacpp">llama.cpp</option>
|
||||
<option value="ollama">Ollama</option>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { getStringHash, debounce, waitUntilCondition, extractAllWords } from '../../utils.js';
|
||||
import { getStringHash, debounce, waitUntilCondition, extractAllWords, isTrueBoolean } from '../../utils.js';
|
||||
import { getContext, getApiUrl, extension_settings, doExtrasFetch, modules, renderExtensionTemplateAsync } from '../../extensions.js';
|
||||
import {
|
||||
activateSendButtons,
|
||||
@@ -26,6 +26,7 @@ import { SlashCommand } from '../../slash-commands/SlashCommand.js';
|
||||
import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
|
||||
import { MacrosParser } from '../../macros.js';
|
||||
import { countWebLlmTokens, generateWebLlmChatPrompt, getWebLlmContextSize, isWebLlmSupported } from '../shared.js';
|
||||
import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
|
||||
export { MODULE_NAME };
|
||||
|
||||
const MODULE_NAME = '1_memory';
|
||||
@@ -456,7 +457,12 @@ async function onChatEvent() {
|
||||
}
|
||||
}
|
||||
|
||||
async function forceSummarizeChat() {
|
||||
/**
|
||||
* Forces a summary generation for the current chat.
|
||||
* @param {boolean} quiet If an informational toast should be displayed
|
||||
* @returns {Promise<string>} Summarized text
|
||||
*/
|
||||
async function forceSummarizeChat(quiet) {
|
||||
if (extension_settings.memory.source === summary_sources.extras) {
|
||||
toastr.warning('Force summarization is not supported for Extras API');
|
||||
return;
|
||||
@@ -471,7 +477,7 @@ async function forceSummarizeChat() {
|
||||
return '';
|
||||
}
|
||||
|
||||
const toast = toastr.info('Summarizing chat...', 'Please wait', { timeOut: 0, extendedTimeOut: 0 });
|
||||
const toast = quiet ? jQuery() : toastr.info('Summarizing chat...', 'Please wait', { timeOut: 0, extendedTimeOut: 0 });
|
||||
const value = extension_settings.memory.source === summary_sources.main
|
||||
? await summarizeChatMain(context, true, skipWIAN)
|
||||
: await summarizeChatWebLLM(context, true);
|
||||
@@ -494,9 +500,10 @@ async function forceSummarizeChat() {
|
||||
async function summarizeCallback(args, text) {
|
||||
text = text.trim();
|
||||
|
||||
// Using forceSummarizeChat to summarize the current chat
|
||||
// Summarize the current chat if no text provided
|
||||
if (!text) {
|
||||
return await forceSummarizeChat();
|
||||
const quiet = isTrueBoolean(args.quiet);
|
||||
return await forceSummarizeChat(quiet);
|
||||
}
|
||||
|
||||
const source = args.source || extension_settings.memory.source;
|
||||
@@ -1005,7 +1012,7 @@ function setupListeners() {
|
||||
$('#memory_prompt_words').off('click').on('input', onMemoryPromptWordsInput);
|
||||
$('#memory_prompt_interval').off('click').on('input', onMemoryPromptIntervalInput);
|
||||
$('#memory_prompt').off('click').on('input', onMemoryPromptInput);
|
||||
$('#memory_force_summarize').off('click').on('click', forceSummarizeChat);
|
||||
$('#memory_force_summarize').off('click').on('click', () => forceSummarizeChat(false));
|
||||
$('#memory_template').off('click').on('input', onMemoryTemplateInput);
|
||||
$('#memory_depth').off('click').on('input', onMemoryDepthInput);
|
||||
$('#memory_role').off('click').on('input', onMemoryRoleInput);
|
||||
@@ -1055,6 +1062,13 @@ jQuery(async function () {
|
||||
typeList: [ARGUMENT_TYPE.STRING],
|
||||
defaultValue: '',
|
||||
}),
|
||||
SlashCommandNamedArgument.fromProps({
|
||||
name: 'quiet',
|
||||
description: 'suppress the toast message when summarizing the chat',
|
||||
typeList: [ARGUMENT_TYPE.BOOLEAN],
|
||||
defaultValue: 'false',
|
||||
enumList: commonEnumProviders.boolean('trueFalse')(),
|
||||
}),
|
||||
],
|
||||
unnamedArgumentList: [
|
||||
new SlashCommandArgument('text to summarize', [ARGUMENT_TYPE.STRING], false, false, ''),
|
||||
|
@@ -141,7 +141,7 @@ function throwIfInvalidModel(useReverseProxy) {
|
||||
}
|
||||
|
||||
if (extension_settings.caption.multimodal_api === 'google' && !secret_state[SECRET_KEYS.MAKERSUITE] && !useReverseProxy) {
|
||||
throw new Error('MakerSuite API key is not set.');
|
||||
throw new Error('Google AI Studio API key is not set.');
|
||||
}
|
||||
|
||||
if (extension_settings.caption.multimodal_api === 'ollama' && !textgenerationwebui_settings.server_urls[textgen_types.OLLAMA]) {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<select id="vectors_source" class="text_pole">
|
||||
<option value="cohere">Cohere</option>
|
||||
<option value="extras">Extras</option>
|
||||
<option value="palm">Google MakerSuite</option>
|
||||
<option value="palm">Google AI Studio</option>
|
||||
<option value="llamacpp">llama.cpp</option>
|
||||
<option value="transformers" data-i18n="Local (Transformers)">Local (Transformers)</option>
|
||||
<option value="mistral">MistralAI</option>
|
||||
|
@@ -4473,7 +4473,7 @@ async function onConnectButtonClick(e) {
|
||||
}
|
||||
|
||||
if (!secret_state[SECRET_KEYS.MAKERSUITE] && !oai_settings.reverse_proxy) {
|
||||
console.log('No secret key saved for MakerSuite');
|
||||
console.log('No secret key saved for Google AI Studio');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -259,7 +259,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
const apiKey = request.body.reverse_proxy ? request.body.proxy_password : readSecret(request.user.directories, SECRET_KEYS.MAKERSUITE);
|
||||
|
||||
if (!request.body.reverse_proxy && !apiKey) {
|
||||
console.log('MakerSuite API key is missing.');
|
||||
console.log('Google AI Studio API key is missing.');
|
||||
return response.status(400).send({ error: true });
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
}
|
||||
|
||||
const body = isGemini ? getGeminiBody() : getBisonBody();
|
||||
console.log('MakerSuite request:', body);
|
||||
console.log('Google AI Studio request:', body);
|
||||
|
||||
try {
|
||||
const controller = new AbortController();
|
||||
@@ -362,7 +362,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
}
|
||||
} else {
|
||||
if (!generateResponse.ok) {
|
||||
console.log(`MakerSuite API returned error: ${generateResponse.status} ${generateResponse.statusText} ${await generateResponse.text()}`);
|
||||
console.log(`Google AI Studio API returned error: ${generateResponse.status} ${generateResponse.statusText} ${await generateResponse.text()}`);
|
||||
return response.status(generateResponse.status).send({ error: true });
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
|
||||
const candidates = generateResponseJson?.candidates;
|
||||
if (!candidates || candidates.length === 0) {
|
||||
let message = 'MakerSuite API returned no candidate';
|
||||
let message = 'Google AI Studio API returned no candidate';
|
||||
console.log(message, generateResponseJson);
|
||||
if (generateResponseJson?.promptFeedback?.blockReason) {
|
||||
message += `\nPrompt was blocked due to : ${generateResponseJson.promptFeedback.blockReason}`;
|
||||
@@ -381,19 +381,19 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
const responseContent = candidates[0].content ?? candidates[0].output;
|
||||
const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.[0]?.text;
|
||||
if (!responseText) {
|
||||
let message = 'MakerSuite Candidate text empty';
|
||||
let message = 'Google AI Studio Candidate text empty';
|
||||
console.log(message, generateResponseJson);
|
||||
return response.send({ error: { message } });
|
||||
}
|
||||
|
||||
console.log('MakerSuite response:', responseText);
|
||||
console.log('Google AI Studio response:', responseText);
|
||||
|
||||
// Wrap it back to OAI format
|
||||
const reply = { choices: [{ 'message': { 'content': responseText } }] };
|
||||
return response.send(reply);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error communicating with MakerSuite API: ', error);
|
||||
console.log('Error communicating with Google AI Studio API: ', error);
|
||||
if (!response.headersSent) {
|
||||
return response.status(500).send({ error: true });
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ router.post('/caption-image', jsonParser, async (request, response) => {
|
||||
|
||||
if (!result.ok) {
|
||||
const error = await result.json();
|
||||
console.log(`MakerSuite API returned error: ${result.status} ${result.statusText}`, error);
|
||||
console.log(`Google AI Studio API returned error: ${result.status} ${result.statusText}`, error);
|
||||
return response.status(result.status).send({ error: true });
|
||||
}
|
||||
|
||||
|
@@ -23,8 +23,8 @@ async function getMakerSuiteVector(text, directories) {
|
||||
const key = readSecret(directories, SECRET_KEYS.MAKERSUITE);
|
||||
|
||||
if (!key) {
|
||||
console.log('No MakerSuite key found');
|
||||
throw new Error('No MakerSuite key found');
|
||||
console.log('No Google AI Studio key found');
|
||||
throw new Error('No Google AI Studio key found');
|
||||
}
|
||||
|
||||
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/embedding-gecko-001:embedText?key=${key}`, {
|
||||
@@ -39,8 +39,8 @@ async function getMakerSuiteVector(text, directories) {
|
||||
|
||||
if (!response.ok) {
|
||||
const text = await response.text();
|
||||
console.log('MakerSuite request failed', response.statusText, text);
|
||||
throw new Error('MakerSuite request failed');
|
||||
console.log('Google AI Studio request failed', response.statusText, text);
|
||||
throw new Error('Google AI Studio request failed');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
Reference in New Issue
Block a user