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
[Run] ChatGPT Plugin for PowerToys Run #25411
Conversation
@microsoft-github-policy-service agree |
This comment has been minimized.
This comment has been minimized.
Two thoughts on this:
|
Thank you!
This is already in, I forgot to mention it, I'll edit the post now
Definitely needed! Thanks again 👍 |
EDIT -- shortened this comment and moved most of comment to #25436 (comment) Details
|
@Simizfo @jaimecbernardo I suggest to discuss implementation via email and to create a new issue. |
Alright, will do! (Edit: done! #25436)
I honestly have no idea on how to make that work, would appreciate some directions 👀 |
I can do the implementation then. I am working on writing my ideas down to communicate them and I should have them ready on weekend. Then main point would be that the admin can define a table based on the plugin GUIDs and set the enabled state for each GUID. The evaluation of the policy value(s) will happen in the |
Just an FYI, the news site TechRadar made a post about this plugin. It might be wise to lock this to collaborators only... EDIT: Also, cool plugin! Can't wait to see it implemented! |
I got here from a Tom's Hardware post. https://www.tomshardware.com/news/microsoft-approves-chatgpt-plugin-for-venerable-powertoys-app |
The title is kinda misleading. OpenAI's API interface is different from ChatGPT. For example, I can have a subscription to ChatGPT plus, but I cannot use the API's without paying per token. For the sake of clarity and for future plugins (perhaps a plugin for actual chatGPT, where people can login with their account instead of setting the API key), would it be better to rename the plugin? |
|
||
public string GetChatGPTAnswer(string query) | ||
{ | ||
JsonObject data = new JsonObject |
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.
Should this be a strongly-typed model instead of managing JSON objects? Seems like the right way (even for debugging purposes) would be to have an actual pre-defined object here?
{ | ||
if (response.IsSuccessStatusCode) | ||
{ | ||
JsonDocument doc = JsonDocument.Parse(response.Content.ReadAsStringAsync().Result); |
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.
Same comment as above - should this be deserialized into a managed object rather than create structure readers this way?
Result emptyResult = new() | ||
{ | ||
Title = "Write your query to chatGPT", | ||
SubTitle = "Don't forget to end your query with \"?\"", |
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.
Ending the query with a question mark seems like an artificial constraint that is being put on the user when it could be addressed programmatically?
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.
What would you propose? This has been made to avoid spamming the API, since it has a cost. Also you can get rate limited, and we don't want that
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.
Feels like there needs to be a better way to signal "I am done typing." You could use a timer (if no typing for N seconds, send query), or you require user input (e.g. press ENTER). Otherwise, you're also bound to run into issues where someone used the question mark in the middle of the sentence without the query, say "what does ? mean in C#."
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 agree with the what does ? mean in C#.
scenario, but not fully agree with the timer one.
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.
The implementation details are left as an exercise to the PR author 😀 At the end of the day if you do not have an existing event pipeline or a terminator key press, you need to know that a user stopped typing, which can, and generally is determined with the use of a timer behind the scenes.
Alternatively, you could even go as far as use Task.Delay
when typing is performed in the box that resets a flag as needed. But that would rely on you having an event pipeline to hook into.
} | ||
else | ||
{ | ||
responseContent = $"Failed: {response.StatusCode} - {response.Content.ReadAsStringAsync().Result}"; |
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.
Is there ever a possibility of the content being null?
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.
Will have to check. This is v0 code, belongs to the first hacked-up version I made in the first night.
|
||
if (settings != null && settings.AdditionalOptions != null) | ||
{ | ||
personalAPIKey = ((PluginAdditionalStringOption)settings.AdditionalOptions.FirstOrDefault(x => x.Key == PersonalAPIKey))?.Value ?? string.Empty; |
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.
You can just return this value instead of storing it in a variable that is not used anywhere else but this function.
I'll second the proposal to rename this. While this plugin is constrained to ChatGPT, the underlying model can be easily selected through the REST API and can be extended in the future. |
Makes sense. Might be useful if someday Microsoft opens some kind of "Bing Chat API" and we want to implement it. |
How is "Ask" for this plugin name? Pretty simple, and fits the theme By the way, status update: I'm currently working on the ability to change the result shape to better fit the AI response. Will have more to share soon |
I prefer "Ask ChatGPT"
Here you can talk with @niels9001. He made some UI concepts in the past. |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view or the 📜action log for details. Unrecognized words (2)gpt Previously acknowledged words that are now absentGPT :arrow_right:To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands... in a clone of the git@github.com:Simizfo/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/4865322998/attempts/1' Available 📚 dictionaries could cover words not in the 📘 dictionaryThis includes both expected items (2280) from .github/actions/spell-check/expect.txt and unrecognized words (2)
Consider adding them using (in with:
extra_dictionaries:
cspell:cpp/src/cpp.txt
cspell:win32/src/win32.txt
cspell:python/src/python/python-lib.txt
cspell:php/php.txt
cspell:node/node.txt
cspell:typescript/typescript.txt
cspell:python/src/python/python.txt
cspell:java/java.txt
cspell:aws/aws.txt
cspell:r/src/r.txt To stop checking additional dictionaries, add: with:
check_extra_dictionaries: '' If the flagged items are 🤯 false positivesIf items relate to a ...
|
Is there a copy action on pressing enter? |
This is a good idea! |
It should be the result action that gets executed when clicking the result/pressing ENTER. |
gpt-3.5-turbo and 4.0 don't provide sources.
thanks! |
Question: Should I keep working on this with the recent announcement at Build 2023 of Windows Copilot? Looks like it covers the features of this plugin and even more 🤔 |
Does it cover ChatGPT itself or just Windows' AI? While I am a big supporter or Microsoft, my preference at the moment is still ChatGPT for LLMs. According to ChatGPT + browsing plugin, when asked the difference between ChatGPT and Bing AI, here's the response: Maybe someone from Microsoft could chime in? My vote is to continue working on it. 😊 Thank you |
My understanding is Windows Copilot will only be on Windows 11 and hence this plugin will be useful for those still running Windows 10 (with PowerToys). |
I think this should use Bing Chat instead of our own API key |
Nice this what I was looking for can you add support for Bing chat? check my post #24445 Description of the new feature / enhancementHi, Scenario when this would be used?This feature would be useful for getting fast and accurate answers to specific questions without interrupting the workflow. Supporting informationBing Desktop Search bar: https://www.neowin.net/news/following-windows-11-microsoft-pushes-bing-desktop-search-bar-to-windows-10-via-edge/ |
The hotkey is Windows+C (make sure you have Windows Copilot - you need to
be on Insider Beta)
bigplayer-ai ***@***.***> escreveu no dia sexta, 7/07/2023
à(s) 11:52:
… Nice this what I was looking for can you add support for Bing chat? check
my post #24445 <#24445>
Description of the new feature / enhancement
Hi,
I would like to have a convenient way to access Bing chat from any screen
on my computer.
Bing chat is already integrated in the taskbar in the new Windows version,
but I think it would be even better to have a hotkey that chat with it.
Scenario when this would be used?
This feature would be useful for getting fast and accurate answers to
specific questions without interrupting the workflow.
For example, I could use Bing chat as a spotlight search on MacOS, so I
can ask Bing chat questions and continue working. This would make the Bing
chat experience more seamless.
When I press a hotkey, the chat pops up in a floating window and when I
press that hotkey again, the chat hides away.
This would be an improved version of the Bing Desktop Search bar
<https://www.neowin.net/news/following-windows-11-microsoft-pushes-bing-desktop-search-bar-to-windows-10-via-edge/>
that was available for Windows 10 users via Edge.
Supporting information
Bing Desktop Search bar:
<https://www.neowin.net/news/following-windows-11-microsoft-pushes-bing-desktop-search-bar-to-windows-10-via-edge/>
https://www.neowin.net/news/following-windows-11-microsoft-pushes-bing-desktop-search-bar-to-windows-10-via-edge/
—
Reply to this email directly, view it on GitHub
<#25411 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ3M5XXZJQOSNRVN5ULB7IDXO7S73ANCNFSM6AAAAAAW2Y4OJI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I am really looking for this plugin to go live. I think perplexity.ai is also a good option to integrate as it scraps live data from internet. @Simizfo really looking to test this plugin. |
I have moved away from this since Microsoft has announced Windows Copilot and there was really small request for my plugin. If someone wants to have it, a fully-working prototype is available on my fork of PowerToys on my GitHub. I'm closing this, thanks Clint for the great opportunity! |
Can you please release your fork as .exe file? I don't have Visual Studio installed currently and thus can't manually build your fork :/ |
Can't, sorry 😢 all the builds I made have my own OpenAI API key, so I can't share it. |
What about releasing a public version on your GH account that supports storing the key in a string setting (supported on 0.75.0 and higher). |
Would be great to see this added in as an alternative and probably more simple version of what I imagine microsoft will implent! |
Old images (for history/collection sake)
Summary of the Pull Request
Hi there again! This is Simone, a few weeks ago I tweeted about a small prototype plugin I wrote in just 2 hours to have ChatGPT integrated into PowerToys Run.
Clint sent me a PM later that day and we had an amazing talk about making this real and public as a Community Plugin, so here I am!
PR Checklist
Detailed Description of the Pull Request / Additional comments
Here's how the Plugin currently works and what still needs to be decided
✅ Working
⚒️ What needs to be done
Validation Steps Performed
None yet
Suggestions 💡
I'm totally open to suggestions, this is another reason why I'm opening this PR as a Draft, besides the Plugin not being ready.