Skip to content

chatbot/state/index

This page is auto-generated from TSDoc output. Edit the source file, not this Markdown.

  • Package: @leipzigtreechat/chatbot
  • Source file: packages/chatbot/src/state/index.ts

Re-exported from ”./clarification_conversation.js”.

function getMessageContent(msg: BaseMessage): Effect.Effect<string, TypeError>

Helper function to get the content of a message as a string

Parameters

  • msg (BaseMessage): Messge to get content from Returns
  • Effect.Effect<string, TypeError>: The message content as a string Defined at: line 67
function getLastAIMessage(state: AgentState): Effect.Effect<AIMessage, MissingMessageError>

Helper function to get the last AI message in the conversation

Parameters

  • state (AgentState): The current agent state Returns
  • Effect.Effect<AIMessage, MissingMessageError>: The last AI message or a MissingMessageError if none found Defined at: line 80
function getLastMessage(state: AgentState): Effect.Effect<BaseMessage, MissingMessageError>

Helper function to get the last message in the conversation

Parameters

  • state (AgentState): The current agent state Returns
  • Effect.Effect<BaseMessage, MissingMessageError>: The last AI message or a MissingMessageError if none found Defined at: line 98
type Chatmode = "USER_QUESTION" | "CLARIFICATION" | "RESPONSE"

High-level conversation mode used by the router to pick the next node.

Defined at: line 22

type AgentState = typeof AgentStateAnnotation.State

Concrete chatbot state shape produced by AgentStateAnnotation.

Defined at: line 60

const AgentStateAnnotation: unknown

Global state of the chatbot agent

Defined at: line 27

export { ClarificationConversation }

Re-exported from ”./clarification_conversation.js”.

Defined at: line 8

export { ClarificationAnswerURI }

Re-exported from ”./qanary-types.js”.

Defined at: line 10

export { ClarificationQuestionURI }

Re-exported from ”./qanary-types.js”.

Defined at: line 11

export { ConversationURI }

Re-exported from ”./qanary-types.js”.

Defined at: line 12

export { FinalAnswerURI }

Re-exported from ”./qanary-types.js”.

Defined at: line 13

export { QanaryClarificationAnswer }

Re-exported from ”./qanary-types.js”.

Defined at: line 14

export { QanaryClarificationQuestion }

Re-exported from ”./qanary-types.js”.

Defined at: line 15

export { QanaryFinalAnswer }

Re-exported from ”./qanary-types.js”.

Defined at: line 16