Merge branch 'main' into preview

This commit is contained in:
Nate Sesti 2024-02-21 13:53:44 -08:00
commit fa9637d6f4
5 changed files with 170 additions and 15 deletions

View file

@ -26,7 +26,7 @@
</div>
## Task, not tab, auto-complete
## Task and tab autocomplete
### Answer coding questions
@ -52,6 +52,12 @@ Open a blank file and let Continue start new Python scripts, React components, e
- “/edit implement a c++ shortest path algo in a concise way”
- “/edit create a docker compose file with php and mysql server"
### And much more!
- Try out [experimental support for local tab autocomplete](https://continue.dev/docs/walkthroughs/tab-autocomplete) in VS Code
- Use [built-in context providers](https://continue.dev/docs/customization/context-providers#built-in-context-providers) or create your own [custom context providers](https://continue.dev/docs/customization/context-providers#building-your-own-context-provider)
- Use [built-in slash commands](https://arc.net/l/quote/zbhwfjmp) or create your own [custom slash commands](https://continue.dev/docs/customization/slash-commands#custom-slash-commands)
## Getting Started
#### Download for [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)

View file

@ -4,24 +4,146 @@ export interface AutocompleteLanguageInfo {
endOfLine: string[];
}
// TypeScript
export const Typescript = {
stopWords: ["function", "class", "module", "export "],
stopWords: ["function", "class", "module", "export"],
comment: "//",
endOfLine: [";"],
};
// Python
export const Python = {
stopWords: ["def", "class"],
comment: "#",
endOfLine: [],
};
// Java
export const Java = {
stopWords: ["class", "function"],
comment: "//",
endOfLine: [";"],
};
// C++
export const Cpp = {
stopWords: ["class", "namespace", "template"],
comment: "//",
endOfLine: [";"],
};
// C#
export const CSharp = {
stopWords: ["class", "namespace", "void"],
comment: "//",
endOfLine: [";"],
};
// C
export const C = {
stopWords: ["if", "else", "while", "for", "switch", "case"],
comment: "//",
endOfLine: [";"],
};
// Scala
export const Scala = {
stopWords: ["def", "val", "var", "class", "object", "trait"],
comment: "//",
endOfLine: [";"],
};
// Go
export const Go = {
stopWords: ["func", "package", "import", "type"],
comment: "//",
endOfLine: [""],
};
// Rust
export const Rust = {
stopWords: ["fn", "mod", "pub", "struct", "enum", "trait"],
comment: "//",
endOfLine: [";"],
};
// Haskell
export const Haskell = {
stopWords: ["data", "type", "newtype", "class", "instance", "let", "in", "where"],
comment: "--",
endOfLine: [""],
};
// PHP
export const PHP = {
stopWords: ["function", "class", "namespace", "use"],
comment: "//",
endOfLine: [";"],
};
// Ruby on Rails
export const RubyOnRails = {
stopWords: ["def", "class", "module"],
comment: "#",
endOfLine: [""],
};
// Swift
export const Swift = {
stopWords: ["func", "class", "struct", "import"],
comment: "//",
endOfLine: [";"],
};
// Kotlin
export const Kotlin = {
stopWords: ["fun", "class", "package", "import"],
comment: "//",
endOfLine: [";"],
};
// Ruby
export const Ruby = {
stopWords: ["class", "module", "def"],
comment: "#",
endOfLine: [""],
};
// Clojure
export const Clojure = {
stopWords: ["def", "fn", "let", "do", "if", "defn", "ns", "defmacro"],
comment: ";",
endOfLine: [""],
};
// Julia
export const Julia = {
stopWords: ["function", "macro", "if", "else", "elseif", "while", "for", "begin", "end", "module"],
comment: "#",
endOfLine: [";"],
};
// F#
export const FSharp = {
stopWords: ["let", "type", "module", "namespace", "open", "if", "then", "else", "match", "with"],
comment: "//",
endOfLine: [""],
};
// R
export const R = {
stopWords: ["function", "if", "else", "for", "while", "repeat", "library", "require"],
comment: "#",
endOfLine: [""],
};
// Dart
export const Dart = {
stopWords: ["class", "import", "void", "enum"],
comment: "//",
endOfLine: [";"],
};
export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = {
ts: Typescript,
js: Typescript,
@ -30,4 +152,31 @@ export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = {
py: Python,
pyi: Python,
java: Java,
};
cpp: Cpp,
cxx: Cpp,
h: Cpp,
hpp: Cpp,
cs: CSharp,
c: C,
scala: Scala,
sc: Scala,
go: Go,
rs: Rust,
hs: Haskell,
php: PHP,
rb: Ruby,
rails: RubyOnRails,
swift: Swift,
kt: Kotlin,
clj: Clojure,
cljs: Clojure,
cljc: Clojure,
jl: Julia,
fs: FSharp,
fsi: FSharp,
fsx: FSharp,
fsscript: FSharp,
r: R,
R: R,
dart: Dart,
};

View file

@ -31,7 +31,7 @@ class Gemini extends BaseLLM {
messages: ChatMessage[],
options: CompletionOptions
): AsyncGenerator<ChatMessage> {
const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/us-central1/publishers/google/models/gemini-pro:streamGenerateContent`;
const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/${this.region}/publishers/google/models/gemini-pro:streamGenerateContent`;
const body = {
contents: messages.map((msg) => {
return {
@ -60,8 +60,12 @@ class Gemini extends BaseLLM {
if (data[0]?.error) {
throw new Error(data[0].error.message);
}
yield data[0]?.candidates?.[0]?.content?.parts?.[0]?.text || "";
}
let combinedText = '';
for (const entry of data || []) {
combinedText += entry?.candidates?.[0]?.content?.parts?.[0]?.text || '';
}
yield { role: "assistant", content: combinedText.trim() }; }
}
export default Gemini;

View file

@ -6,15 +6,14 @@ When you first install Continue, you can try it out for free using a proxy serve
Once you're ready to use your own API key or a different model / provider, press the `+` button in the bottom left to add a new model to your `config.json`.
If you are unsure what model or provider to use, here is a rule of thumb:
If you are unsure what model or provider to use, here is our current rule of thumb:
- Use GPT-4 via OpenAI if you want the best possible model overall right now
- Use Phind CodeLlama or Mixtral 8x7B via Together if you want the best open-source model right now
- Use CodeLlama via Ollama if you want to run a model locally on Mac or Linux
- Use CodeLlama via LM Studio if you want to run a model locally on Windows
- Use GPT-4 via OpenAI if you want the best possible model overall
- Use DeepSeek Coder 33B via the Together API if you want the best open-source model
- Use DeepSeek Coder 6.7B with Ollama if you want to run a model locally
Learn more:
- [Select a provider](select-provider.md)
- [Select a model](select-model.md)
- [Configuration](configuration.md)
- [Configuration](configuration.md)

View file

@ -8,9 +8,6 @@
"name": "continue",
"version": "0.9.70",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",
"@types/jest": "^29.5.11",
"@types/node-fetch": "^2.6.11",
"@vscode/ripgrep": "^1.15.9",