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

Add functional test for dashboard assistant trace page #1012

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

Hailong-am
Copy link
Collaborator

@Hailong-am Hailong-am commented Jan 26, 2024

Description

  1. Add functional test for chat assistant trace page
  2. Add tool invocation into mock LLM server
chatbot_interaction_trace_spec.js.mp4

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --signoff

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.

@Hailong-am Hailong-am changed the title Add functional test for trace page Add functional test for dashboard assistant trace page Jan 26, 2024
Signed-off-by: Hailong Cui <[email protected]>
@@ -27,7 +29,11 @@ const server = http.createServer((req, res) => {
// Why add a delay here? reference: https://github.com/opensearch-project/ml-commons/issues/1894
setTimeout(() => {
if (requestBody.includes(MATCH_AGENT_FRAMEWORK_PROMPT)) {
return res.end(JSON.stringify(agentFrameworkJson));
if (requestBody.includes(TOOL_RESPONSE)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this TOOL RESPONSE request from the ml-commons side? Since we are adding a specific response for agentFrameworkThoughtJson, could we just add a condition just like below. Preferring add else if(requestBody.includes(MATCH_THOUGHT_PROMPT))) {.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, TOOL RESPONSE comes from ml-common side and it's part of prompt when we have tool involved.

The first LLM call prompt is MATCH_AGENT_FRAMEWORK_PROMPT...., when some tool been involved, prompt becomes MATCH_AGENT_FRAMEWORK_PROMPT.... TOOL_RESPONSE:...., i am not quite follow your comments here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got your point, Let's keep current implementation

Signed-off-by: Hailong Cui <[email protected]>
@Hailong-am Hailong-am merged commit 32cba83 into opensearch-project:main Jan 30, 2024
38 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1012-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 32cba8323cc07910b2e9c7babc8dc3b424adc684
# Push it to GitHub
git push --set-upstream origin backport/backport-1012-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1012-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1012-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 32cba8323cc07910b2e9c7babc8dc3b424adc684
# Push it to GitHub
git push --set-upstream origin backport/backport-1012-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1012-to-2.x.

Hailong-am added a commit to Hailong-am/opensearch-dashboards-functional-test that referenced this pull request Jan 30, 2024
…oject#1012)

* Add functional test for trace page

Signed-off-by: Hailong Cui <[email protected]>

* update to ask question direclty instead of click

Signed-off-by: Hailong Cui <[email protected]>

* replace focus with click

Signed-off-by: Hailong Cui <[email protected]>

* add wait before input

Signed-off-by: Hailong Cui <[email protected]>

* address review comments

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit 32cba83)
Hailong-am added a commit that referenced this pull request Jan 30, 2024
* Add functional test for trace page

Signed-off-by: Hailong Cui <[email protected]>

* update to ask question direclty instead of click

Signed-off-by: Hailong Cui <[email protected]>

* replace focus with click

Signed-off-by: Hailong Cui <[email protected]>

* add wait before input

Signed-off-by: Hailong Cui <[email protected]>

* address review comments

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit 32cba83)
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.

4 participants