mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add check for "embeddings" module.
This commit is contained in:
@@ -4,7 +4,7 @@ const fetch = require('node-fetch').default;
|
||||
* Gets the vector for the given text from SillyTavern-extras
|
||||
* @param {string[]} texts - The array of texts to get the vectors for
|
||||
* @param {string} apiUrl - The Extras API URL
|
||||
* @param {string} - The Extras API key, or empty string if API key not enabled
|
||||
* @param {string} apiKey - The Extras API key, or empty string if API key not enabled
|
||||
* @returns {Promise<number[][]>} - The array of vectors for the texts
|
||||
*/
|
||||
async function getExtrasBatchVector(texts, apiUrl, apiKey) {
|
||||
@@ -15,7 +15,7 @@ async function getExtrasBatchVector(texts, apiUrl, apiKey) {
|
||||
* Gets the vector for the given text from SillyTavern-extras
|
||||
* @param {string} text - The text to get the vector for
|
||||
* @param {string} apiUrl - The Extras API URL
|
||||
* @param {string} - The Extras API key, or empty string if API key not enabled
|
||||
* @param {string} apiKey - The Extras API key, or empty string if API key not enabled
|
||||
* @returns {Promise<number[]>} - The vector for the text
|
||||
*/
|
||||
async function getExtrasVector(text, apiUrl, apiKey) {
|
||||
@@ -26,8 +26,8 @@ async function getExtrasVector(text, apiUrl, apiKey) {
|
||||
* Gets the vector for the given text from SillyTavern-extras
|
||||
* @param {string|string[]} text - The text or texts to get the vector(s) for
|
||||
* @param {string} apiUrl - The Extras API URL
|
||||
* @param {string} - The Extras API key, or empty string if API key not enabled
|
||||
* @returns {Promise<number[]>|Promise<number[][]>} - The vector for a single text, or the array of vectors for multiple texts
|
||||
* @param {string} apiKey - The Extras API key, or empty string if API key not enabled *
|
||||
* @returns {Promise<Array>} - The vector for a single text if input is string, or the array of vectors for multiple texts if input is string[]
|
||||
*/
|
||||
async function getExtrasVectorImpl(text, apiUrl, apiKey) {
|
||||
let url;
|
||||
|
Reference in New Issue
Block a user