New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fireaw.ai/sdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fireaw.ai/sdk - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

34

ChatChannel.d.ts
type Message = {
/**
* The internal id of the message
*/
id: string;
/**
* The message text
*/
content: string;
role: string;
/**
* Whether the message was sent by the user or the assistant
*/
role: "user" | "assistant";
/**
* The utc timestamp when the message was created
*/
created_at: string;
/**
* The number of tokens the message costs
*/
tokens: number;
/**
* The estimated cost of the message in USD
*/
cost: number;
/**
* True when all content has been received, otherwise false
*/
finished: boolean;
/**
* The document chunks that were retreived and injected into the user prompt as "{{docs}}".
* This is only present when the message is an assistant message, finished is true, and
* the ChatChannel was created with the includeConyext option set to true.
*/
context: string;
};

@@ -14,2 +42,3 @@ type ChatChannelProps = {

host?: string;
includeContext?: boolean;
};

@@ -22,6 +51,7 @@ export default class ChatChannel {

private readonly host;
private readonly includeContext;
chat: any;
private consumer?;
private subscription?;
constructor({ apiToken, chatbotId, onMessage, host, }: ChatChannelProps);
constructor({ apiToken, chatbotId, onMessage, host, includeContext, }: ChatChannelProps);
connect(): Promise<void>;

@@ -28,0 +58,0 @@ get apiHost(): string;

4

ChatChannel.js

@@ -14,3 +14,3 @@ "use strict";

class ChatChannel {
constructor({ apiToken, chatbotId, onMessage, host = "www.fireaw.ai", }) {
constructor({ apiToken, chatbotId, onMessage, host = "www.fireaw.ai", includeContext = false, }) {
this.apiToken = apiToken;

@@ -21,2 +21,3 @@ this.chatbotId = chatbotId;

this.host = host;
this.includeContext = includeContext;
}

@@ -51,2 +52,3 @@ connect() {

collection_id: this.chatbotId,
include_context: this.includeContext,
},

@@ -53,0 +55,0 @@ }),

{
"name": "@fireaw.ai/sdk",
"version": "0.3.0",
"version": "0.4.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "mkdir -p dist; tsc; cp package.json README.md LICENSE dist",

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