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(ai-help): release 2.0 #10155

Merged
merged 244 commits into from
Dec 14, 2023
Merged

feat(ai-help): release 2.0 #10155

merged 244 commits into from
Dec 14, 2023

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Dec 11, 2023

Summary

Frontend changes for AI Help 2.0, see also: mdn/rumba#373.

Notable changes:

  • New feature: History.
  • New feature: Message tree.
  • New feature: Playground integration.
  • Improvement: Enhanced context.
  • Improvement: New refined prompt.
  • Improvement: Upgrade from GPT-3.5 to GPT-4.

Screenshots

Before

image

After

image


How did you test this change?

Unfortunately, it does not work as expected.
@caugner caugner changed the title feat(ai-help): release v2 feat(ai-help): release 2.0 Dec 13, 2023
@caugner caugner marked this pull request as ready for review December 13, 2023 18:04
@caugner caugner requested review from mdn-bot and a team as code owners December 13, 2023 18:04
@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label Dec 13, 2023
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Comment on lines +30 to +36
if (isServer) {
return;
}

if (!doc) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
if (isServer) {
return;
}
if (!doc) {
return;
}
if (isServer || !doc) {
return;
}

}
document
.querySelectorAll(
"section > *:not(#syntax) ~ * .example-header:not(.play-sample)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs an explanation. Why do we exclude #syntax? And what about the same section in other languages?

client/src/playground/queue/index.scss Outdated Show resolved Hide resolved
client/src/plus/ai-help/history.tsx Outdated Show resolved Hide resolved
}: HistoryProps) {
const gleanClick = useGleanClick();
const { data, mutate } = useSWR(
`/api/v1/plus/ai/help/history/list`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, this would have been:

Suggested change
`/api/v1/plus/ai/help/history/list`,
`/api/v1/plus/ai/help/history`,

function messageReducer(state: Message[], messageAction: MessageAction) {
let newState = [...state];
const { type } = messageAction;
export interface MessageTreeNode {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extract these to a separate module.


static setMessages(messages: Message[]) {
this.mutate({ messages });
class AiHelpHistory {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move to history module.

client/src/plus/common/api.tsx Outdated Show resolved Hide resolved
client/src/plus/common/api.tsx Outdated Show resolved Hide resolved
scripts/ai-help-macros.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label Dec 13, 2023
caugner added a commit to mdn/rumba that referenced this pull request Dec 14, 2023
Backend changes for AI Help 2.0, see also: mdn/yari#10155

Notable changes:

- New feature: History.
- New feature: Message tree.
- New feature: Playground integration.
- Improvement: Enhanced context.
- Improvement: New refined prompt.
- Improvement: Upgrade from GPT-3.5 to GPT-4.

Co-authored-by: Leo McArdle <lmcardle@mozilla.com>
Co-authored-by: Claas Augner <caugner@mozilla.com>
@caugner caugner merged commit 427b2fc into main Dec 14, 2023
16 checks passed
@caugner caugner deleted the experiments branch December 14, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog cloud-function copy Copy changes to hard-coded texts on the site github-actions macros tracking issues related to kumascript macros metrics plus:ai-help plus:playground plus work around features related to MDN Plus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants