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

Enhance Message and Memory API Validation and storage #3283

Merged

Conversation

rithin-pullela-aws
Copy link
Contributor

@rithin-pullela-aws rithin-pullela-aws commented Dec 16, 2024

Skip saving empty fields in interactions and conversations to optimize storage usage.
Modify GET requests for interactions and conversations to return only non-null fields.
Throw an exception if all fields in a create interaction call are empty or null.
Add unit tests to cover the above cases.

Description

[Describe what this change achieves]

Related Issues

Resolves #3250

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Throw an error when an unknown field is provided in CreateConversation or CreateInteraction.
Skip saving empty fields in interactions and conversations to optimize storage usage.
Modify GET requests for interactions and conversations to return only non-null fields.
Throw an exception if all fields in a create interaction call are empty or null.
Add unit tests to cover the above cases.

Signed-off-by: rithin-pullela-aws <[email protected]>
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval December 16, 2024 19:14 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval December 16, 2024 19:14 — with GitHub Actions Failure
@dhrubo-os
Copy link
Collaborator


ConversationMetaIndexITTests > testCanGetAConversationById FAILED
    org.opensearch.discovery.ClusterManagerNotDiscoveredException at TransportClusterManagerNodeAction.java:345
    java.lang.AssertionError at ConversationMetaIndexITTests.java:573

@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 16, 2024 23:58 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 16, 2024 23:58 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 17, 2024 01:01 — with GitHub Actions Inactive
Signed-off-by: rithin-pullela-aws <[email protected]>
Used assertThrows and added promptTemplate with empty string in test_ToXContent to ensure well rounded testing of expected functionality

Signed-off-by: rithin-pullela-aws <[email protected]>
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 18, 2024 02:49 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 18, 2024 02:49 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 18, 2024 14:17 — with GitHub Actions Inactive
…rsation or CreateInteraction.

Signed-off-by: rithin-pullela-aws <[email protected]>
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 19, 2024 22:07 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 19, 2024 22:07 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval December 20, 2024 20:20 — with GitHub Actions Inactive
Copy link
Collaborator

@mingshl mingshl left a comment

Choose a reason for hiding this comment

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

LGTM!

@dhrubo-os dhrubo-os merged commit 06d39b9 into opensearch-project:main Dec 24, 2024
8 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 24, 2024
* Enchance Message and Memory API Validation and storage

Throw an error when an unknown field is provided in CreateConversation or CreateInteraction.
Skip saving empty fields in interactions and conversations to optimize storage usage.
Modify GET requests for interactions and conversations to return only non-null fields.
Throw an exception if all fields in a create interaction call are empty or null.
Add unit tests to cover the above cases.

Signed-off-by: rithin-pullela-aws <[email protected]>

* Update unit test to check for null instead of empty map

Signed-off-by: rithin-pullela-aws <[email protected]>

* Refactored userstr to Camel Case

Signed-off-by: rithin-pullela-aws <[email protected]>

* Addressing comments

Used assertThrows and added promptTemplate with empty string in test_ToXContent to ensure well rounded testing of expected functionality

Signed-off-by: rithin-pullela-aws <[email protected]>

* Undo: throw an error when an unknown field is provided in CreateConversation or CreateInteraction.

Signed-off-by: rithin-pullela-aws <[email protected]>

---------

Signed-off-by: rithin-pullela-aws <[email protected]>
(cherry picked from commit 06d39b9)
tkykenmt pushed a commit to tkykenmt/ml-commons that referenced this pull request Dec 25, 2024
…ject#3283)

* Enchance Message and Memory API Validation and storage

Throw an error when an unknown field is provided in CreateConversation or CreateInteraction.
Skip saving empty fields in interactions and conversations to optimize storage usage.
Modify GET requests for interactions and conversations to return only non-null fields.
Throw an exception if all fields in a create interaction call are empty or null.
Add unit tests to cover the above cases.

Signed-off-by: rithin-pullela-aws <[email protected]>

* Update unit test to check for null instead of empty map

Signed-off-by: rithin-pullela-aws <[email protected]>

* Refactored userstr to Camel Case

Signed-off-by: rithin-pullela-aws <[email protected]>

* Addressing comments

Used assertThrows and added promptTemplate with empty string in test_ToXContent to ensure well rounded testing of expected functionality

Signed-off-by: rithin-pullela-aws <[email protected]>

* Undo: throw an error when an unknown field is provided in CreateConversation or CreateInteraction.

Signed-off-by: rithin-pullela-aws <[email protected]>

---------

Signed-off-by: rithin-pullela-aws <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Add more validation checks for message API
4 participants