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

gmc: include ui as part of pipeline #435

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

Ruoyu-y
Copy link
Collaborator

@Ruoyu-y Ruoyu-y commented Sep 18, 2024

Description

  • add ui handler in GMC router logic
  • add sample config file for chatqna with conversation ui

Issues

n/a.

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)

Dependencies

List the newly introduced 3rd party dependency if exists.

Tests

Describe the tests that you ran to verify your changes.

@Ruoyu-y Ruoyu-y marked this pull request as draft September 18, 2024 05:19
@Ruoyu-y
Copy link
Collaborator Author

Ruoyu-y commented Sep 18, 2024

@irisdingbj @zhlsunshine I create a draft PR to include UI as part of the GMC pipeline. Current logic is based on what i discussed with @zhlsunshine before, please help with comments and review.

Simple description:
Accessing UI with the uri "/ui"
The ui will also use the "/ui" to talk to the backend service. The handler logic will format the payload sent from the UI into the format that suits our first hop (either embedding or llm)

Copy link
Collaborator

@zhlsunshine zhlsunshine left a comment

Choose a reason for hiding this comment

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

Hi @Ruoyu-y, thanks for your PR to add this feature to GMC, BTW, do you want to add the e2e test for the new example?


// accessing UI result in access to assets under /assets uri
// create a handler to redirect that request to ui endpoint
func mcAssetHandler(w http.ResponseWriter, req *http.Request) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Ruoyu-y I suggest that we should handle the situation if the UI step does not exists, then the user can know what happen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Let me add that.

@@ -45,6 +47,7 @@ const (
ServiceNode = "node"
DataPrep = "DataPrep"
Parameters = "parameters"
UI = "UI"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Ruoyu-y, I think this UI component is not the GMC UI, it's just for ChatQnA example, if so, how to re-name it to ChatQnAUI ?

Copy link
Collaborator Author

@Ruoyu-y Ruoyu-y Sep 19, 2024

Choose a reason for hiding this comment

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

Hi @Ruoyu-y, I think this UI component is not the GMC UI, it's just for ChatQnA example, if so, how to re-name it to ChatQnAUI ?

This UI does not ONLY handle the case for ChatQnA, i also tried it with CodeGen. It can work too. From function perspective, i would think this is a UI config or handling logic for application serving. And i understand that the GMC UI you mentioned is for pipeline composition purpose, correct?

@@ -71,6 +71,7 @@ const (
SpeechT5Gaudi = "SpeechT5Gaudi"
Whisper = "Whisper"
WhisperGaudi = "WhisperGaudi"
UI = "UI"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Ruoyu-y, the same comment as above.

// set the corresponding keyword for input data
var key string
switch nextHop.StepName {
case "Embedding":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Ruoyu-y, I think there should be only 2 cases: request from the mega service and directly to embedding service. Am I right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me expain, since GMC wants to pass through the payload directly to the pipeline. The format of the payload must fit the requirement of the pipeline's first component. I found that in the examples, the first hop of the pipeline is either embedding or llm. So here, i am trying to find the first hop of the pipeline and use the corresponding keyword to format the payload.
I am not sure why there would be request from the mega service in the GMC case, can you explain?

@Ruoyu-y Ruoyu-y force-pushed the ui_in_pipeline branch 4 times, most recently from e8b9139 to d748bd4 Compare September 19, 2024 07:53
@irisdingbj
Copy link
Collaborator

@Ruoyu-y please rebase and it can be merged

* add ui handler in GMC router logic
* add sample config file for chatqna with conversation ui

Signed-off-by: Ruoyu Ying <[email protected]>
@irisdingbj
Copy link
Collaborator

@Ruoyu-y can you remove draft and then we can get this PR in?

@Ruoyu-y Ruoyu-y marked this pull request as ready for review October 22, 2024 08:44
@irisdingbj irisdingbj merged commit 2e06fda into opea-project:main Nov 18, 2024
18 checks passed
chensuyue pushed a commit that referenced this pull request Nov 21, 2024
* add ui handler in GMC router logic
* add sample config file for chatqna with conversation ui

Signed-off-by: Ruoyu Ying <[email protected]>
Co-authored-by: Iris <[email protected]>
(cherry picked from commit 2e06fda)
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