Class

IntentProcessorService

IntentProcessorService()

Intent Processor Service

Constructor

# new IntentProcessorService()

Constructor

View Source services/intentProcessor.service.js, line 12

Classes

IntentProcessorService

Methods

# async addInvestigationField(message, history, investigation) → {Promise.<IAddInvestigationFieldFormat>}

Detects which fields must be added to the current investigation by requesting the LLM.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

investigation ICreateInvestigationDto | null | undefined

The current investigation.

View Source services/intentProcessor.service.js, line 398

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

Error

The response containing the data for fields that must be added.

Promise.<IAddInvestigationFieldFormat>

# async detectEditableFieldsFromInvestigationObjects(message, investigation, investigationMetadata) → {Promise.<IDetectEditableFieldsFormat>}

Detects which fields must be edited in the objects of the current investigation by requesting the LLM.

Parameters:
Name Type Description
message string

The user's message.

investigation ICreateInvestigationDto

The provided investigation containing only objects with yaml format.

investigationMetadata string

The metadata of the investigation.

View Source services/intentProcessor.service.js, line 228

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

Error

The response containing editable fields that must be done.

Promise.<IDetectEditableFieldsFormat>

# async detectEditableFieldsFromInvestigationSteps(message, investigation, investigationMetadata) → {Promise.<IDetectEditableFieldsFormat>}

Detects which fields must be edited in the steps of the current investigation by requesting the LLM.

Parameters:
Name Type Description
message string

The user's message.

investigation ICreateInvestigationDto

The provided investigation containing only steps with yaml format.

investigationMetadata string

The metadata of the investigation.

View Source services/intentProcessor.service.js, line 275

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

Error

The response containing editable fields that must be done.

Promise.<IDetectEditableFieldsFormat>

# async detectEditableFieldsFromInvestigationTextFields(message, investigation, investigationMetadata) → {Promise.<IDetectEditableFieldsFormat>}

Detects which fields must be edited in the current investigation only in text fields by requesting the LLM.

Parameters:
Name Type Description
message string

The user's message.

investigation ICreateInvestigationDto

The provided investigation without steps and objects with yaml format.

investigationMetadata string

The metadata of the investigation.

View Source services/intentProcessor.service.js, line 181

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

Error

The response containing editable fields that must be done.

Promise.<IDetectEditableFieldsFormat>

# async detectIntent(message, history) → {Promise.<Intents>}

Detects the intent to determine which process should be executed.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

View Source services/intentProcessor.service.js, line 29

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

Error

The detected intent based on the user's message.

Promise.<Intents>

# async detectLessonWithInvestigationFromMessage(message, lessonData, history) → {Promise.<ILessonDetectionFormat>}

Detects the lesson containing investigation metadata based on a user message.

Parameters:
Name Type Description
message string

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

lessonData string

Data containing information about all lessons for the detected lesson.

history FormattedHistory

The chat history between the user and the assistant.

View Source services/intentProcessor.service.js, line 613

If something goes wrong when requesting the LLM.

Error
  • The detected lesson response.
Promise.<ILessonDetectionFormat>

# async detectLessonWithoutInvestigationFromMessage(message, lessonData, history) → {Promise.<ILessonDetectionFormat>}

Detects the lesson not containing investigation metadata based on a user message.

Parameters:
Name Type Description
message string

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

lessonData string

Data containing information about all lessons for the detected lesson.

history FormattedHistory

The chat history between the user and the assistant.

View Source services/intentProcessor.service.js, line 669

If something goes wrong when requesting the LLM.

Error
  • The detected lesson response.
Promise.<ILessonDetectionFormat>

# async detectMessageOfEditableFields(message, history, investigation, investigationMetadata) → {Promise.<IDetectEditableFieldsMessageFormat>}

Detects a message that user wants to implement changes in the investigation.

Parameters:
Name Type Description
message string

The user's message from which the message about editing fields must be detected.

history string

The chat history between the user and the assistant.

investigation string

The provided investigation with yaml format.

investigationMetadata string

The metadata of the investigation.

View Source services/intentProcessor.service.js, line 135

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

Error

The response containing the message that user wants to implement changes in the investigation.

Promise.<IDetectEditableFieldsMessageFormat>

# async detectModifyInvestigationIntent(message, history, investigation) → {Promise.<IModifyInvestigationIntentDetectionFormat>}

Detects the intent to determine which modifications should be made to the current investigation.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

investigation ICreateInvestigationDto | null

The current investigation.

View Source services/intentProcessor.service.js, line 83

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

Error

The detected intent based on the user's message for modifying the investigation.

Promise.<IModifyInvestigationIntentDetectionFormat>

# async detectUnitFromMessage(message, history) → {Promise.<IUnitDetectionFormat>}

Detects the unit of an investigation based on a user message.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

View Source services/intentProcessor.service.js, line 561

If something goes wrong when requesting the LLM.

Error
  • The detected unit response.
Promise.<IUnitDetectionFormat>

# async detectUserChangeExist(message, history) → {Promise.<boolean>}

Detects if user change exists in the user message.

Parameters:
Name Type Description
message string

The user's message from which the existing user changes will be detected.

history FormattedHistory

The chat history between the user and the assistant.

View Source services/intentProcessor.service.js, line 724

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

Error

True if user change exists in the message, otherwise false.

Promise.<boolean>

# async editInvestigationField(message, history, investigation) → {Promise.<IEditInvestigationFieldFormat>}

Detects which fields must be edited in the current investigation by requesting the LLM.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

investigation ICreateInvestigationDto

The current investigation.

View Source services/intentProcessor.service.js, line 322

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

Error

The response containing the fields that must be edited.

Promise.<IEditInvestigationFieldFormat>

# async removeInvestigationField(message, history, investigation) → {Promise.<IRemoveInvestigationFieldFormat>}

Detects which fields must be removed from the current investigation by requesting the LLM.

Parameters:
Name Type Description
message string

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

history FormattedHistory

The chat history between the user and the assistant.

investigation ICreateInvestigationDto | null | undefined

The current investigation.

View Source services/intentProcessor.service.js, line 471

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

Error

The response containing the fields whose values must be removed.

Promise.<IRemoveInvestigationFieldFormat>

# async summarizeMessages(summarizingMessages) → {Promise.<string>}

Summarizes multiple messages into a single message.

Parameters:
Name Type Description
summarizingMessages Array.<string>

The messages from which the lesson must be detected.

View Source services/intentProcessor.service.js, line 519

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

Error

The summarized message.

Promise.<string>