-
Notifications
You must be signed in to change notification settings - Fork 26
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
Expose a general function for agent execution #268
Expose a general function for agent execution #268
Conversation
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
server/services/assistant_client.ts
Outdated
agentName: string, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
parameters: Record<string, any> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to support executeAgent with agent id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also considered this, but we don't have use case at the moment which requires to execute agent with id directly, so I decided to not add it for now, we can add it when it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Knowledge base needs to execute by agent id directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qianheng-aws may have a requirement to execute agent id directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, let me add that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hailong-am @qianheng-aws Updated, could you take another look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Yulong Ruan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we allow other plugins to overwrite assistantClient and provide their own customized functionalities?
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Could you provide a use case or example? |
Signed-off-by: gaobinlong <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
constructor(private http: HttpSetup) {} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
executeAgent = (agentId: string, parameters: Record<string, any>, options?: Options) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will there be chance that executeAgent and executeAgentByName combined to be one API? Seems the only difference is that they pass different parameters in the query
field
Otherwise, we need to add active method in both these 2 functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the APIs of public(UI), they will call the corresponding server APIs, and in server side, they will end up with calling one single function.
The backport to
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-268-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 88aa96b70df878dffccc689811c7ded29a7d490d
# Push it to GitHub
git push --set-upstream origin backport/backport-268-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 |
* feat: add assistant client to public and server Signed-off-by: Yulong Ruan <[email protected]> * tweaks Signed-off-by: Yulong Ruan <[email protected]> * fix path Signed-off-by: Yulong Ruan <[email protected]> * update changelog Signed-off-by: Yulong Ruan <[email protected]> * feat: support both execute agent by name and by id Signed-off-by: Yulong Ruan <[email protected]> * fix(public): support execute agent by name or id Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> Signed-off-by: gaobinlong <[email protected]> Co-authored-by: gaobinlong <[email protected]> (cherry picked from commit 88aa96b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
The backport to
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.17 2.17
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.17
# Create a new branch
git switch --create backport/backport-268-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 88aa96b70df878dffccc689811c7ded29a7d490d
# Push it to GitHub
git push --set-upstream origin backport/backport-268-to-2.17
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.17 Then, create a pull request where the |
The backport to
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.17 2.17
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.17
# Create a new branch
git switch --create backport/backport-268-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 88aa96b70df878dffccc689811c7ded29a7d490d
# Push it to GitHub
git push --set-upstream origin backport/backport-268-to-2.17
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.17 Then, create a pull request where the |
* feat: add assistant client to public and server Signed-off-by: Yulong Ruan <[email protected]> * tweaks Signed-off-by: Yulong Ruan <[email protected]> * fix path Signed-off-by: Yulong Ruan <[email protected]> * update changelog Signed-off-by: Yulong Ruan <[email protected]> * feat: support both execute agent by name and by id Signed-off-by: Yulong Ruan <[email protected]> * fix(public): support execute agent by name or id Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> Signed-off-by: gaobinlong <[email protected]> Co-authored-by: gaobinlong <[email protected]>
* feat: add assistant client to public and server Signed-off-by: Yulong Ruan <[email protected]> * tweaks Signed-off-by: Yulong Ruan <[email protected]> * fix path Signed-off-by: Yulong Ruan <[email protected]> * update changelog Signed-off-by: Yulong Ruan <[email protected]> * feat: support both execute agent by name and by id Signed-off-by: Yulong Ruan <[email protected]> * fix(public): support execute agent by name or id Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> Signed-off-by: gaobinlong <[email protected]> Co-authored-by: gaobinlong <[email protected]> (cherry picked from commit 88aa96b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* feat: add assistant client to public and server * tweaks * fix path * update changelog * feat: support both execute agent by name and by id * fix(public): support execute agent by name or id --------- Signed-off-by: Yulong Ruan <[email protected]> Signed-off-by: gaobinlong <[email protected]> Co-authored-by: gaobinlong <[email protected]>
Description
This PR adds an assistant client to both
public(UI)
andserver
which currently exposes the agent execute APIIssues Resolved
[List any issues this PR will resolve]
Check List
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.