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

@nlux/core

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlux/core - npm Package Compare versions

Comparing version 2.0.12-alpha to 2.1.0-beta

32

nlux-core.d.ts
type ChatItem<AiMsg> = {
role: 'ai';
message: AiMsg;
serverResponse?: string | object | undefined;
} | {

@@ -68,3 +69,3 @@ role: 'user';

*/
streamText?: (message: string, observer: StreamingAdapterObserver, extras: ChatAdapterExtras<AiMsg>) => void;
streamText?: (message: string, observer: StreamingAdapterObserver<AiMsg>, extras: ChatAdapterExtras<AiMsg>) => void;
}

@@ -75,3 +76,3 @@ /**

*/
interface StreamingAdapterObserver {
interface StreamingAdapterObserver<ChunkType = string> {
/**

@@ -96,5 +97,5 @@ * This method should be called by the adapter when it has completed sending data to the AiChat user interface.

* This method should be called by the adapter when it has new data to send to the AiChat user interface.
* @param {string} message
* @param {ChunkType} chunk being sent as part of the stream.
*/
next(message: string): void;
next(chunk: ChunkType): void;
}

@@ -125,6 +126,8 @@

get dataTransferMode(): DataTransferMode;
fetchText(message: string, extras: ChatAdapterExtras<AiMsg>): Promise<AiMsg>;
fetchText(message: string, extras: ChatAdapterExtras<AiMsg>): Promise<string | object | undefined>;
get id(): string;
get info(): StandardAdapterInfo;
streamText(message: string, observer: StreamingAdapterObserver, extras: ChatAdapterExtras<AiMsg>): void;
preProcessAiStreamedChunk(chunk: string | object | undefined, extras: ChatAdapterExtras<AiMsg>): AiMsg | undefined;
preProcessAiUnifiedMessage(message: string | object | undefined, extras: ChatAdapterExtras<AiMsg>): AiMsg | undefined;
streamText(message: string, observer: StreamingAdapterObserver<string | object | undefined>, extras: ChatAdapterExtras<AiMsg>): void;
}

@@ -281,3 +284,3 @@

type AnyAiMsg = any;
type AnyAiMsg = unknown;

@@ -567,4 +570,4 @@ declare const NLErrors: {

declare class AiChat<AiMsg = string> implements IAiChat<AiMsg> {
protected theAdapter: ChatAdapter<AiMsg> | null;
protected theAdapterBuilder: StandardChatAdapter<AiMsg> | null;
protected theAdapter: ChatAdapter<AiMsg> | StandardChatAdapter<AiMsg> | null;
protected theAdapterBuilder: ChatAdapterBuilder<AiMsg> | null;
protected theAdapterType: 'builder' | 'instance' | null;

@@ -679,5 +682,8 @@ protected theClassName: string | null;

type CallbackArgType = object | string | number | boolean | symbol | null | undefined | void;
type CallbackFunction = (...args: CallbackArgType[]) => CallbackArgType;
type StreamParser = (root: HTMLElement, syntaxHighlighter?: HighlighterExtension) => IObserver<string>;
type StandardStreamParserOutput = IObserver<string> & {
onComplete(completeCallback: Function): void;
onComplete(completeCallback: CallbackFunction): void;
};

@@ -962,3 +968,3 @@ type StandardStreamParser = (root: HTMLElement, syntaxHighlighter?: HighlighterExtension, options?: {

discard(): void;
setCallback(callback: Function): void;
setCallback(callback: CallbackFunction): void;
setDescription(description: string): void;

@@ -1084,3 +1090,3 @@ setParamDescriptions(paramDescriptions: string[]): void;

*/
registerTask(taskId: string, description: string, callback: Function, paramDescriptions?: string[]): ContextTaskHandler | undefined;
registerTask(taskId: string, description: string, callback: CallbackFunction, paramDescriptions?: string[]): ContextTaskHandler | undefined;
/**

@@ -1114,3 +1120,3 @@ * Resets the context instance and sets the provided data. The contextId will not change after the reset operation

*/
runTask(taskId: string, parameters?: Array<any>): Promise<RunTaskResult>;
runTask(taskId: string, parameters?: Array<CallbackArgType>): Promise<RunTaskResult>;
/**

@@ -1117,0 +1123,0 @@ * Get the status of the context.

{
"name": "@nlux/core",
"version": "2.0.12-alpha",
"version": "2.1.0-beta",
"description": "nlux is Javascript and React library for building conversational AI interfaces, with support for OpenAI, Hugging Face, and more.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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