-
Notifications
You must be signed in to change notification settings - Fork 8
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/ai/explain #754
base: main
Are you sure you want to change the base?
Feat/ai/explain #754
Conversation
…essful response from the localhost via portforwarding
return nil, errors.New("failed to parse diff") | ||
} | ||
|
||
explanation, err := cmd.codeScanner.GetAIExplanation(ctx, derivation, ruleKey, ruleMessage, diff) |
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 will go somewhere else - most likely in a new subcomponent (SnykLLMBindings
)
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 file would basically become DeepCodeLLMBindings
return ExplainResponse{}, err | ||
} | ||
|
||
url := "http://localhost:10000/explain" |
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 guess this should be injected from configuration
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.
shouldn't this be the same API endpoint that we have from the config.Endpoint?
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.
move to DeepCodeLLMBinding
type ExplainOptions struct { | ||
derivation string | ||
ruleKey string | ||
ruleMessage string | ||
diff string | ||
} | ||
|
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 would also be separated out into the DeepCodeLLMBindings
|
||
GetAIExplanation(ctx context.Context, options ExplainOptions) ( | ||
explanation string, | ||
status string, | ||
err error, | ||
) |
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.
and this, too
@@ -237,6 +237,19 @@ <h2 class="example-fixes-header">Fixed Code Examples</h2> | |||
<!-- AI Fix --> | |||
<div id="ai-fix-wrapper" class="{{if not .HasAIFix}}hidden{{end}}"> | |||
<!-- AI fix buttons --> | |||
<section id="explain-wrapper" class="ai-explain"> | |||
<h2 class="ai-fix-header"> | |||
DeepCode AI Explanations |
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 should become a variable, so we could potentially support ANY LLMBinding for explanations
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.
Maybe, we should even provide a separate LLM explain panel for the explanation @andygongea
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.
These types should be generalized, to support different LLMBindings
Description
Provide description of this PR and changes, if linked Jira ticket doesn't cover it in full.
Checklist