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: Upgrade the experience #33

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
98edba0
Merge pull request #5 from timkmecl/main
mpociot Dec 9, 2022
084dded
[fix] spelling
RumiAllbert Jan 13, 2023
123053f
Merge pull request #35 from RumiAllbert/main
mpociot Jan 13, 2023
ca5a21f
Update README.md
mpociot Feb 21, 2023
4cae697
Update README.md
mpociot Feb 21, 2023
4fe456c
Merge remote-tracking branch 'mpociot/main'
zcf0508 May 27, 2023
d2aedfa
feat: only send request when the prompt is not empty
zcf0508 May 27, 2023
5de9798
feat: only send request when press cmd/ctrl + entry
zcf0508 May 27, 2023
3105375
chore: add `chatgpt` patch
zcf0508 May 27, 2023
a1811d4
bump
zcf0508 May 27, 2023
b4ee637
feat: add `new` button to start a new conversation
zcf0508 May 27, 2023
0b048c7
feat: clear prompt input when starting a new conversation
zcf0508 May 27, 2023
ab6d0fb
feat: add `temperature` and `max_tokens` configuration
zcf0508 May 28, 2023
dc16950
bump
zcf0508 May 28, 2023
f76b667
fix: submit error on mac
zcf0508 May 29, 2023
d3a6b9d
refactor: refactor new btn click function
zcf0508 May 29, 2023
d64b0d5
bump
zcf0508 May 29, 2023
b4a733f
feat: support `gpt-3.5-turbo-0613` and `gpt-4-0613`
zcf0508 Jun 14, 2023
0ced835
feat: more models
zcf0508 Jun 14, 2023
2472492
refactor: support long token
zcf0508 Jun 14, 2023
049a4ad
chore: use `pnpm`
zcf0508 Jun 14, 2023
fda680d
feat: minify the code to reduce the required tokens
zcf0508 Jun 16, 2023
ec3c0cc
feat: support google search by starting with `/s`
zcf0508 Jun 17, 2023
9689048
refactor: use `puppeteer-core` fix launch fail
zcf0508 Jun 17, 2023
0e74a23
refactor: Improve search response and enhance answer accuracy
zcf0508 Jun 18, 2023
a1b7203
chore: update prefix prompt
zcf0508 Jun 25, 2023
e30e657
feat: update GPT model options
zcf0508 Nov 8, 2023
98f1dd8
feat: suport custom model
zcf0508 Apr 23, 2024
b3979e4
refactor: update prompt and maxModelTokens
zcf0508 Apr 23, 2024
9a35d5c
feat: support setting respose language
zcf0508 Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=true
shamefully-hoist=true
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ vsc-extension-quickstart.md
**/.eslintrc.json
**/*.map
**/*.ts

examples
pnpm-lock.yaml
patches
prepare-package.js
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ If you enjoy this extension, please consider [buying me a coffee ☕️](https:/
- This wouldn't be possible without OpenAI's [ChatGPT](https://chat.openai.com/chat)
- The extension makes use of [chatgpt-api](https://github.com/transitive-bullshit/chatgpt-api) (by [Travis Fischer](https://github.com/transitive-bullshit)), which uses unofficial ChatGPT API in order to login and communicate with it.
- The project was started by [mpociot](https://github.com/mpociot/)
- `v0.3` inspired by [barnesoir/chatgpt-vscode-plugin](https://github.com/barnesoir/chatgpt-vscode-plugin) and [gencay/vscode-chatgpt](https://github.com/gencay/vscode-chatgpt)
- `v0.3` inspired by [barnesoir/chatgpt-vscode-plugin](https://github.com/barnesoir/chatgpt-vscode-plugin) and [gencay/vscode-chatgpt](https://github.com/gencay/vscode-chatgpt)
17 changes: 15 additions & 2 deletions media/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,26 @@
}

// Listen for keyup events on the prompt input element
document.getElementById('prompt-input').addEventListener('keyup', function (e) {
document.getElementById('prompt-input').addEventListener('keydown', function (e) {
// If the key that was pressed was the Enter key
if (e.keyCode === 13) {
const ctrlKeyDown = event.ctrlKey || event.metaKey;
if (
ctrlKeyDown
&& e.key === 'Enter'
&& this.value
&& this.value.trim().length >= 0
) {
vscode.postMessage({
type: 'prompt',
value: this.value
});
}
});

// start a new conversation
document.getElementById('new_btn').addEventListener('click', function (e) {
vscode.postMessage({
type: 'clear',
});
});
})();
Loading