npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@haylee-ai/chat-sdk

v1.0.5

Published

Haylee AI Chat SDK

Readme

Haylee AI Chat SDK

TypeScript npm version License: MIT Node.js ESM

Getting Started

Installation

npm install @haylee-ai/chat-sdk
# or
pnpm add @haylee-ai/chat-sdk
# or
yarn add @haylee-ai/chat-sdk

Setup

Create a client with your API key. You can optionally specify a custom baseUrl (defaults to http://localhost:3000/api/v1/chat):

import { HayleeAI } from "@haylee-ai/chat-sdk";

const client = new HayleeAI({
    baseUrl: "http://localhost:3000/api/v1/chat", // optional
});

Basic Usage

Stream a message with optional conversation history:

await client.messages.stream(
  {
    message: "What are my latest campaigns?",
    conversation_history: [
      { role: "human", content: "Hello" },
      { role: "ai", content: "Hi! How can I help with Meta Marketing?" },
    ],
  },
  {
    onLlmToken: (ev) => {
      const text = ev.content?.[0]?.text ?? "";
      if (text) process.stdout.write(text);
    },
    onSearchUpdate: (ev) => {
      console.log("Search:", ev.content?.query, ev.status);
    },
    onError: (err) => {
      console.error("Stream error:", err);
    },
    signal: abortController.signal, 
  }
);

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk v1.0.0

Enumerations

Classes

Interfaces

Type Aliases

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / AuthenticationError

Class: AuthenticationError

Defined in: src/errors/authentication.error.ts:3

Extends

Constructors

Constructor

new AuthenticationError(message): AuthenticationError

Defined in: src/errors/authentication.error.ts:6

Parameters

message

string

Returns

AuthenticationError

Overrides

HayleeAIError.constructor

Properties

cause?

optional cause: unknown

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

HayleeAIError.cause


message

message: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

HayleeAIError.message


name

readonly name: string = "AuthenticationError"

Defined in: src/errors/authentication.error.ts:4

Overrides

HayleeAIError.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

HayleeAIError.stack


stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

HayleeAIError.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

HayleeAIError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:56

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

HayleeAIError.prepareStackTrace

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / AuthorizationError

Class: AuthorizationError

Defined in: src/errors/authorization.error.ts:3

Extends

Constructors

Constructor

new AuthorizationError(message): AuthorizationError

Defined in: src/errors/authorization.error.ts:6

Parameters

message

string

Returns

AuthorizationError

Overrides

HayleeAIError.constructor

Properties

cause?

optional cause: unknown

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

HayleeAIError.cause


message

message: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

HayleeAIError.message


name

readonly name: string = "AuthorizationError"

Defined in: src/errors/authorization.error.ts:4

Overrides

HayleeAIError.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

HayleeAIError.stack


stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

HayleeAIError.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

HayleeAIError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:56

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

HayleeAIError.prepareStackTrace

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / BaseEvent

Class: BaseEvent

Defined in: src/messages/types.ts:13

Base event for Streaming BaseEvent

Extended by

Constructors

Constructor

new BaseEvent(): BaseEvent

Returns

BaseEvent

Properties

kind

kind: EventKind

Defined in: src/messages/types.ts:17

Used to separate streams


node

node: string

Defined in: src/messages/types.ts:21

Source node in langgraph

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ConversationInfoContent

Class: ConversationInfoContent

Defined in: src/messages/types.ts:55

Constructors

Constructor

new ConversationInfoContent(): ConversationInfoContent

Returns

ConversationInfoContent

Properties

subject

subject: string

Defined in: src/messages/types.ts:57


type

type: "created" | "updated" | "deleted" | "error"

Defined in: src/messages/types.ts:56

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ConversationInfoEvent

Class: ConversationInfoEvent

Defined in: src/messages/types.ts:51

Base event for Streaming BaseEvent

Extends

Constructors

Constructor

new ConversationInfoEvent(): ConversationInfoEvent

Returns

ConversationInfoEvent

Inherited from

BaseEvent.constructor

Properties

content

content: ConversationInfoContent

Defined in: src/messages/types.ts:52


kind

kind: EventKind

Defined in: src/messages/types.ts:17

Used to separate streams

Inherited from

BaseEvent.kind


node

node: string

Defined in: src/messages/types.ts:21

Inherited from

BaseEvent.node

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / CreateMessageDto

Class: CreateMessageDto

Defined in: src/types/chat.interface.ts:8

DTO for creating a message

Constructors

Constructor

new CreateMessageDto(): CreateMessageDto

Returns

CreateMessageDto

Properties

conversation_id?

optional conversation_id: string

Defined in: src/types/chat.interface.ts:13


message

message: string

Defined in: src/types/chat.interface.ts:11

User message

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / EndEvent

Class: EndEvent

Defined in: src/messages/types.ts:62

Constructors

Constructor

new EndEvent(): EndEvent

Returns

EndEvent

Properties

success

success: boolean

Defined in: src/messages/types.ts:63

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / HayleeAI

Class: HayleeAI

Defined in: src/index.ts:7

Instantiate a new HayleeAI connection

Extends

Constructors

Constructor

new HayleeAI(options): HayleeAI

Defined in: src/index.ts:13

Parameters

options

HayleeAIChatClientOptions

HayleeAIChatClientOptions

Returns

HayleeAI

Overrides

HayleeAIClient.constructor

Properties

messages

messages: MessageService

Defined in: src/index.ts:8

Methods

_stream()

_stream(payload, signal?): AsyncGenerator<string, void, unknown>

Defined in: src/_internal/client.ts:35

Internal stream callout

Parameters

payload

CreateMessageDto

Message DTO

signal?

AbortSignal

Abort signal

Returns

AsyncGenerator<string, void, unknown>

Inherited from

HayleeAIClient._stream

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / HayleeAIClient

Class: HayleeAIClient

Defined in: src/_internal/client.ts:18

Internal HayleeAI Client. Do not use unless necessary. HayleeAIClient

Extended by

Constructors

Constructor

new HayleeAIClient(options): HayleeAIClient

Defined in: src/_internal/client.ts:26

Parameters

options

HayleeAIChatClientOptions

Auth, and baseURL

Returns

HayleeAIClient

Methods

_stream()

_stream(payload, signal?): AsyncGenerator<string, void, unknown>

Defined in: src/_internal/client.ts:35

Internal stream callout

Parameters

payload

CreateMessageDto

Message DTO

signal?

AbortSignal

Abort signal

Returns

AsyncGenerator<string, void, unknown>

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / HayleeAIError

Class: HayleeAIError

Defined in: src/errors/base.ts:1

Extends

  • Error

Extended by

Constructors

Constructor

new HayleeAIError(message): HayleeAIError

Defined in: src/errors/base.ts:4

Parameters

message

string

Returns

HayleeAIError

Overrides

Error.constructor

Properties

cause?

optional cause: unknown

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

Error.cause


message

message: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

Error.message


name

readonly name: string = "HayleeAIError"

Defined in: src/errors/base.ts:2

Overrides

Error.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

Error.stack


stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

Error.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:56

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / LlmTokenContent

Class: LlmTokenContent

Defined in: src/messages/types.ts:28

LLmTokenContent

Constructors

Constructor

new LlmTokenContent(): LlmTokenContent

Returns

LlmTokenContent

Properties

text

text: string

Defined in: src/messages/types.ts:36


type

type: "text"

Defined in: src/messages/types.ts:32

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / LlmTokenEvent

Class: LlmTokenEvent

Defined in: src/messages/types.ts:39

Base event for Streaming BaseEvent

Extends

Constructors

Constructor

new LlmTokenEvent(): LlmTokenEvent

Returns

LlmTokenEvent

Inherited from

BaseEvent.constructor

Properties

content

content: LlmTokenContent[]

Defined in: src/messages/types.ts:43


kind

kind: EventKind

Defined in: src/messages/types.ts:17

Used to separate streams

Inherited from

BaseEvent.kind


model

model: string

Defined in: src/messages/types.ts:47


node

node: string

Defined in: src/messages/types.ts:21

Inherited from

BaseEvent.node

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / MessageService

Class: MessageService

Defined in: src/messages/message.service.ts:59

Constructors

Constructor

new MessageService(client): MessageService

Defined in: src/messages/message.service.ts:61

Parameters

client

HayleeAIClient

Returns

MessageService

Methods

stream()

stream(payload, options?): Promise<void>

Defined in: src/messages/message.service.ts:67

Parameters

payload

CreateMessageDto

The create message payload

options?

MessageServiceOptions

Config for streaming

Returns

Promise<void>

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / NotFoundError

Class: NotFoundError

Defined in: src/errors/not-found.error.ts:3

Extends

Constructors

Constructor

new NotFoundError(message): NotFoundError

Defined in: src/errors/not-found.error.ts:6

Parameters

message

string

Returns

NotFoundError

Overrides

HayleeAIError.constructor

Properties

cause?

optional cause: unknown

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

HayleeAIError.cause


message

message: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

HayleeAIError.message


name

readonly name: string = "NotFoundError"

Defined in: src/errors/not-found.error.ts:4

Overrides

HayleeAIError.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

HayleeAIError.stack


stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

HayleeAIError.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

HayleeAIError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:56

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

HayleeAIError.prepareStackTrace

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ValidationError

Class: ValidationError

Defined in: src/errors/validation.error.ts:3

Extends

Constructors

Constructor

new ValidationError(message, details?): ValidationError

Defined in: src/errors/validation.error.ts:5

Parameters

message

string

details?

any

Returns

ValidationError

Overrides

HayleeAIError.constructor

Properties

cause?

optional cause: unknown

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

HayleeAIError.cause


details?

optional details: any

Defined in: src/errors/validation.error.ts:5


message

message: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

HayleeAIError.message


name

readonly name: string = "ValidationError"

Defined in: src/errors/validation.error.ts:4

Overrides

HayleeAIError.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

HayleeAIError.stack


stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

HayleeAIError.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

HayleeAIError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:56

Parameters

err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

HayleeAIError.prepareStackTrace

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / EventKind

Enumeration: EventKind

Defined in: src/messages/types.ts:1

Enumeration Members

CONVERSATION_INFO

CONVERSATION_INFO: "conversation_info"

Defined in: src/messages/types.ts:4


LLM_TOKEN

LLM_TOKEN: "llm_token"

Defined in: src/messages/types.ts:2


TOOLS

TOOLS: "tools"

Defined in: src/messages/types.ts:3

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / Role

Enumeration: Role

Defined in: src/types/chat.interface.ts:19

Enumeration Members

AI

AI: "ai"

Defined in: src/types/chat.interface.ts:21


HUMAN

HUMAN: "human"

Defined in: src/types/chat.interface.ts:20

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ToolStatus

Enumeration: ToolStatus

Defined in: src/messages/types.ts:75

Enumeration Members

END

END: "END"

Defined in: src/messages/types.ts:77


ERROR

ERROR: "ERROR"

Defined in: src/messages/types.ts:78


START

START: "START"

Defined in: src/messages/types.ts:76

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / MessageServiceOptions

Interface: MessageServiceOptions

Defined in: src/messages/message.service.ts:12

Properties

signal?

optional signal: AbortSignal

Defined in: src/messages/message.service.ts:56

AbortSignal for terminating the upstream stream

Methods

onConversationCreated()?

optional onConversationCreated(ev): void

Defined in: src/messages/message.service.ts:42

Streams on async conversation creation.

Parameters

ev

ConversationInfoEvent

ConversationInfoEvent

Returns

void


onConversationFailed()?

optional onConversationFailed(ev): void

Defined in: src/messages/message.service.ts:47

Streams on async conversation creation failure.

Parameters

ev

ConversationInfoEvent

ConversationInfoEvent

Returns

void


onEnd()?

optional onEnd(ev): void

Defined in: src/messages/message.service.ts:22

triggers upon stream end

Parameters

ev

EndEvent

EndEvent

Returns

void


onError()?

optional onError(err): void

Defined in: src/messages/message.service.ts:52

Streams errors on runtime

Parameters

err

unknown

Returns

void


onLlmToken()?

optional onLlmToken(ev): void

Defined in: src/messages/message.service.ts:17

Streams llm tokens for output

Parameters

ev

LlmTokenEvent

Returns

void


onToolEnd()?

optional onToolEnd(ev): void

Defined in: src/messages/message.service.ts:32

Streams tool end updates

Parameters

ev

ToolEvent

ToolEvent

Returns

void


onToolError()?

optional onToolError(ev): void

Defined in: src/messages/message.service.ts:37

Streams tool errors

Parameters

ev

ToolEvent

ToolEvent

Returns

void


onToolStart()?

optional onToolStart(ev): void

Defined in: src/messages/message.service.ts:27

Streams tool start updates

Parameters

ev

ToolEvent

ToolEvent

Returns

void

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ToolContent

Interface: ToolContent

Defined in: src/messages/types.ts:81

Properties

params

params: unknown

Defined in: src/messages/types.ts:82

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ToolEvent

Interface: ToolEvent

Defined in: src/messages/types.ts:66

Base event for Streaming BaseEvent

Extends

Properties

content?

optional content: ToolContent

Defined in: src/messages/types.ts:67


error?

optional error: unknown

Defined in: src/messages/types.ts:72


kind

kind: EventKind

Defined in: src/messages/types.ts:17

Used to separate streams

Inherited from

BaseEvent.kind


name

name: string

Defined in: src/messages/types.ts:68


node

node: string

Defined in: src/messages/types.ts:21

Inherited from

BaseEvent.node


results

results: ToolResultContent[]

Defined in: src/messages/types.ts:71


status

status: ToolStatus

Defined in: src/messages/types.ts:70


tool_call_id?

optional tool_call_id: string

Defined in: src/messages/types.ts:69

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / ToolResultContent

Interface: ToolResultContent

Defined in: src/messages/types.ts:85

Properties

content

content: any

Defined in: src/messages/types.ts:89


type

type: string

Defined in: src/messages/types.ts:87

@haylee-ai/chat-sdk v1.0.0


@haylee-ai/chat-sdk / HayleeAIChatClientOptions

Type Alias: HayleeAIChatClientOptions

HayleeAIChatClientOptions = object

Defined in: src/_internal/client.ts:9

Options for the HayleeAI Client

Properties

baseUrl?

optional baseUrl: string

Defined in: src/_internal/client.ts:10

Optional base URL, defaults to production