mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add NomicAI for vectorization (#1922)
* Crudely add NomicAi for vectorization * Move NomicAI to its own endpoint, properly handle API key * Adjust clear button html * Remove leftover nomicai http header code * Revert changes to openai-vectors.js * Fix UI issues * Revert change to settings, fix UI --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
700c20d441
commit
44a7dd3d74
@@ -5,7 +5,7 @@ const sanitize = require('sanitize-filename');
|
||||
const { jsonParser } = require('../express-common');
|
||||
|
||||
// Don't forget to add new sources to the SOURCES array
|
||||
const SOURCES = ['transformers', 'mistral', 'openai', 'extras', 'palm', 'togetherai'];
|
||||
const SOURCES = ['transformers', 'mistral', 'openai', 'extras', 'palm', 'togetherai', 'nomicai'];
|
||||
|
||||
/**
|
||||
* Gets the vector for the given text from the given source.
|
||||
@@ -16,6 +16,8 @@ const SOURCES = ['transformers', 'mistral', 'openai', 'extras', 'palm', 'togethe
|
||||
*/
|
||||
async function getVector(source, sourceSettings, text) {
|
||||
switch (source) {
|
||||
case 'nomicai':
|
||||
return require('../nomicai-vectors').getNomicAIVector(text, source);
|
||||
case 'togetherai':
|
||||
case 'mistral':
|
||||
case 'openai':
|
||||
@@ -45,6 +47,9 @@ async function getBatchVector(source, sourceSettings, texts) {
|
||||
let results = [];
|
||||
for (let batch of batches) {
|
||||
switch (source) {
|
||||
case 'nomicai':
|
||||
results.push(...await require('../nomicai-vectors').getNomicAIBatchVector(batch, source));
|
||||
break;
|
||||
case 'togetherai':
|
||||
case 'mistral':
|
||||
case 'openai':
|
||||
|
Reference in New Issue
Block a user