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: CodeEditor AI driven auto completion #484

Merged
merged 5 commits into from
Jan 5, 2025
Merged

Conversation

Abse2001
Copy link
Contributor

@Abse2001 Abse2001 commented Jan 4, 2025

No description provided.

@tscircuitbot
Copy link

📊 Bundle Size Analysis

Total Bundle Size

  • Before: 30.15 MB
  • After: 30.40 MB
  • Change: 📈 264.57 KB (0.86%)

Diff

No significant changes in bundle size.

View Dependencies
Package Size
typescript@^5.6.3 8.69 MB
@babel/standalone@^7.26.2 4.82 MB
react@^18.3.1 617.30 KB
ms@^2.1.3 530.54 KB
posthog-js@^1.203.2 229.68 KB
jszip@^3.10.1 139.73 KB
react-dom@^18.3.1 138.54 KB
@tscircuit/footprinter@^0.0.96 122.03 KB
circuit-json@^0.0.126 118.90 KB
zod@^3.23.8 117.16 KB
circuit-to-svg@^0.0.99 101.33 KB
tailwind-merge@^2.5.2 69.93 KB
dsn-converter@^0.0.54 32.97 KB
react-helmet@^6.1.0 29.17 KB
fflate@^0.8.2 19.95 KB
states-us@^1.1.1 7.27 KB
use-mouse-matrix-transform@^1.1.13 5.80 KB
zustand@^4.5.5 4.17 KB
file-saver@^2.0.5 3.58 KB
vite@^5.4.8 3.24 KB
@vercel/analytics@^1.4.1 2.88 KB
redaxios@^0.5.1 1.83 KB
clsx@^2.1.1 783.00 B
use-async-memo@^1.2.5 759.00 B
codemirror@^6.0.1 595.00 B
country-list@^2.3.0 387.00 B
extract-codefence@^0.0.4 151.00 B
jscad-electronics@^0.0.24 63.00 B
What is this? This is an automated bundle size report generated during the build process.

@Abse2001
Copy link
Contributor Author

Abse2001 commented Jan 4, 2025

@seveibar idk the backend structure for the api key, so I will leave it to you.

@tscircuitbot
Copy link

📊 Bundle Size Analysis

Total Bundle Size

  • Before: 30.15 MB
  • After: 30.41 MB
  • Change: 📈 264.77 KB (0.86%)

Diff

No significant changes in bundle size.

View Dependencies
Package Size
typescript@^5.6.3 8.69 MB
@babel/standalone@^7.26.2 4.82 MB
react@^18.3.1 617.30 KB
ms@^2.1.3 530.54 KB
posthog-js@^1.203.2 229.68 KB
jszip@^3.10.1 139.73 KB
react-dom@^18.3.1 138.54 KB
@tscircuit/footprinter@^0.0.96 122.03 KB
circuit-json@^0.0.126 118.90 KB
zod@^3.23.8 117.16 KB
circuit-to-svg@^0.0.99 101.33 KB
tailwind-merge@^2.5.2 69.93 KB
dsn-converter@^0.0.54 32.97 KB
react-helmet@^6.1.0 29.17 KB
fflate@^0.8.2 19.95 KB
states-us@^1.1.1 7.27 KB
use-mouse-matrix-transform@^1.1.13 5.80 KB
zustand@^4.5.5 4.17 KB
file-saver@^2.0.5 3.58 KB
vite@^5.4.8 3.24 KB
@vercel/analytics@^1.4.1 2.88 KB
redaxios@^0.5.1 1.83 KB
clsx@^2.1.1 783.00 B
use-async-memo@^1.2.5 759.00 B
codemirror@^6.0.1 595.00 B
country-list@^2.3.0 387.00 B
extract-codefence@^0.0.4 151.00 B
jscad-electronics@^0.0.24 63.00 B
What is this? This is an automated bundle size report generated during the build process.

@tscircuitbot
Copy link

📊 Bundle Size Analysis

Total Bundle Size

  • Before: 30.15 MB
  • After: 30.41 MB
  • Change: 📈 264.77 KB (0.86%)

Diff

No significant changes in bundle size.

View Dependencies
Package Size
typescript@^5.6.3 8.69 MB
@babel/standalone@^7.26.2 4.82 MB
react@^18.3.1 617.30 KB
ms@^2.1.3 530.54 KB
posthog-js@^1.203.2 229.68 KB
jszip@^3.10.1 139.73 KB
react-dom@^18.3.1 138.54 KB
@tscircuit/footprinter@^0.0.96 122.03 KB
circuit-json@^0.0.126 118.90 KB
zod@^3.23.8 117.16 KB
circuit-to-svg@^0.0.99 101.33 KB
tailwind-merge@^2.5.2 69.93 KB
dsn-converter@^0.0.54 32.97 KB
react-helmet@^6.1.0 29.17 KB
fflate@^0.8.2 19.95 KB
states-us@^1.1.1 7.27 KB
use-mouse-matrix-transform@^1.1.13 5.80 KB
zustand@^4.5.5 4.17 KB
file-saver@^2.0.5 3.58 KB
vite@^5.4.8 3.24 KB
@vercel/analytics@^1.4.1 2.88 KB
redaxios@^0.5.1 1.83 KB
clsx@^2.1.1 783.00 B
use-async-memo@^1.2.5 759.00 B
codemirror@^6.0.1 595.00 B
country-list@^2.3.0 387.00 B
extract-codefence@^0.0.4 151.00 B
jscad-electronics@^0.0.24 63.00 B
What is this? This is an automated bundle size report generated during the build process.

