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

Add PR to OpenSauced Highlights button #12

Closed
Tracked by #4
bdougie opened this issue Apr 17, 2023 · 13 comments · Fixed by #64
Closed
Tracked by #4

Add PR to OpenSauced Highlights button #12

bdougie opened this issue Apr 17, 2023 · 13 comments · Fixed by #64

Comments

@bdougie
Copy link
Member

bdougie commented Apr 17, 2023

Similar interaction to the Gif for GitHub extension - Look at the end of the this post for context

Screen Shot 2023-04-17 at 6 51 13 AM

Proposed solution

Add a OpenSauced icon to the GitHub PR markdown editor. Generate copy based on commits and in the case of issue comments, generate a response to the comment.

This would be our first AI exploration @0-vortex, would love your thoughts.

@0-vortex
Copy link

screenshot is not loading 🍕

@0-vortex
Copy link

We could get the full code diff and send that to our API through authenticated request, along with some repo and user information; the api would do all the ai work and return some responses the user could implement in the highlight (or PR) description.

This is a very simplified version, IMHO would split this into PR description generator and highlight generator, depending on which models or LLM prompts are more successful in our internal testing, reading/understanding the code (this would be more useful in letting the extension help write PRs anywhere), or explaining the code (this would be more useful in creating highlights based on PRs anywhere).

Both versions would send very similar requests to the existing create highlights endpoints and we could start mirroring those backend routes with "suggestion" endpoints that take similar (more data tho) input and return a post suggestion for highlights that would then be adjusted or sent to the previously mentioned "addHighlightForUser" api route to create the highlight.

We can also take a hybrid approach to this and do the entire AI part in the chrome extension, taking an API key to run something like GPT4 with code analysis and prompt fine tuning via the extension.

Think we should explore the paths that help users the most 🍕

@diivi
Copy link
Collaborator

diivi commented Apr 24, 2023

We decided today that all AI stuff will be handled by the extension itself, by interacting with 3rd party APIs. How we will do it (what data to send/what fine tuning to do) is what we will have to look into. ( #18 )

@bdougie
Copy link
Member Author

bdougie commented Apr 24, 2023

We can mirror what AI commits is doing. Look through commit messages and identify a description.

https://github.com/Nutlope/aicommits

An alternative is looking at the code changes via the API and summarizing it using OpenAI's code features. Honestly ChatGPT-4 is also possible and does well.

I cover this in my blog series. Let me know if you are able to sign up for OpenAi and test locally. We could create a way for the user to authenticate or provide their own openai token.

@bdougie
Copy link
Member Author

bdougie commented Apr 27, 2023

Group 7

Mock up of where the button will go.

Expectation is that you can add this PR as a highlight, only if you are the author (for now).

@bdougie bdougie assigned diivi and Anush008 and unassigned diivi Apr 28, 2023
@Anush008
Copy link
Member

@bdougie, the flow I have in mind is, upon clicking the button you've mentioned above, a modal will be opened up for the user to enter the highlight title, description and post it. Along with the content length validations etc. Is that okay?

@Anush008
Copy link
Member

The modal styling can be based on the highlight edit modal of https://github.com/open-sauced/insights.

@0-vortex
Copy link

awesome initiative!!! first of all let me link a couple of resources i find essential to our long term ai wellbeing: https://github.com/Denis2054/Transformers-for-NLP-2nd-Edition and https://github.com/DataTalksClub/mlops-zoomcamp are my go-to resources for ai best practices with using huggingface as the github for ai

with these biases in place i believe the best way to approach this particular feature is to do:

  • hybrid data science / product design, figuring out a set of at least 10-20 different repos with github or insights data and what their resulting highlights should be [1]
  • assess usable ai solutions or default to gpt4 user driven api keys for quick development, here the work would be figuring out a way to send the pr data and commits as context to a predefined "one-shot" prompt to produce the highlight [2]

[1] could be later used to train our own models and use for free in browser
[2] can help with this but would need dataset or expectations set from [1]

this is just the "backend" part - a lot of work to get large language models to provide value to end users relies on ui interaction and in-flight prompt engineering, here some key factors I can suggest:

  • enabling prompt transparency, debugging and adjustments to initial prompt, as well as supporting edits like "the highlight is too cold, make it cheerful"
  • enabling prompt reusability for users trying this feature out, like exposing multiple template prompts for generating a highlight, based on user submissions, let users see prompt submissions and vote on them to figure out what we should focus to provide for user requirements
  • enabling reporting bugs with the extension (in general) but in particular the ai features so we can catch pain points and adjust frequently 🍕

@diivi
Copy link
Collaborator

diivi commented Apr 28, 2023

upon clicking the button you've mentioned above, a modal will be opened up for the user to enter the highlight title, description and post it. Along with the content length validations etc. Is that okay?

The basic flow should be that, yes. The brainstorming part of the PR is how AI should be integrated into the modal. We might need to do some research for that, but that might block development, I suggest we can get started with the modal and everything to add a highlight to OpenSauced, research AI integrations on the side, and integrate AI into the modal after we've made a decision.

@bdougie
Copy link
Member Author

bdougie commented Apr 29, 2023

For adding a highlight from the extension we can just send the user to https://highlight.new, no that will need to link to a https://insights.opensauced.pizza/highlights/new page that has not been designed.

All AI considerations would be handled on the insights page and really just be gpt-4 providing a description for the highlight. But that is not need right now.

We can innovate after we add functionality.

No modal, just link to highlight.new

@Anush008
Copy link
Member

Anush008 commented Apr 29, 2023

Hey @bdougie, can we have the redirect link accept the PR URL as a query param, so that the PR link is pre-filled on the https://insights.opensauced.pizza/highlight/new post page?

@github-actions
Copy link

github-actions bot commented May 4, 2023

🎉 This issue has been resolved in version 1.0.0-beta.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants