Skip to content

Commit

Permalink
enhance(ai-help): add model to issue reports (#10925)
Browse files Browse the repository at this point in the history
* enhance(ai-help): add model to issue reports

* fix(ai-help): add "(None)" for answers without source

As `[].join("\n")` is never `null`, this wasn't working so far.
  • Loading branch information
caugner authored Apr 15, 2024
1 parent 26ed0e5 commit 3765a90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/plus/ai-help/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,9 @@ function ReportIssueOnGitHubLink({
currentMessage: Message;
children: React.ReactNode;
}) {
const user = useUserData();
const isSubscriber = useMemo(() => isPlusSubscriber(user), [user]);

const gleanClick = useGleanClick();
const currentMessageIndex = messages.indexOf(currentMessage);
const questions = messages
Expand All @@ -1105,8 +1108,10 @@ function ReportIssueOnGitHubLink({
(source) =>
`- [${source.title}](https://developer.mozilla.org${source.url})`
)
.join("\n") ?? "(None)"
.join("\n") || "(None)"
);
// TODO Persist model in messages and read it from there.
sp.set("model", isSubscriber ? "gpt-4" : "gpt-3.5");
sp.set("template", "ai-help-answer.yml");

url.search = sp.toString();
Expand Down

0 comments on commit 3765a90

Please sign in to comment.