Skip to content

Commit

Permalink
feat: add doc change
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Nov 20, 2023
1 parent ecf353e commit c6adc00
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### 📈 Features/Enhancements

- Add support for registerMessageParser ([#5](https://github.com/opensearch-project/dashboards-assistant/pull/5))
22 changes: 22 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# `registerMessageParser` — Register your customized parser logic into Chatbot.

**Interaction** refers to a question-answer pair in Chatbot application. In most cases, an interaction consists of two messages: an `Input` message and an `Output` message. However, as the Chatbot evolves to become more powerful, it may display new messages such as visualizations, data explorers, or data grids. Therefore, it is crucial to implement a mechanism that allows other plugins to register their customized parser logic based on each interaction body.


## API

### registerMessageParser

```
dashboardAssistant.registerMessageParser({
id: "foo_parser",
parserProvider: async (interaction, messageParserHelper) => {
if (interaction.additional_info?.visualizationId) {
messageParserHelper.addMessage({
contentType: "visualization",
content: interaction.additional_info.visualizationId
})
}
}
})
```

0 comments on commit c6adc00

Please sign in to comment.