Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

together-ai

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

together-ai - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

2

dist/index.d.ts

@@ -33,4 +33,4 @@ type ApiResponse = {

[x: string]: any;
}): Promise<ApiResponse>;
}): Promise<ApiResponse | ReadableStream<Uint8Array>>;
}
export default Together;

@@ -42,4 +42,9 @@ "use strict";

});
const data = yield res.json();
return data;
if (inputs.stream_tokens === true) {
return res.body;
}
else {
const data = yield res.json();
return data;
}
});

@@ -46,0 +51,0 @@ }

{
"name": "together-ai",
"version": "0.3.0",
"version": "0.4.0",
"description": "A Node SDK for Together.ai.",

@@ -5,0 +5,0 @@ "author": "Hassan El Mghari (@nutlope)",

@@ -25,7 +25,9 @@ <div align="center">

const together = new Together({
auth: `api token`,
auth: process.env.TOGETHER_API_KEY,
});
const result = await together.inference('mistralai/Mistral-7B-Instruct-v0.1', {
prompt: 'tell me about the history of the United States',
const model = 'mistralai/Mistral-7B-Instruct-v0.1';
const result = await together.inference(model, {
prompt: 'Suggest some fun family activities for the new year',
max_tokens: 300,

@@ -32,0 +34,0 @@ });

@@ -37,2 +37,3 @@ type ApiResponse = {

}
const res = await fetch('https://api.together.xyz/inference', {

@@ -50,5 +51,8 @@ method: 'POST',

const data: ApiResponse = await res.json();
return data;
if (inputs.stream_tokens === true) {
return res.body;
} else {
const data: ApiResponse = await res.json();
return data;
}
}

@@ -55,0 +59,0 @@ }

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