Socket
Socket
Sign inDemoInstall

llm-interface

Package Overview
Dependencies
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llm-interface - npm Package Compare versions

Comparing version 2.0.1491 to 2.0.1492

t/t.js

14

package.json
{
"name": "llm-interface",
"version": "2.0.1491",
"version": "2.0.1492",
"main": "src/index.js",

@@ -67,3 +67,3 @@ "description": "A simple, unified NPM-based interface for interacting with multiple Large Language Model (LLM) APIs, including OpenAI, AI21 Studio, Anthropic, Cloudflare AI, Cohere, Fireworks AI, Google Gemini, Goose AI, Groq, Hugging Face, Mistral AI, Perplexity, Reka AI, watsonx.ai, and LLaMA.cpp.",

"dependencies": {
"@google/generative-ai": "^0.15.0",
"@google/generative-ai": "^0.16.0",
"axios": "^1.7.2",

@@ -77,4 +77,4 @@ "dotenv": "^16.4.5",

"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.24.8",
"@eslint/js": "^9.7.0",
"@babel/preset-env": "^7.25.0",
"@eslint/js": "^9.8.0",
"babel-jest": "^29.7.0",

@@ -85,3 +85,3 @@ "cache-manager": "^5.7.3",

"cheerio": "^1.0.0-rc.12",
"cloudinary": "^2.3.0",
"cloudinary": "^2.3.1",
"convert-svg-to-png": "^0.6.4",

@@ -93,5 +93,5 @@ "eventsource": "^2.0.2",

"jest": "^29.7.0",
"langchain": "^0.2.10",
"langchain": "^0.2.11",
"markdown-to-text": "^0.1.1",
"open-graph-scraper": "^6.6.3",
"open-graph-scraper": "^6.7.0",
"sharp": "^0.33.4",

@@ -98,0 +98,0 @@ "sharp-ico": "^0.1.5",

@@ -5,3 +5,3 @@ # llm-interface

![Version 2.0.1491](https://img.shields.io/badge/Version-2.0.1491-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Built with Node.js](https://img.shields.io/badge/Built%20with-Node.js-green)](https://nodejs.org/)
![Version 2.0.1492](https://img.shields.io/badge/Version-2.0.1492-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Built with Node.js](https://img.shields.io/badge/Built%20with-Node.js-green)](https://nodejs.org/)

@@ -50,3 +50,3 @@ ## Introduction

- **Improved Documentation**: Improved [documentation](docs/README.md) with new examples, glossary, and provider details. Updated API key details, model alias breakdown, and usage information.
- **More Examples**: [LangChain.js RAG](examples/langchain/rag.js), [Mixture-of-Authorities (MoA)](examples/moa/moa.js), and [more](docs/examples.md).
- **More Examples**: [LangChain.js RAG](examples/langchain/rag.js), [Mixture-of-Agents (MoA)](examples/moa/moa.js), and [more](docs/examples.md).
- **Removed Dependency**: `@anthropic-ai/sdk` is no longer required.

@@ -82,4 +82,4 @@

- Various [examples](/examples) are also available to help you get started.
- A breakdown of [model aliases](/docs/models.md) aliases is available here.
- A breakdown of [embeddings model aliases](/docs/embeddings.md) aliases is available here.
- A breakdown of [model aliases](/docs/models.md) is available here.
- A breakdown of [embeddings model aliases](/docs/embeddings.md) is available here.
- If you still want more examples, you may wish to review the [test cases](/test/) for further examples.

@@ -129,3 +129,3 @@

const message = {
model: 'gpt-3.5-turbo',
model: 'gpt-4o-mini',
messages: [

@@ -170,3 +170,3 @@ { role: 'system', content: 'You are a helpful assistant.' },

- [ ] Provider > Models > Azure AI
- [ ] Provider > Models > Groq
- [ ] Provider > Models > Grok
- [ ] Provider > Models > SiliconFlow

@@ -173,0 +173,0 @@ - [ ] Provider > Embeddings > Nomic

@@ -1,1 +0,20 @@

{"url":"https://api.openai.com/v1/chat/completions","model":{"default":"gpt-3.5-turbo","large":"gpt-4o","small":"gpt-3.5-turbo","agent":"gpt-4o"},"embeddingUrl":"https://api.openai.com/v1/embeddings","embeddings":{"default":"text-embedding-ada-002","large":"text-embedding-3-large","small":"text-embedding-3-small"},"createMessageObject":"getMessageObject","stream":true,"jsonMode":true,"maxTokens":true,"hasEmbeddings":true}
{
"url": "https://api.openai.com/v1/chat/completions",
"model": {
"default": "gpt-4o-mini",
"large": "gpt-4o",
"small": "gpt-4o-mini",
"agent": "gpt-4o"
},
"embeddingUrl": "https://api.openai.com/v1/embeddings",
"embeddings": {
"default": "text-embedding-ada-002",
"large": "text-embedding-3-large",
"small": "text-embedding-3-small"
},
"createMessageObject": "getMessageObject",
"stream": true,
"jsonMode": true,
"maxTokens": true,
"hasEmbeddings": true
}

@@ -1,1 +0,14 @@

{"url":"https://api.perplexity.ai/chat/completions","model":{"default":"llama-3-sonar-large-32k-online","large":"llama-3-sonar-large-32k-online","small":"llama-3-sonar-small-32k-online","agent":"llama-3-sonar-large-32k-online"},"createMessageObject":"getMessageObject","stream":true,"jsonMode":false,"maxTokens":true,"hasEmbeddings":false}
{
"url": "https://api.perplexity.ai/chat/completions",
"model": {
"default": "llama-3.1-sonar-large-128k-chat",
"large": "llama-3.1-sonar-large-128k-chat",
"small": "llama-3.1-sonar-small-128k-chat",
"agent": "llama-3.1-70b-instruct"
},
"createMessageObject": "getMessageObject",
"stream": true,
"jsonMode": false,
"maxTokens": true,
"hasEmbeddings": false
}

@@ -51,2 +51,3 @@ /**

},
timeout: 20000,
//signal: controller.signal,

@@ -53,0 +54,0 @@ });

@@ -29,5 +29,12 @@ const { SendMessageError, EmbeddingsError } = require('./errors.js');

const end = hrtime(start);
const resultsEnd = hrtime(start);
const milliseconds = end[0] * 1e3 + end[1] / 1e6;
response.total_time = milliseconds.toFixed(5);
const resultsMilliseconds = resultsEnd[0] * 1e3 + resultsEnd[1] / 1e6;
response.request_time = resultsMilliseconds.toFixed(5);
response.retries = currentRetry;
return response;

@@ -34,0 +41,0 @@ }

@@ -130,5 +130,14 @@ /**

const jsonrepair = await getJsonRepairInstance();
const repaired = jsonrepair(json);
const reparsed = JSON.parse(repaired);
return reparsed;
let repaired = false;
try {
repaired = jsonrepair(json);
} catch (e) {
repaired = jsonrepair(unescapeString(json));
}
if (repaired) {
const reparsed = JSON.parse(repaired);
return reparsed;
}
} catch (error) {

@@ -135,0 +144,0 @@ return original;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc