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

OpenAI Prompt History #780

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

OpenAI Prompt History #780

wants to merge 9 commits into from

Conversation

alyssabull
Copy link
Contributor

This PR builds on the LLM integrations that were completed in #577 and #757 by adding a toggle in the OpenAI Editor that allows a user to view their previously generated prompts. The prompts are stored utilizing localStorage and can be easily reused by clicking on the Use this prompt button or deleted by clicking on the trash can icon. A warning will show if there are no prompts saved and give instructions on how prompts can be saved.

Screenshot 2024-02-07 at 10 29 22 PM Screenshot 2024-02-07 at 10 27 21 PM

Testing still needs to be added but feedback on the UI/UX is welcome while those are being added.

Closes #583

Copy link

github-actions bot commented Feb 8, 2024

Use the following command to run this PR with Docker at http://localhost:3000:

docker run --rm -p 3000:3000 grafana/plugin-builds:e501b740724cb6775d448fe383308a525e74fa2fpre

adamyeats
adamyeats previously approved these changes Feb 8, 2024
Copy link
Contributor

@adamyeats adamyeats left a comment

Choose a reason for hiding this comment

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

Aside from some minor nits, LGTM! Nice work! 👍

src/components/QueryEditor/OpenAIEditor.tsx Outdated Show resolved Hide resolved
src/components/QueryEditor/OpenAIEditor.tsx Outdated Show resolved Hide resolved
src/components/QueryEditor/PromptHistory.tsx Outdated Show resolved Hide resolved
alyssabull and others added 4 commits February 8, 2024 08:00
Co-authored-by: Adam Yeats <16296989+adamyeats@users.noreply.github.com>
Co-authored-by: Adam Yeats <16296989+adamyeats@users.noreply.github.com>
Co-authored-by: Adam Yeats <16296989+adamyeats@users.noreply.github.com>
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', justifyContent: 'flex-start', margin: '0 10px 0 5px'}}>
<Tooltip
content={'View past generated prompts that are stored on your local browser.'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
content={'View past generated prompts that are stored on your local browser.'}
content={'View previously generated prompts.'}

variant="secondary"
size="sm"
>
Use this prompt
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Use this prompt
Use prompt

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Excellent work @alyssabull! Once this has some tests it'll be ready for merging 😊

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

Successfully merging this pull request may close these issues.

Store previous OpenAI prompts and allow a user to re-run them
4 participants