Classes
Methods
# async addInvestigationFields(investigation, modificationStep, isUserChangeExist) → {Promise.<string>}
Adds fields to an investigation.
Parameters:
| Name | Type | Description |
|---|---|---|
investigation |
IInvestigation
|
The current investigation from the database. |
modificationStep |
IModifyInvestigationProcessFormat
|
The detected step for adding data to existing fields in the current investigation. |
isUserChangeExist |
boolean
|
If there is user change in the user message |
If something goes wrong when requesting the LLM.
Error
- A message describing the added data.
Promise.<string>
# async deleteInvestigation(messageData) → {Promise.<IClassificatorResponseFormat>}
Deletes an investigation.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The deleted investigation or question message.
Promise.<IClassificatorResponseFormat>
# async editInvestigationFields(investigation, modificationStep, isUserChangeExist) → {Promise.<string>}
Edits investigation fields.
Parameters:
| Name | Type | Description |
|---|---|---|
investigation |
IInvestigation
|
The current investigation from the database. |
modificationStep |
IModifyInvestigationProcessFormat
|
The detected step for editing fields in the current investigation. |
isUserChangeExist |
boolean
|
If there is user change in the user message |
If something goes wrong when requesting the LLM.
Error
- A message describing the edited fields.
Promise.<string>
# async generateInvestigation(messageData) → {Promise.<IClassificatorResponseFormat>}
Generates an investigation based on the knowledge base.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The generated investigation or question message.
Promise.<IClassificatorResponseFormat>
# async generateInvestigationByAssistant(messageData) → {Promise.<IClassificatorResponseFormat>}
Generates an investigation based on the Assistant's knowledge.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The generated investigation or question message.
Promise.<IClassificatorResponseFormat>
# mergeInvestigationPreservingUserEdits(existing, generated) → {IInvestigation}
Merges AI-generated investigation with existing investigation, preserving fields where value !== aiGeneratedValue (user-edited fields).
Parameters:
| Name | Type | Description |
|---|---|---|
existing |
IInvestigation
|
The existing investigation with potentially user-edited fields. |
generated |
IInvestigation
|
The newly AI-generated investigation. |
- The merged investigation preserving user-edited fields.
IInvestigation
# async modifyInvestigation(messageData) → {Promise.<IClassificatorResponseFormat>}
Modifies an investigation.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The modified investigation or question message.
Promise.<IClassificatorResponseFormat>
# async process(messageData) → {Promise.<IClassificatorResponseFormat>}
Processes the classificator according to the detected intent.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The processed investigation or question message.
Promise.<IClassificatorResponseFormat>
# async processModificationSteps(messageData, modificationSteps) → {Promise.<string>}
Processes modification steps.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
modificationSteps |
Array.<IModifyInvestigationProcessFormat>
|
The detected steps that need to be modified in the current investigation. |
If something goes wrong when requesting the LLM.
Error
- A message describing the modifications.
Promise.<string>
# async removeInvestigationFields(investigation, modificationStep) → {Promise.<string>}
Removes fields from an investigation.
Parameters:
| Name | Type | Description |
|---|---|---|
investigation |
IInvestigation
|
The current investigation from the database. |
modificationStep |
IModifyInvestigationProcessFormat
|
The detected step for removing data from the current investigation. |
If something goes wrong when requesting the LLM.
Error
- A message describing the removed data.
Promise.<string>
# async resolveContradiction(messageData) → {Promise.<IClassificatorResponseFormat>}
Resolves a contradiction.
Parameters:
| Name | Type | Description |
|---|---|---|
messageData |
IClassificatorInputFormat
|
Data containing the user's message, intent, current investigation, and chat history. |
If something goes wrong when requesting the LLM.
Error
- The investigation with the resolved contradiction.
Promise.<IClassificatorResponseFormat>
# transformObjects(obj, isUserChangeExist) → {object}
Transforms a step for adding investigation fields.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
string
|
The content of the field addition modification step. |
isUserChangeExist |
boolean
|
If there is user change in the user message |
- An object containing
valueandaiGeneratedValuefields.
object