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: integrate regenerate API #58

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Dec 11, 2023

Description

Change the implementation of regenerate from langchain to Agent framework.
Backend API reference: opensearch-project/ml-commons#1709

Before regenerate:
image

Regenrating:
image

After regenerate:
image

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.

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c70bcfc) 48.75% compared to head (ccc75b2) 58.67%.
Report is 3 commits behind head on feature/agent-framework.

Additional details and impacted files
@@                     Coverage Diff                     @@
##           feature/agent-framework      #58      +/-   ##
===========================================================
+ Coverage                    48.75%   58.67%   +9.91%     
===========================================================
  Files                           46       46              
  Lines                         1087     1089       +2     
  Branches                       250      252       +2     
===========================================================
+ Hits                           530      639     +109     
+ Misses                         548      441     -107     
  Partials                         9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/**
* Retrieve latest interactions from memory
*/
const sessionId = sessionIdInRequestBody;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we rename sessionIdInRequestBody to sessionId?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, done for that.

Signed-off-by: SuZhou-Joe <[email protected]>
question?: string;
verbose?: boolean;
memory_id?: string;
} = {
Copy link
Member

Choose a reason for hiding this comment

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

What about define an interface AgentRunPayload and then reuse it on L19, L85, L106 so we don't need to define inline types repeatedly.

interface AgentRunPayload {
    question?: string;
    verbose?: boolean;
    memory_id?: string;
    regenerate_interaction_id?: string;
  }

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, will do that.

Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit 11e5779 into opensearch-project:feature/agent-framework Dec 12, 2023
10 checks passed
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.

3 participants