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

executor/ai: implement cluster scan prompting #35

Merged
merged 1 commit into from
May 28, 2024
Merged

executor/ai: implement cluster scan prompting #35

merged 1 commit into from
May 28, 2024

Conversation

vaijab
Copy link
Contributor

@vaijab vaijab commented May 28, 2024

Description

This is part of https://github.com/kubeshop/botkube-cloud/issues/1062. The cluster scan prompt will need more tuning for sure, but I don't want to spend much more time on that. I have already been trying so many variations of the prompt. It would be great for someone else to play with it and give us suggestions how to improve it. Or maybe we go ahead and get early feedback from users and iterate?

As you can see the implementation is actually very simple, which is nice. We can always make it mode complicated - that's easy.

Changes proposed in this pull request:

  • executor/ai: implement cluster scan prompting

Related issue(s)

@vaijab vaijab requested review from a team and pkosiec May 28, 2024 06:43
Copy link
Collaborator

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

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

Overall I think it looks good to me!
Before merge:

  • please address the comments
  • share the screenhosts with Blair and Miklos to make sure this is the expected behavior they'd like to see.

@@ -77,7 +77,7 @@ func (e *AIFace) Execute(_ context.Context, in executor.ExecuteInput) (executor.
aiBrainWebhookURL := fmt.Sprintf("%s/%s", in.Context.IncomingWebhook.BaseSourceURL, cfg.AIBrainSourceName)

body, err := json.Marshal(aibrain.Payload{
Prompt: strings.TrimPrefix(in.Command, pluginName),
Prompt: strings.TrimPrefix(in.Command, pluginName+" "),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest doing something like

Suggested change
Prompt: strings.TrimPrefix(in.Command, pluginName+" "),
Prompt: strings.TrimSpace(strings.TrimPrefix(in.Command, pluginName)),

To ensure the scan command detection works also when user puts 2-3 spaces etc.

image

@@ -111,6 +145,10 @@ func (i *assistant) handle(ctx context.Context, in source.ExternalRequestInput)
return api.NewPlaintextMessage("Please clarify your question.", false), nil
}

if strings.ToLower(p.Prompt) == "scan" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move it to const

internal/source/ai-brain/assistant.go Show resolved Hide resolved
@vaijab vaijab merged commit e34fe7f into main May 28, 2024
4 checks passed
@vaijab vaijab deleted the clusterscan branch May 28, 2024 12:13
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.

2 participants