Skip to content

Commit cd59b5d

Browse files
Add files via upload
1 parent 2fcbb5c commit cd59b5d

File tree

10 files changed

+2092
-0
lines changed

10 files changed

+2092
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"mocha": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": 2018,
11+
"ecmaFeatures": {
12+
"jsx": true
13+
},
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"no-const-assign": "warn",
18+
"no-this-before-super": "warn",
19+
"no-undef": "warn",
20+
"no-unreachable": "warn",
21+
"no-unused-vars": "warn",
22+
"constructor-super": "warn",
23+
"valid-typeof": "warn"
24+
}
25+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'test/**/*.test.js',
5+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
test/**
4+
.gitignore
5+
.yarnrc
6+
vsc-extension-quickstart.md
7+
**/jsconfig.json
8+
**/*.map
9+
**/.eslintrc.json
10+
**/.vscode-test.*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "llm-copilot" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# llm-copilot README
2+
3+
This is the README for your extension "llm-copilot". After writing up a brief description, we recommend including the following sections.
4+
5+
## Features
6+
7+
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8+
9+
For example if there is an image subfolder under your extension project workspace:
10+
11+
\!\[feature X\]\(images/feature-x.png\)
12+
13+
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14+
15+
## Requirements
16+
17+
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18+
19+
## Extension Settings
20+
21+
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22+
23+
For example:
24+
25+
This extension contributes the following settings:
26+
27+
* `myExtension.enable`: Enable/disable this extension.
28+
* `myExtension.thing`: Set to `blah` to do something.
29+
30+
## Known Issues
31+
32+
Calling out known issues can help limit users opening duplicate issues against your extension.
33+
34+
## Release Notes
35+
36+
Users appreciate release notes as you update your extension.
37+
38+
### 1.0.0
39+
40+
Initial release of ...
41+
42+
### 1.0.1
43+
44+
Fixed issue #.
45+
46+
### 1.1.0
47+
48+
Added features X, Y, and Z.
49+
50+
---
51+
52+
## Working with Markdown
53+
54+
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
55+
56+
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57+
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58+
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets
59+
60+
## For more information
61+
62+
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63+
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
64+
65+
**Enjoy!**
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
const vscode = require('vscode');
2+
const axios = require('axios');
3+
4+
const TOGETHER_AI_API_KEY = 'your_actual_api_key_here';
5+
const GROQ_AI_API_KEY = 'your_actual_api_key_here';
6+
const LLAMA_API_KEY = 'your_actual_api_key_here';
7+
8+
async function getTogetherAIResponse(prompt) {
9+
const response = await axios.post('https://api.together.ai/v1/text/completion', {
10+
prompt: prompt
11+
}, {
12+
headers: {
13+
'Authorization': `Bearer ${TOGETHER_AI_API_KEY}`,
14+
'Content-Type': 'application/json'
15+
}
16+
});
17+
return response.data.text;
18+
}
19+
20+
async function getGroqAIResponse(prompt) {
21+
const response = await axios.post('https://api.groq.com/v1/complete', {
22+
prompt: prompt
23+
}, {
24+
headers: {
25+
'Authorization': `Bearer ${GROQ_AI_API_KEY}`,
26+
'Content-Type': 'application/json'
27+
}
28+
});
29+
return response.data.text;
30+
}
31+
32+
async function getLlamaResponse(prompt) {
33+
const response = await axios.post('https://api.llama.com/v1/complete', {
34+
prompt: prompt
35+
}, {
36+
headers: {
37+
'Authorization': `Bearer ${LLAMA_API_KEY}`,
38+
'Content-Type': 'application/json'
39+
}
40+
});
41+
return response.data.text;
42+
}
43+
44+
function activate(context) {
45+
let disposable = vscode.commands.registerCommand('my-ext.helloWorld', async () => {
46+
const prompt = await vscode.window.showInputBox({ prompt: 'Enter your prompt' });
47+
48+
if (prompt) {
49+
try {
50+
const togetherAIResponse = await getTogetherAIResponse(prompt);
51+
const groqAIResponse = await getGroqAIResponse(prompt);
52+
const llamaResponse = await getLlamaResponse(prompt);
53+
54+
vscode.window.showInformationMessage(`TogetherAI: ${togetherAIResponse}`);
55+
vscode.window.showInformationMessage(`GroqAI: ${groqAIResponse}`);
56+
vscode.window.showInformationMessage(`LLaMA: ${llamaResponse}`);
57+
} catch (error) {
58+
vscode.window.showErrorMessage('Error fetching response from LLMs');
59+
}
60+
}
61+
});
62+
63+
context.subscriptions.push(disposable);
64+
}
65+
66+
// @ts-ignore
67+
exports.activate = activate;
68+
69+
function deactivate() {}
70+
71+
module.exports = {
72+
// @ts-ignore
73+
activate,
74+
deactivate
75+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2022",
5+
"checkJs": true, /* Typecheck .js files. */
6+
"lib": [
7+
"ES2022"
8+
]
9+
},
10+
"exclude": [
11+
"node_modules"
12+
]
13+
}

0 commit comments

Comments
 (0)