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: use two agents for text2viz #313

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Sep 18, 2024

Description

Agent 1: rule-based if user didn't provide any instructions
Agent 2: no rules will be applied, only use user's instructions

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test.
  • New functionality has user manual doc added.
  • 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.

Agent 1: rule-based if user didn't provide any instructions
Agent 2: no rules will be applied, only use user's instructions

Signed-off-by: Yulong Ruan <[email protected]>
Comment on lines 117 to 122
const res = await assistantService.client.agentConfigExists(
TEXT2VEGA_RULE_BASED_AGENT_CONFIG_ID,
{
dataSourceId: key !== 'DEFAULT' ? key : undefined,
}
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure whether the logic should be both TEXT2VEGA_RULE_BASED_AGENT_CONFIG_ID and TEXT2VEGA_AGENT_CONFIG_ID are not configured then disable the index pattern?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question, I think both should be configured, or the index pattern should be disabled.
If there is only one configured, it's still problematic, for example, only TEXT2VEGA_RULE_BASED_AGENT_CONFIG_ID is configured, but user's input contains instructions, it will use instruction based agent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree, let's do the check for both.

Copy link
Member Author

@ruanyl ruanyl Sep 20, 2024

Choose a reason for hiding this comment

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

@Hailong-am Updated, the new implementation will check all 3 required agents includes text to ppl, please help to take another look, thanks!

@xluo-aws xluo-aws merged commit 4a3fc51 into opensearch-project:main Sep 20, 2024
9 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-assistant/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.x
# Create a new branch
git switch --create backport/backport-313-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4a3fc51ae2ec64a86be3b03b6b9868e408988b88
# Push it to GitHub
git push --set-upstream origin backport/backport-313-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.x

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

@ruanyl ruanyl added backport 2.x Trigger the backport flow to 2.x and removed backport 2.x Trigger the backport flow to 2.x labels Sep 20, 2024
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-assistant/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.x
# Create a new branch
git switch --create backport/backport-313-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4a3fc51ae2ec64a86be3b03b6b9868e408988b88
# Push it to GitHub
git push --set-upstream origin backport/backport-313-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.x

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

@ruanyl
Copy link
Member Author

ruanyl commented Sep 20, 2024

@xluo-aws when merge the PRs, we normally use "Squash and merge" strategy which will create a linear commit history.

ruanyl pushed a commit to ruanyl/dashboards-assistant that referenced this pull request Sep 20, 2024
…or-t2viz

feat: use two agents for text2viz
(cherry picked from commit 4a3fc51)
ruanyl pushed a commit to ruanyl/dashboards-assistant that referenced this pull request Sep 20, 2024
…or-t2viz

feat: use two agents for text2viz
(cherry picked from commit 4a3fc51)
Signed-off-by: Yulong Ruan <[email protected]>
ruanyl added a commit that referenced this pull request Sep 20, 2024
feat: use two agents for text2viz
(cherry picked from commit 4a3fc51)

Signed-off-by: Yulong Ruan <[email protected]>
Co-authored-by: Xuesong Luo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Trigger the backport flow to 2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants