Class

AssistantService

AssistantService()

Assistant Service

Constructor

# new AssistantService()

Constructor

View Source services/assistant.service.js, line 15

Classes

AssistantService

Methods

# async defaultMessageProcessor(message, history, lessonDataWithInvestigation, investigation) → {Promise.<(string|null)>}

Default message processor used for the "AnotherIntent", when the user is not asking to generate an investigation.

Parameters:
Name Type Description
message string

The user's message from which the lesson must be detected.

history Array.<IFormattedHistory>

The chat history between the user and the assistant.

lessonDataWithInvestigation string

Lesson data with investigation detected from the user's message.

investigation ICreateInvestigationDto

The current investigation, if it exists.

View Source services/assistant.service.js, line 38

If a required prompt is missing or something goes wrong when requesting the LLM.

Error

The AI Assistant's response.

Promise.<(string|null)>

# async processMessage(message, chatHistory, investigation, lessonWithoutInvestigation) → {Promise.<IAssistantResponseFormat>}

Processes messages sent by the user.

Parameters:
Name Type Description
message string

The user's message from which the lesson must be detected.

chatHistory Array.<IChatHistory>

The chat history between the user and the assistant.

investigation IInvestigation

The current investigation, if it exists.

lessonWithoutInvestigation string

Lesson data that does not contain an investigation.

View Source services/assistant.service.js, line 92

If something goes wrong when processing the message.

Error

The processed response to the user's message.

Promise.<IAssistantResponseFormat>