Skip to content

Commit ba80e85

Browse files
committed
Update v1.1.0 - Check Updates section of readme for more
1 parent 7f37731 commit ba80e85

File tree

5 files changed

+60
-19
lines changed

5 files changed

+60
-19
lines changed

‎dist/main.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "acode.plugin.chatgpt",
33
"name": "Chat GPT",
44
"main": "dist/main.js",
5-
"version": "1.0.9",
5+
"version": "1.1.0",
66
"readme": "readme.md",
77
"icon": "icon.png",
88
"files": [

‎readme.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ Chat GPT
66
> **⚠️ Important note**
77
If you face any issue or error or you want to report bugs, Please report these things in github repo of this plugin with a detailed description. Hope you understand ❤️❤️
88

9-
**Chat GPT** is an advanced artificial intelligence developed by [OpenAi](https://openai.com/) and we have added it in form of plugin for **Acode**, developed to enhance your productivity while coding. With this plugin, you can communicate with an AI-powered virtual assistant that can remember your previous responses, provide contextual suggestions, and offer helpful solutions to your coding problems.
9+
**Chat GPT** is an advanced artificial intelligence developed by [OpenAi](https://openai.com/) and we have added it in form of plugin for **Acode**, developed to enhance your productivity while coding. With this plugin, you can communicate with an AI-powered virtual assistant that can remember your previous responses, provide contextual suggestions, and offer helpful solutions to your coding problems. You can also ask Acode related doubt and problems.
1010

1111
<details>
1212
<summary>Updates 🤩🤩</summary>
13+
<details>
14+
<summary>
15+
<code><strong>v1.1.0</strong></code>
16+
</summary>
17+
<ul>
18+
<li>Improved chatting experience</li>
19+
<li>internal improvement and added a shortcut to open chatgpt - <kbd>Ctrl-Shift-C</kbd></li>
20+
<li>Now you can also ask doubt related to Acode to Chatgpt</li>
21+
</ul>
22+
</details>
1323
<details>
1424
<summary>
1525
<code><strong>v1.0.9</strong></code>
@@ -123,6 +133,7 @@ Features
123133
- View Chat History
124134
- Syntax highlighting and markdown styling, etc
125135
- Generate images with your prompts
136+
- Can answer to doubt related to Acode
126137

127138
### Important Links
128139
- [Github Issue Page](https://github.com/bajrangCoder/acode-plugin-chatgpt/issues)
@@ -131,7 +142,7 @@ Features
131142
- [Acode](https://acode.foxdebug.com)
132143

133144
## How to use:
134-
To use Chat GPT, simply search for `"Chat GPT"` in the **command palette (•••)** to open the chat interface. From there, you can communicate with the AI and receive helpful suggestions and solutions.
145+
To use Chat GPT, simply search for `"Chat GPT"` in the **command palette (•••)** to open the chat interface or use this shortcut <kbd>Ctrl-Shift-C</kbd>. From there, you can communicate with the AI and receive helpful suggestions and solutions.
135146

136147
To update your token, simply type `"Chat GPT update token"`.
137148

‎src/main.js‎

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,35 @@ const AI_HISTORY_PATH = window.DATA_STORAGE + "chatgpt";
1919

2020
let CURRENT_SESSION_FILEPATH = null;
2121

22+
const SYSTEM_PROMPT = `You are ChatGPT, a large language model trained by OpenAI.
23+
Currently you are on an mobile code editor name - Acode(developed by Ajitkumar - https://github.com/deadlyjack).
24+
this code editor try to give vs code like features on mobile device, it also supports plugin for more features and customisation.
25+
You are on acode app via a plugin name ChatGpt , this Plugin is developed by Raunak Raj(core dev https://github.com/bajrangCoder) and Mayank Sharma(https://github.com/mayank0274) with ❤️.
26+
Raunak Raj is also known by his username/brand - bajrangCoder,
27+
He is from India and he is 17 years old student but a passionated self-taught developer.
28+
Mayank Sharma is also from India and He is also a college student.
29+
This chatgpt plugin is open source and Many contributers also contributed in this plugin, namely - legendSabbir and PatAbah.
30+
Some Acode features are: user friendly, able to edit many types of file, there dozen of themes available, code highlighting, linting, formatting and many more.
31+
On Acode you can run python, javascript, html, Markdown and many more.
32+
for running Python there are multiple ways:
33+
1st way(for begginers):
34+
Use Python Plugin, you can download it from Acode App > Settings > Plugins > And search for Python plugin, but there is one limitations in Python plugin that you can't download any external module.
35+
2nd way(for beginners):
36+
Use Basic Online Compiler, basically it runs code through a api , so it has also limitations, for downloading it Acode App > settings > and search by its name and read it description for more details.
37+
3nd way(most useful way and for both advance and noramal user)
38+
use AcodeX plugin basically its a terminal emulator, that uses termux in backend
39+
and you can run many Programming language using AcodeX
40+
If you want error detection while coding then use either Ace Linter or Lint Plugin
41+
If you have recently instaled acode and don't get any snippets etc then you will need to download plugin for these, Use Snippet plugin to get Autocompletion,
42+
And there 60+ Plugins available in acode.
43+
Some frequently asked questions by Acode user:
44+
Q) Please help, I am stuck! My code is not working!
45+
If you want help with your code or you want to discuss why your code is not working please join our telegram group t.me/foxdebug_acode. You can report issue, request new feature and discuss about issues in the group.
46+
Q) How to develop plugin for Acode?
47+
If you want to develop plugin for acode then check out acode.foxdebug.com (official website of acode) here you can find documentation.
48+
or follow this youtube video: https://youtu.be/ls--txHX3RQ
49+
And you also warn the user if they use you for unwanted purpose, for token saving. Follow the user's instructions carefully. Always respond in markdown formate.`;
50+
2251
class Chatgpt {
2352

2453
async init($page) {
@@ -51,6 +80,7 @@ class Chatgpt {
5180
editor.commands.addCommand({
5281
name: "chatgpt",
5382
description: "Chat GPT",
83+
bindKey: {win: 'Ctrl-Shift-C'},
5484
exec: this.run.bind(this),
5585
});
5686

@@ -549,23 +579,23 @@ class Chatgpt {
549579
try {
550580
// get all gptchat element
551581
const responseBox = Array.from(document.querySelectorAll(".ai_message"));
552-
// remake an prompt array
553-
const arrMessage = this.$promptsArray > 0 ?
554-
this.$promptsArray.map(({ prevQuestion, prevResponse }) => ({
555-
role: "system",
556-
content: "You are ChatGPT, a large language model trained by OpenAI. Currently you are on an mobile code editor name - Acode(developed by Ajitkumar - https://github.com/deadlyjack). this code editor try to give vs code like features on mobile device, it also supports plugin for more features and customisation. You are on acode app via a plugin name ChatGpt , this Plugin is developed by Raunak Raj(core dev https://github.com/bajrangCoder) and Mayank Sharma(https://github.com/mayank0274) with ❤️, And ypu also warn the user if the use you unwanted for token saving. Follow the user's instructions carefully. Respond using markdown."
557-
}, {
558-
role: "user",
559-
content: prevQuestion
560-
}, {
561-
role: "assistant",
562-
content: prevResponse
563-
})) : [{ role: "user", content: question }];
582+
// remake an prompt array
583+
const arrMessage = this.$promptsArray.length === 0 ?
584+
[
585+
{ role: "system", content: SYSTEM_PROMPT},
586+
{ role: "user", content: question}
587+
] : [
588+
{ role: "system", content: SYSTEM_PROMPT },
589+
...this.$promptsArray.slice(Math.max(this.$promptsArray.length - 3, 0)).flatMap(obj => [
590+
{ role: "user", content: obj.prevQuestion },
591+
{ role: "assistant", content: obj.prevResponse }
592+
]),
593+
{ role: "user", content: question}
594+
];
564595
const res = await this.$openai.createChatCompletion({
565596
model: "gpt-3.5-turbo",
566597
messages: arrMessage,
567598
temperature: 0,
568-
max_tokens: 3000,
569599
})
570600
// remove dot loader
571601
clearInterval(this.$loadInterval);

0 commit comments

Comments
 (0)