Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit d787691

Browse files
committed
feat: added first commit
1 parent 4c42fdf commit d787691

20 files changed

+2853
-2
lines changed

.gitignore

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# These are some examples of commonly ignored file patterns.
2+
# You should customize this list as applicable to your project.
3+
# Learn more about .gitignore:
4+
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
5+
6+
# Node artifact files
7+
node_modules/
8+
dist/
9+
out/
10+
11+
.vscode/
12+
# Compiled Java class files
13+
*.class
14+
15+
# Compiled Python bytecode
16+
*.py[cod]
17+
18+
# Log files
19+
*.log
20+
21+
# Package files
22+
*.jar
23+
24+
# Maven
25+
target/
26+
dist/
27+
28+
# JetBrains IDE
29+
.idea/
30+
31+
# Unit test reports
32+
TEST*.xml
33+
34+
# Generated by MacOS
35+
.DS_Store
36+
37+
# Generated by Windows
38+
Thumbs.db
39+
40+
# Applications
41+
*.app
42+
*.exe
43+
*.war
44+
45+
# Large media files
46+
*.mp4
47+
*.tiff
48+
*.avi
49+
*.flv
50+
*.mov
51+
*.wmv
52+

LICENSE.md

+674
Large diffs are not rendered by default.

README.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1-
# VsCodex
2-
A VsCode extension that add the capabilities of OpenAi Playground.
1+
# VsCodex - A VsCode extension that add the capabilities of OpenAI Playground.
2+
3+
## How to use
4+
5+
1. Select some code. (Optional)
6+
2. Press F4. (Optional)
7+
3. Enjoy your new code. (Optional)
8+
9+
## Modes
10+
11+
Codex can be used in three differents modes, each mode have its own set of options that you can find on a new tab on the Activity Bar. You can use the extension without selecting any code, in that case the extension will generate new code using the default prompt.
12+
13+
### Generate
14+
15+
Generates new code using the selection as prompt. If no selection is made, the extension will use the default prompt.
16+
17+
### Transform
18+
19+
Transforms the selection with a set of instructions provided.
20+
21+
### Insert
22+
23+
Insert new code using the [insert] tag. If no selection is made, the extension will use the default prompt.
24+
25+
## How to install
26+
27+
1. Download the latest release.
28+
2. Run code --install-extension vscodex.vsix
29+
30+
## OpenAi API Key
31+
32+
You need an OpenAi API Key to use the extension. You can get one [here](https://beta.openai.com/).
33+
34+
## License
35+
36+
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
37+
38+
## OpenAi Copyright Disclaimer
39+
40+
This project is not affiliated with OpenAi.
41+
42+
OpenAi is a trademark of OpenAi, Inc.
43+
44+
## Author
45+
46+
murapa96

media/1024px-Robot-icon.svg.png

28.6 KB
Loading

media/editConfig.html

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<!--
6+
Use a content security policy to only allow loading images from https or from our extension directory,
7+
and only allow scripts that have a specific nonce.
8+
-->
9+
<meta http-equiv="Content-Security-Policy" />
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11+
<link rel="stylesheet" type="text/css" href="${stylesheetUri}" />
12+
13+
<div class="topnav">
14+
<!-- TAB BUTTONS-->
15+
<!-- Three buttons for each mode, generate, insert and transform-->
16+
<button id="generateTab" title="Generate" class="item-top-tab-button">
17+
<svg
18+
xmlns="http://www.w3.org/2000/svg"
19+
class="ionicon"
20+
viewBox="0 0 512 512"
21+
width="2.6em"
22+
height="2.6em"
23+
>
24+
<title>Generate</title>
25+
<rect
26+
fill="none"
27+
stroke="currentColor"
28+
stroke-miterlimit="10"
29+
stroke-width="32"
30+
x="280.48"
31+
y="122.9"
32+
width="63.03"
33+
height="378.2"
34+
rx="31.52"
35+
transform="rotate(-45 312.002 311.994)"
36+
/>
37+
<path
38+
stroke="currentColor"
39+
stroke-miterlimit="10"
40+
stroke-width="32"
41+
stroke-linecap="round"
42+
d="M178.38 178.38a31.64 31.64 0 000 44.75L223.25 268 268 223.25l-44.87-44.87a31.64 31.64 0 00-44.75 0z"
43+
/>
44+
<path
45+
stroke="currentColor"
46+
stroke-miterlimit="10"
47+
stroke-width="32"
48+
stroke-linecap="round"
49+
d="M48 192h48M90.18 90.18l33.94 33.94M192 48v48M293.82 90.18l-33.94 33.94M124.12 259.88l-33.94 33.94"
50+
/>
51+
</svg>
52+
</button>
53+
<button id="insertTab" title="Insert" class="item-top-tab-button">
54+
<svg
55+
xmlns="http://www.w3.org/2000/svg"
56+
class="ionicon"
57+
viewBox="0 0 512 512"
58+
width="2.6em"
59+
height="2.6em"
60+
>
61+
<title>Insert</title>
62+
<path
63+
fill="none"
64+
stroke="currentColor"
65+
stroke-linecap="round"
66+
stroke-linejoin="round"
67+
stroke-width="32"
68+
d="M160 368L32 256l128-112M352 368l128-112-128-112M192 288.1l64 63.9 64-63.9M256 160v176.03"
69+
/>
70+
</svg>
71+
</button>
72+
<button
73+
id="editTab"
74+
title="Transform"
75+
class="item-top-tab-button"
76+
disabled
77+
>
78+
<svg
79+
xmlns="http://www.w3.org/2000/svg"
80+
class="ionicon"
81+
viewBox="0 0 512 512"
82+
width="2.6em"
83+
height="2.6em"
84+
>
85+
<title>Transform</title>
86+
<path
87+
stroke="currentColor"
88+
stroke-miterlimit="10"
89+
stroke-width="32"
90+
stroke-linecap="round"
91+
d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48"
92+
fill="none"
93+
stroke="currentColor"
94+
stroke-linecap="round"
95+
stroke-linejoin="round"
96+
stroke-width="32"
97+
/>
98+
<path
99+
stroke="currentColor"
100+
stroke-miterlimit="10"
101+
stroke-width="32"
102+
stroke-linecap="round"
103+
d="M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z"
104+
/>
105+
</svg>
106+
</button>
107+
</div>
108+
</head>
109+
<body>
110+
<div class="item-100">
111+
<!-- End of topnav -->
112+
113+
<div class="item">
114+
<p class="item-title">Model</p>
115+
116+
<select class="item-select" id="model" name="model-type">
117+
${modelOptions}
118+
</select>
119+
</div>
120+
121+
<!-- TEMPERATURE-->
122+
<div
123+
class="item"
124+
title="Controls randomness. Lowering results in less random completions.\n As the temperature approaches zero, the model will become deterministic and repetitive."
125+
>
126+
<p class="item-title">Temperature</p>
127+
128+
<input
129+
class="slider"
130+
value="${engine[this._tab].getEngineOptions().temperature}"
131+
id="temperature_slider"
132+
type="range"
133+
min="0"
134+
max="1"
135+
step="0.01"
136+
/>
137+
<input
138+
class="item-input-number"
139+
id="temperature_input"
140+
min="0"
141+
max="1"
142+
type="number"
143+
value="${engine[this._tab].getEngineOptions().temperature}"
144+
step="0.01"
145+
/>
146+
</div>
147+
148+
<!-- STOPSQUENCE -->
149+
<div
150+
class="item"
151+
title="Up to four sequences where the API will stop generating further tokens.\n The returned text will not contain the stop sequence."
152+
>
153+
<p class="item-title">StopSequence</p>
154+
<p class="item-sub">
155+
${engine[this._tab].getEngineOptions().stopSequence}
156+
</p>
157+
158+
<input
159+
class="item-input"
160+
type="text"
161+
id="stopSequence"
162+
name="stop_sequence"
163+
/>
164+
</div>
165+
166+
<!-- TOP P-->
167+
<div
168+
class="item"
169+
title="Controls diversity via nucleus sampling. 0.5 means half of all likelihodd-weighted options are considered."
170+
>
171+
<p class="item-title">Top P</p>
172+
173+
<input
174+
class="slider"
175+
value="${engine[this._tab].getEngineOptions().top_p}"
176+
id="top_p_slider"
177+
type="range"
178+
min="0"
179+
max="1"
180+
step="0.01"
181+
/>
182+
<input
183+
class="item-input-number"
184+
value="${engine[this._tab].getEngineOptions().top_p}"
185+
id="top_p_input"
186+
type="number"
187+
min="0"
188+
max="1"
189+
step="0.01"
190+
/>
191+
</div>
192+
193+
<!-- INSTRUCTIONS-->
194+
<div class="item-100">
195+
<p class="item-title">Instructions</p>
196+
<textarea
197+
class="item-textarea"
198+
type="text"
199+
id="transformInstructions"
200+
name="transformInstructions"
201+
>
202+
${engine[this._tab].getEngineOptions().transformInstructions}</textarea
203+
>
204+
</div>
205+
</div>
206+
</body>
207+
<script src="${this.scriptUri}"></script>
208+
</html>

0 commit comments

Comments
 (0)