diff --git a/src/agent/library/skill_library.js b/src/agent/library/skill_library.js index 1b413db..370c60d 100644 --- a/src/agent/library/skill_library.js +++ b/src/agent/library/skill_library.js @@ -13,13 +13,18 @@ export class SkillLibrary { const skillDocs = getSkillDocs(); this.skill_docs = skillDocs; if (this.embedding_model) { - const embeddingPromises = skillDocs.map((doc) => { - return (async () => { - let func_name_desc = doc.split('\n').slice(0, 2).join(''); - this.skill_docs_embeddings[doc] = await this.embedding_model.embed(func_name_desc); - })(); - }); - await Promise.all(embeddingPromises); + try { + const embeddingPromises = skillDocs.map((doc) => { + return (async () => { + let func_name_desc = doc.split('\n').slice(0, 2).join(''); + this.skill_docs_embeddings[doc] = await this.embedding_model.embed(func_name_desc); + })(); + }); + await Promise.all(embeddingPromises); + } catch (error) { + console.warn('Error with embedding model, using word-overlap instead.'); + this.embedding_model = null; + } } } diff --git a/src/models/prompter.js b/src/models/prompter.js index 5906f8f..841839e 100644 --- a/src/models/prompter.js +++ b/src/models/prompter.js @@ -93,8 +93,6 @@ export class Prompter { this.embedding_model = new Mistral(embedding.model, embedding.url); else if (embedding.api === 'huggingface') this.embedding_model = new HuggingFace(embedding.model, embedding.url); - else if (embedding.api === 'groq') - this.embedding_model = new GroqCloudAPI(embedding.model, embedding.url); else if (embedding.api === 'novita') this.embedding_model = new Novita(embedding.model, embedding.url); else { diff --git a/src/utils/examples.js b/src/utils/examples.js index 0aeb8d0..470663d 100644 --- a/src/utils/examples.js +++ b/src/utils/examples.js @@ -38,7 +38,7 @@ export class Examples { // Wait for all embeddings to complete await Promise.all(embeddingPromises); } catch (err) { - console.warn('Error with embedding model, using word overlap instead:', err); + console.warn('Error with embedding model, using word-overlap instead.'); this.model = null; } }