Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add mechanism to register messageParser #5

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Nov 20, 2023

Description

This PR mainly setup a mechanism for other plugin to register their customized parser logic based on the interaction body Agent framework gives back.

message parser

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@SuZhou-Joe SuZhou-Joe force-pushed the feature/agent-framework branch from 4ec2ac7 to 841a273 Compare November 20, 2023 06:19
@SuZhou-Joe SuZhou-Joe force-pushed the feature/add-builder-registration branch 2 times, most recently from 4647cb6 to 23e550f Compare November 20, 2023 07:28
@SuZhou-Joe SuZhou-Joe changed the title feat: add mechannism to register messageParser feat: add mechanism to register messageParser Nov 20, 2023
@SuZhou-Joe SuZhou-Joe requested a review from ruanyl November 21, 2023 06:04
@SuZhou-Joe
Copy link
Member Author

@ruanyl @joshuali925 would you mind reviewing this PR?

@SuZhou-Joe SuZhou-Joe force-pushed the feature/add-builder-registration branch from 1851778 to 02523c3 Compare November 21, 2023 09:14
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good thanks, just some questions


### 📈 Features/Enhancements

- Add support for registerMessageParser ([#5](https://github.com/opensearch-project/dashboards-assistant/pull/5))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to manually maintain changelog? can it be generated automatically with
https://github.com/tj/git-extras/blob/HEAD/Commands.md#git-changelog
or
https://github.com/orhun/git-cliff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was a requirement set by the org. But I think this project is private so there wouldn't be an initial source to compare it to so I'd probably skip this changelog

server/README.md Outdated Show resolved Hide resolved
server/README.md Outdated Show resolved Hide resolved
server/services/storage/saved_objects_storage_service.ts Outdated Show resolved Hide resolved
server/types.ts Outdated Show resolved Hide resolved
@kavilla
Copy link
Member

kavilla commented Nov 21, 2023

How come this branch needs to be feature/agent-framework?

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
server/routes/chat_routes.ts Outdated Show resolved Hide resolved
server/types.ts Show resolved Hide resolved
server/types.ts Outdated Show resolved Hide resolved
* Make sure the tempResult is an array.
*/
if (!Array.isArray(tempResult)) {
tempResult = [];
Copy link
Member

@ruanyl ruanyl Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here we just ignore the parse results if it's not an array? If we consider this is invalid data, shall we throw error here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we only accept those response with correct format. I just do not want to do some error handling like wrapping a single message into an array. We should comply with the type restriction.

@SuZhou-Joe
Copy link
Member Author

How come this branch needs to be feature/agent-framework?

I understand your concern that this parser registration should be a generic solution for plugins to register their customized logic but the concept: interaction is only valid in the context of Agent framework. So we have to merge the code into Agent framework instead of against langchain.

Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit 39224a2 into feature/agent-framework Nov 22, 2023
12 checks passed
@SuZhou-Joe SuZhou-Joe deleted the feature/add-builder-registration branch December 1, 2023 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants