mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-18 12:47:27 +02:00
Add TogetherAI as a chat completion source, basic
This commit is contained in:
parent
2e6ab8be46
commit
9f2d32524c
@ -509,7 +509,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-newbie-hidden class="range-block" data-source="openai,claude,openrouter,ai21,scale,palm">
|
<div data-newbie-hidden class="range-block" data-source="openai,claude,openrouter,ai21,scale,palm,togetherai">
|
||||||
<div class="range-block-title" data-i18n="Top-p">
|
<div class="range-block-title" data-i18n="Top-p">
|
||||||
Top P
|
Top P
|
||||||
</div>
|
</div>
|
||||||
@ -749,7 +749,7 @@
|
|||||||
<div id="openai_proxy_password_show" title="Peek a password" class="menu_button fa-solid fa-eye-slash fa-fw"></div>
|
<div id="openai_proxy_password_show" title="Peek a password" class="menu_button fa-solid fa-eye-slash fa-fw"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-newbie-hidden class="range-block" data-source="openai,openrouter">
|
<div data-newbie-hidden class="range-block" data-source="openai,openrouter,togetherai">
|
||||||
<div class="range-block-title justifyLeft" data-i18n="Seed">
|
<div class="range-block-title justifyLeft" data-i18n="Seed">
|
||||||
Seed
|
Seed
|
||||||
</div>
|
</div>
|
||||||
@ -1598,7 +1598,7 @@
|
|||||||
<option value="koboldhorde"><span data-i18n="KoboldAI Horde">KoboldAI Horde</span></option>
|
<option value="koboldhorde"><span data-i18n="KoboldAI Horde">KoboldAI Horde</span></option>
|
||||||
<option value="novel"><span data-i18n="NovelAI">NovelAI</span></option>
|
<option value="novel"><span data-i18n="NovelAI">NovelAI</span></option>
|
||||||
<option value="textgenerationwebui"><span data-i18n="Text Completion">Text Completion (ooba, Mancer, Aphrodite, TabbyAPI, KoboldCpp)</span></option>
|
<option value="textgenerationwebui"><span data-i18n="Text Completion">Text Completion (ooba, Mancer, Aphrodite, TabbyAPI, KoboldCpp)</span></option>
|
||||||
<option value="openai"><span data-i18n="Chat Completion (OpenAI, Claude, Window/OpenRouter, Scale, AI21)">Chat Completion (OpenAI, Claude, Window, OpenRouter, Scale, AI21, PaLM)</span></option>
|
<option value="openai"><span data-i18n="Chat Completion (OpenAI, Claude, Window/OpenRouter, Scale, AI21, TogetherAI)">Chat Completion (OpenAI, Claude, Window, OpenRouter, Scale, AI21, PaLM, TogetherAI)</span></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div id="kobold_horde" style="position: relative;"> <!-- shows the kobold settings -->
|
<div id="kobold_horde" style="position: relative;"> <!-- shows the kobold settings -->
|
||||||
@ -1847,6 +1847,7 @@
|
|||||||
<option value="scale">Scale</option>
|
<option value="scale">Scale</option>
|
||||||
<option value="ai21">AI21</option>
|
<option value="ai21">AI21</option>
|
||||||
<option value="palm">Google PaLM 2</option>
|
<option value="palm">Google PaLM 2</option>
|
||||||
|
<option value="togetherai">TogetherAI</option>
|
||||||
</select>
|
</select>
|
||||||
<form id="openai_form" data-source="openai" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
<form id="openai_form" data-source="openai" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||||
<h4><span data-i18n="OpenAI API key">OpenAI API key</span></h4>
|
<h4><span data-i18n="OpenAI API key">OpenAI API key</span></h4>
|
||||||
|
@ -5326,6 +5326,7 @@ function changeMainAPI() {
|
|||||||
case chat_completion_sources.OPENAI:
|
case chat_completion_sources.OPENAI:
|
||||||
case chat_completion_sources.AI21:
|
case chat_completion_sources.AI21:
|
||||||
case chat_completion_sources.PALM:
|
case chat_completion_sources.PALM:
|
||||||
|
case chat_completion_sources.TOGETHERAI:
|
||||||
default:
|
default:
|
||||||
setupChatCompletionPromptManager(oai_settings);
|
setupChatCompletionPromptManager(oai_settings);
|
||||||
break;
|
break;
|
||||||
@ -7460,6 +7461,11 @@ function connectAPISlash(_, text) {
|
|||||||
source: 'palm',
|
source: 'palm',
|
||||||
button: '#api_button_openai',
|
button: '#api_button_openai',
|
||||||
},
|
},
|
||||||
|
'togetherai': {
|
||||||
|
selected: 'openai',
|
||||||
|
source: 'togetherai',
|
||||||
|
button: '#api_button_openai',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiConfig = apiMap[text];
|
const apiConfig = apiMap[text];
|
||||||
@ -7734,7 +7740,7 @@ jQuery(async function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerSlashCommand('dupe', DupeChar, [], '– duplicates the currently selected character', true, true);
|
registerSlashCommand('dupe', DupeChar, [], '– duplicates the currently selected character', true, true);
|
||||||
registerSlashCommand('api', connectAPISlash, [], '<span class="monospace">(kobold, horde, novel, ooba, oai, claude, windowai, openrouter, scale, ai21, palm)</span> – connect to an API', true, true);
|
registerSlashCommand('api', connectAPISlash, [], '<span class="monospace">(kobold, horde, novel, ooba, oai, claude, windowai, openrouter, scale, ai21, palm, togetherai)</span> – connect to an API', true, true);
|
||||||
registerSlashCommand('impersonate', doImpersonate, ['imp'], '– calls an impersonation response', true, true);
|
registerSlashCommand('impersonate', doImpersonate, ['imp'], '– calls an impersonation response', true, true);
|
||||||
registerSlashCommand('delchat', doDeleteChat, [], '– deletes the current chat', true, true);
|
registerSlashCommand('delchat', doDeleteChat, [], '– deletes the current chat', true, true);
|
||||||
registerSlashCommand('closechat', doCloseChat, [], '– closes the current chat', true, true);
|
registerSlashCommand('closechat', doCloseChat, [], '– closes the current chat', true, true);
|
||||||
|
@ -416,6 +416,7 @@ function RA_autoconnect(PrevApi) {
|
|||||||
|| (secret_state[SECRET_KEYS.OPENROUTER] && oai_settings.chat_completion_source == chat_completion_sources.OPENROUTER)
|
|| (secret_state[SECRET_KEYS.OPENROUTER] && oai_settings.chat_completion_source == chat_completion_sources.OPENROUTER)
|
||||||
|| (secret_state[SECRET_KEYS.AI21] && oai_settings.chat_completion_source == chat_completion_sources.AI21)
|
|| (secret_state[SECRET_KEYS.AI21] && oai_settings.chat_completion_source == chat_completion_sources.AI21)
|
||||||
|| (secret_state[SECRET_KEYS.PALM] && oai_settings.chat_completion_source == chat_completion_sources.PALM)
|
|| (secret_state[SECRET_KEYS.PALM] && oai_settings.chat_completion_source == chat_completion_sources.PALM)
|
||||||
|
|| (secret_state[SECRET_KEYS.TOGETHERAI] && oai_settings.chat_completion_source == chat_completion_sources.TOGETHERAI)
|
||||||
) {
|
) {
|
||||||
$('#api_button_openai').trigger('click');
|
$('#api_button_openai').trigger('click');
|
||||||
}
|
}
|
||||||
|
@ -392,8 +392,9 @@ async function getSavedHashes(collectionId) {
|
|||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async function insertVectorItems(collectionId, items) {
|
async function insertVectorItems(collectionId, items) {
|
||||||
if (settings.source === 'openai' && !secret_state[SECRET_KEYS.OPENAI] ||
|
if ((settings.source === 'openai' && !secret_state[SECRET_KEYS.OPENAI]) ||
|
||||||
settings.source === 'palm' && !secret_state[SECRET_KEYS.PALM]) {
|
(settings.source === 'palm' && !secret_state[SECRET_KEYS.PALM]) ||
|
||||||
|
(settings.source === 'togetherai' && !secret_state[SECRET_KEYS.TOGETHERAI])) {
|
||||||
throw new Error('Vectors: API key missing', { cause: 'api_key_missing' });
|
throw new Error('Vectors: API key missing', { cause: 'api_key_missing' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<option value="transformers">Local (Transformers)</option>
|
<option value="transformers">Local (Transformers)</option>
|
||||||
<option value="openai">OpenAI</option>
|
<option value="openai">OpenAI</option>
|
||||||
<option value="palm">Google MakerSuite (PaLM)</option>
|
<option value="palm">Google MakerSuite (PaLM)</option>
|
||||||
|
<option value="togetherai">Together AI</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user