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.145 to 2.0.146

2

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

@@ -5,0 +5,0 @@ "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.",

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

![Version 2.0.145](https://img.shields.io/badge/Version-2.0.145-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.146](https://img.shields.io/badge/Version-2.0.146-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/)

@@ -42,3 +42,3 @@ ## Introduction

- **Recovery Mode (Beta)**: Automatically repair invalid JSON objects in response errors. Currently, this feature is only available with Groq.
- **Recovery Mode (Beta)**: Automatically repair invalid JSON objects in HTTP 400 response errors. Currently, this feature is only available with Groq.

@@ -45,0 +45,0 @@ **v2.0.11**

@@ -30,3 +30,3 @@ /**

const log = require('loglevel');
log.setLevel(log.levels.SILENT);
// BaseInterface class for interacting with various APIs

@@ -150,2 +150,7 @@ class BaseInterface {

async sendMessage(message, options = {}, interfaceOptions = {}) {
// allow for debugLevel
if (typeof interfaceOptions.debugLevel !== 'undefined') {
log.setLevel(interfaceOptions.debugLevel);
}
// Create the message object if a string is provided, otherwise use the provided object

@@ -197,3 +202,3 @@ let messageObject =

//log.log('baseInterface:url', this.baseURL + url);
log.log('baseInterface:url', this.baseURL + url);

@@ -203,4 +208,4 @@ // update the headers

//log.log('baseInterface:headers', this.client.defaults.headers);
//log.log('baseInterface:requestBody', requestBody);
log.log('baseInterface:headers', this.client.defaults.headers);
log.log('baseInterface:requestBody', requestBody);

@@ -214,3 +219,3 @@ let response;

response = await this.client.post(this.baseURL + url, requestBody);
//log.log('baseInterface:response.data', JSON.stringify(response.data));
log.log('baseInterface:response.data', JSON.stringify(response.data));
} else {

@@ -223,3 +228,7 @@ return await this.client.post(this.baseURL + url, requestBody, {

// attempt error recovery
//log.log('baseInterface:error',JSON.stringify(error),JSON.stringify(response),);
log.error(
'baseInterface:error',
JSON.stringify(error),
JSON.stringify(response),
);

@@ -315,3 +324,3 @@ responseContent = this.recoverError(error);

}
// log.log('baseInterface:responseContent(post)', JSON.stringify(responseContent));
//log.log('baseInterface:responseContent(post)', JSON.stringify(responseContent));

@@ -333,3 +342,3 @@ let finalResponse = { success: false, recoveryMode: false };

}
//log.log('baseInterface:finalResponse', JSON.stringify(finalResponse));
log.log('baseInterface:finalResponse', JSON.stringify(finalResponse));
return finalResponse;

@@ -336,0 +345,0 @@ }

@@ -162,3 +162,3 @@ /**

// Build response object
responseContent = { results: responseContent };
responseContent = { results: responseContent, success: true };

@@ -165,0 +165,0 @@ // optionally include the original llm api response

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