@@ -180,6 +182,20 @@ export const CodeEditor = ({
: javascript({ typescript: true, jsx: true }),
keymap.of([indentWithTab]),
EditorState.readOnly.of(readOnly),
copilotPlugin({
apiKey: codeCompletionApi.apiKey,
Copy link
Contributor

Choose a reason for hiding this comment

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

can you enable only if the codeCompletionApi.apiKey is defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

awesome work, one minor change before it goes to production

}
return import.meta.env.VITE_USE_DIRECT_AI_REQUESTS === "true"
? {
apiKey: import.meta.env.VITE_CODE_COMPLETION_API_KEY,
Copy link
Contributor

Choose a reason for hiding this comment

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

what service?

Copy link
Contributor

Choose a reason for hiding this comment

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

we should make the API_KEY indicate the service being used? Is it anthropic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seveibar it should be codium api key?
image

Copy link
Contributor

Choose a reason for hiding this comment

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

ok then we should name the api key VITE_CODIUM_API_KEY

Copy link
Contributor

Choose a reason for hiding this comment

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

how did you test this? I'm not sure codium offers an api

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like the user would have to provide a codium key? I'm a bit confused how we use this in practice

@tscircuitbot
Copy link

📊 Bundle Size Analysis

Total Bundle Size

  • Before: 30.15 MB
  • After: 30.41 MB
  • Change: 📈 264.88 KB (0.86%)

Diff

No significant changes in bundle size.

View Dependencies
Package Size
typescript@^5.6.3 8.69 MB
@babel/standalone@^7.26.2 4.82 MB
react@^18.3.1 617.30 KB
ms@^2.1.3 530.54 KB
posthog-js@^1.203.2 229.68 KB
jszip@^3.10.1 139.73 KB
react-dom@^18.3.1 138.54 KB
@tscircuit/footprinter@^0.0.96 122.03 KB
circuit-json@^0.0.126 118.90 KB
zod@^3.23.8 117.16 KB
circuit-to-svg@^0.0.99 101.33 KB
tailwind-merge@^2.5.2 69.93 KB
dsn-converter@^0.0.54 32.97 KB
react-helmet@^6.1.0 29.17 KB
fflate@^0.8.2 19.95 KB
states-us@^1.1.1 7.27 KB
use-mouse-matrix-transform@^1.1.13 5.80 KB
zustand@^4.5.5 4.17 KB
file-saver@^2.0.5 3.58 KB
vite@^5.4.8 3.24 KB
@vercel/analytics@^1.4.1 2.88 KB
redaxios@^0.5.1 1.83 KB
clsx@^2.1.1 783.00 B
use-async-memo@^1.2.5 759.00 B
codemirror@^6.0.1 595.00 B
country-list@^2.3.0 387.00 B
extract-codefence@^0.0.4 151.00 B
jscad-electronics@^0.0.24 63.00 B
What is this? This is an automated bundle size report generated during the build process.

@seveibar seveibar changed the title feat: CodEditor AI driven auto completion feat: CodeEditor AI driven auto completion Jan 4, 2025
@tscircuitbot
Copy link

📊 Bundle Size Analysis

Total Bundle Size

  • Before: 30.15 MB
  • After: 30.41 MB
  • Change: 📈 264.85 KB (0.86%)

Diff

No significant changes in bundle size.

View Dependencies
Package Size
typescript@^5.6.3 8.69 MB
@babel/standalone@^7.26.2 4.82 MB
react@^18.3.1 617.30 KB
ms@^2.1.3 530.54 KB
posthog-js@^1.203.2 229.68 KB
jszip@^3.10.1 139.73 KB
react-dom@^18.3.1 138.54 KB
@tscircuit/footprinter@^0.0.96 122.03 KB
circuit-json@^0.0.126 118.90 KB
zod@^3.23.8 117.16 KB
circuit-to-svg@^0.0.99 101.33 KB
tailwind-merge@^2.5.2 69.93 KB
dsn-converter@^0.0.54 32.97 KB
react-helmet@^6.1.0 29.17 KB
fflate@^0.8.2 19.95 KB
states-us@^1.1.1 7.27 KB
use-mouse-matrix-transform@^1.1.13 5.80 KB
zustand@^4.5.5 4.17 KB
file-saver@^2.0.5 3.58 KB
vite@^5.4.8 3.24 KB
@vercel/analytics@^1.4.1 2.88 KB
redaxios@^0.5.1 1.83 KB
clsx@^2.1.1 783.00 B
use-async-memo@^1.2.5 759.00 B
codemirror@^6.0.1 595.00 B
country-list@^2.3.0 387.00 B
extract-codefence@^0.0.4 151.00 B
jscad-electronics@^0.0.24 63.00 B
What is this? This is an automated bundle size report generated during the build process.

@Abse2001 Abse2001 merged commit cd51091 into tscircuit:main Jan 5, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants