⏩ Preview (#1171)
* ✨ shared indexing
* 🎨 indexing
* 🧑💻 npm i --no-save in prepackage.js
* fix issue with /edit not acknowledging highlighted code after retrying
* 🚚 rename addLogs to addPromptCompletionPair
* Bedrock chat completion, Anthropic models
* 🩹 add filter for midline imports/top-level keywords and encoding header
* 🩹 add .t. to stop words
* 🔥 Improved Ctrl/Cmd+I (#1023)
* ⚡️ improved diff streaming algo
* 🎨 better messaging/formatting for further cmd/ctrl+I instructions
* ⚡️ more reliably filter out unwanted explanations
* 🚸 better follow up edits
* 💄 accept/reject diffs block-by-block
* ✨ cmd/ctrl+z to reject diff
* 🚚 rename variables
* 💄 allow switching files when inline diff still visible
* 🚸 don't show quick pick if not ctx providers exist
* 🚧 (sort of) allow switching editors while streaming diff
* 💄 show model being used for cmd/ctrl+I
* 💄 don't add undo stops when generating diff
* 🐛 fix shortcuts for accept/reject diff blocks
* ✨ improved GPT edit prompt, taking prefix/suffix into account
* ✨ improved prompting for empty selection ctrl/cmd+I
* ⚡️ immediately refresh codelens
* 🐛 use first model if default undefined
* ⚡️ refresh codelens after diff cleared
* 💄 update keyboard shortcuts
* ⚡️ Improved edit prompts for OS models (#1029)
* 💄 refresh codelens more frequently
* ⚡️ improved codellama edit prompt
* ⚡️ better codellama prompt
* ⚡️ use same improved prompt for most OS models
* 🎨 refactor chat templates
* 🎨 refactor llama2 prompt to allow ending assistant message
* ⚡️ separate os models prompt when no prefix/suffix
* 🎨 refactor to allow putting words in the model's mouth
* ⚡️ prune code around cmd/ctrl+I
* 🚚 rename to cmd/ctrl+I
* 🎨 make raw a base completion option
* 🩹 small improvements
* 🩹 use different prompt when completions not supported
* Keep the same statusBar item when updating it to prevent flickering of the status bar. (#1022)
* 🎨 add getRepoName to IDE, use for indexing
* 🎨 implement server client interface
* 📌 pin to vectordb=0.4.12
* 🧑💻 mark xhr-sync-worker.js as external in esbuild
* 🎨 break out ignore defaults into core
* 🎨 update getRepoName
* 🐛 fix import error
* 🩹 fix chat.jsonl logging
* ⚡️ improved OpenAI autocomplete support
* 🐛 fix bug causing part of completions to be skipped
* 🔥 remove URLContextProvider
* ✨ Add Groq as an official provider
* 🩹 make sure autocomplete works with claude
* 💄 update positioning of code block toolbar to not cover code
* ✨ Run in terminal button
* ✨ insert at cursor button
* ✨ Regenerate and copy buttons
* ✨ Button to force re-indexing
* 🐛 make sure tooltip IDs are unique
* ✨ Button to continue truncated response
* 🚧 WIP on inline edit browser embedding
* 🚧 inline TipTapEditor
* 🚧 WIP on inline TipTapEditor
* 🔥 remove unused test component
* 🚧 native inline edit
* 💄 nicer looking input box
* ✨ Diff Streaming in JetBrains
* 💄 line highlighting
* 💄 arial font
* ✨ Retry with further instructions
* 🚧 drop shadow
* ✨ accept/reject diffs
* ✨ accept/reject diffs
* 🐛 fix off-by-one errors
* 🚧 swap out button on enter
* 💄 styling and auto-resize
* 💄 box shadow
* 🚧 fix keyboard shortcuts to accept/reject diff
* 💄 improve small interactions
* 💄 loading icon, cancellation logic
* 🐛 handle next.value being undefined
* ✨ latex support
* Bug Fix: Add ternary operator to prevent nonexistant value error (#1052)
* add terniary operator
* Removing logging
* remove comment
---------
Co-authored-by: Justin Milner <jmilner@jmilner-lt2.deka.local>
Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com>
* 🎨 small formatting change
* 🩹 tweak /edit solution
* ✨ Dropdown to select model
* 🔊 print when SSL verification disabled
* 📌 pin esbuild version to match our hosted binary
* 🔥 remove unused package folder
* 👷 add note about pinning esbuild
* 🚚 rename pkg to binary
* ⚡️ update an important stop word for starcoder2, improve dev data
* 🐛 fix autocomplete bug
* Update completionProvider.ts
Add \r\n\r\n stop to tab completion
* 📌 update package-locks
* 🐛 fix bug in edit prompt
* 🔊 log extension version
* 🐛 handle repo undefined in vscode
* ⏪ revert back to esbuild ^0.17.19 to solve no backend found error with onnxruntime
* 🩹 set default autocomplete temp to 0.01 to be strictly positive
* make the useCopyBuffer option effective (#1062)
* Con-1037: Toggle full screen bug (#1065)
* webview reset
* add warning
---------
Co-authored-by: Justin Milner <jmilner@jmilner-lt2.deka.local>
* Update completionProvider.ts
as @rootedbox suggested
* Resolve conflict, accept branch being merged in (#1076)
* Resolve conflict, accept branch being merged in
* remove accidental .gitignore add
* whoops, put gitignore back
* fix
---------
Co-authored-by: Justin Milner <jmilner@jmilner-lt2.deka.local>
* #1073: update outdated documentation (#1074)
* 🩹 small tweaks to stop words
* Add abstraction for fetch to easily allow using request options (#1059)
* add fetch helper function with request options
* add support for request options for Jira context provider
* Add a new slash command to review code. (#1071)
* Add a new slash command to review code.
* clean code
* 🩹 add new starcoder artifact as stopword
* 💄 slight improvements to inline edit UI
* 🔖 update default models, bump gradle version
* 📝 recommend starcoder2
* 🐛 fix jetbrains encoding issue
* 🩹 don't index site-packages
* 🩹 error handling in JetBrains
* 🐛 fix copy to clipboard in jetbrains
* fix: cursor focus issue causing unwanted return to text area (#1086)
* 📝 mention autocomplete in jetbrains
* 📝 Tab-autocomplete README
* 🔥 remove note about custom ctx providers only being on VS Code
* 📝 docs about http context provider
* 👥 pull request template
* Update from Claude 2 to Claude 3 (#1078)
* 📝 add FAQ about single-line completions
* 📝 update autocomplete docs
* fix cursor focus issue causing unwanted return to text area
---------
Co-authored-by: Nate Sesti <sestinj@gmail.com>
Co-authored-by: Ty Dunn <ty@tydunn.com>
Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com>
* Update tree-sitter-wasms to 0.1.11 (which includes Solidity)
* Make use of solidity tree-sitter parser
* 🔧 option to disable autocomplete from config.json
* ✨ option to disable streaming with anthropic
* ✅ Test to verify that files are packaged
* Add FIM template for CodeGemma (#1097)
Also pass stop tokens to llama.cpp.
* ✨ customizable rerankers (#1088)
* ✨ customizable rerankers
* 💄 fix early truncation button
* ⚡️ improvements to full text search + reranking
* ⚡️ only use starcoder2 stop words for starcoder2
* ⚡️ crawl code graph for call expressions
* 🚧 starcoder2-7b free trial
* 🚧 free trial client for embeddings and re-ranking
* 🚧 embeddings provider
* ✅ test for presence of files in CI
* 🐛 fixes to reranking
* ✨ new onboarding experience
* ✨ new onboarding experience
* 💄 small tweaks to onboarding
* 🩹 add stopAtLines filter to /edit
* 🐛 clean up vite build errors
* 👷 make vscode external in binary build
* 💄 improved models onboarding for existing users
* 💄 default indexing progress to 0.0
* 🐛 small fixes to reranking
* 👷 clear folders before prepackage
* 👷 say where .vsix is output
* 👷 also download arm packages outside of gh actions
* 🎨 add AbortSignal to indexing
* 🔧 starcoder, not 2 in config_schema
* 🚚 again, starcoder, not 2
* 🐛 fix bug when reranker undefined
* 🩹 fix binary tsc error
* ✨ configure context menu prompts
* 🐛 acknowledge useLegacyCompletionsEndpoint
* 🚑 fix keep existing config option
* 🔊 learn about selection
* ⚡️ improvements to indexing reporting when not in git repo
* 🥅 handle situation where git doesn't exist in workspace
* ✨ support for gemini 1.5 pro
* 🐛 handle embeddingProvider name not found
* ✨ Gemini 1.5 and GPT-4 Turbo
* 👷 fix os, arch undefined in prepackage.js
* ⚡️ better detection of terminal code blocks
* 🧑💻 solve tailwind css warnings
* ✨ cmd/ctrl+L to select terminal contents
* 🐛 correctly handle remotes not found
* ✨ allow templating for custom commands
* 🔥 temporarily remove cmd+L to select terminal contents
* 🐛 remove quotes around Ollama stop words
* ✨ add Cohere as Model Provider (#1119)
* 🩹 add gpt-4-turbo to list of chat_only models
* feat: use exponential backoff in llm chat (#1115)
Signed-off-by: inimaz <93inigo93@gmail.com>
* 🩹 update exponential backoff timing
* 💄 spell out Alt in keyboard shortcuts
* 🩹 don't set edit prompt for templateType "none"
* Adds additional ignores for C-fmilies langs (#1129)
Ignored:
- cache directory `.cache`, used by clangd
- dependency files `*o.d`, used by object files
- LLVM and GNU coverage files: `*.profraw`, `*.gcda` and `*.gcno`
* 🔥 temporarily remove problematic expandSnippet import
* 👷 add npx to prefix vsce in build
* 🐛 handle messages sent in multiple parts over stdin
* 🔖 update gradle version
* 🩹 for now, skip onboarding in jetbrains
* 🩹 temporarily don't show use codebase on jetbrains
* 🐛 use system certificates in binary
* 🔖 update jetbrains version
* 🩹 correctly contruct set of certs
* 🔖 bump intellij version to 0.0.45
* 🩹 update to support images for gpt-4-turbo
* 🐛 fix image support autodetection
* ⚡️ again, improve image support autodetection
* 🐛 set supportsCompletions based on useLegacyCompletionsEndpoint model setting
Closes #1132
* 📝 useLegacyCompletionsEndpoint within OpenAI docs
* 🔧 forceCompletionsEndpointType option
* Revert "🔧 forceCompletionsEndpointType option"
This reverts commit dd51fcbb7f.
* 🩹 set default useLegacyCompletionsEndpoint to undefined
* 🩹 look for bedrock credentials in homedir
* 🩹 use title for autodetect
* ✨ disableInFiles option for autocomplete
* feat(httpContextProvider): load AC on fetch client (#1150)
Co-authored-by: Bertrand Pinel <bertrand.pinel@pole-emploi.fr>
* ✨ global filewatcher for config.json/ts changes
* 🐛 retry webview requests so that first cmd+L works
* ✨ Improved onboarding experience (#1155)
* 🚸 onboarding improvements
* 🧑💻 keyboard shortcuts to toggle autocomplete and open config.json
* ⚡️ improve detection of terminal code blocks
* 🚧 onboarding improvements
* 🚧 more onboarding improvements
* 💄 last session button
* 🚸 show more fallback options in dropdown
* 💄 add sectioning to models page
* 💄 clean up delete model button
* 💄 make tooltip look nicer
* 🚸 download Ollama button
* 💄 local LLM onboarding
* 🐛 select correct terminal on "runCommand" message
* 💄 polish onboarding
* 💚 fix gui build errors
* 📝 add /v1 to OpenAI examples in docs
* 🚑 hotfix for not iterable error
* 💄 add llama3 to UI
* 🔥 remove disable indexing
* 🍱 update continue logo
* 🐛 fix language undefined bug
---------
Signed-off-by: inimaz <93inigo93@gmail.com>
Co-authored-by: Nithish <nithishmohandass06@gmail.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-31-2-149.ec2.internal>
Co-authored-by: LapinMalin <111463204+TheLapinMalin@users.noreply.github.com>
Co-authored-by: Justin Milner <42585006+justinmilner1@users.noreply.github.com>
Co-authored-by: Justin Milner <jmilner@jmilner-lt2.deka.local>
Co-authored-by: lmaosweqf1 <138042737+lmaosweqf1@users.noreply.github.com>
Co-authored-by: ading2210 <71154407+ading2210@users.noreply.github.com>
Co-authored-by: Martin Mois <martin.mois@googlemail.com>
Co-authored-by: Tobias Jung <102594442+tobiajung@users.noreply.github.com>
Co-authored-by: Jason Jacobs <nerfnerd@gmail.com>
Co-authored-by: Nithish <83941930+Nithishvb@users.noreply.github.com>
Co-authored-by: Ty Dunn <ty@tydunn.com>
Co-authored-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>
Co-authored-by: postmasters <namnguyen@google.com>
Co-authored-by: Maxime Brunet <max@brnt.mx>
Co-authored-by: inimaz <49730431+inimaz@users.noreply.github.com>
Co-authored-by: SR_team <me@sr.team>
Co-authored-by: Roger Meier <r.meier@siemens.com>
Co-authored-by: Bertrand P <49525332+Berber31@users.noreply.github.com>
Co-authored-by: Bertrand Pinel <bertrand.pinel@pole-emploi.fr>
This commit is contained in:
parent
e6c5a79d22
commit
2205e134db
103 changed files with 2210 additions and 812 deletions
134
binary/package-lock.json
generated
134
binary/package-lock.json
generated
|
|
@ -13,10 +13,13 @@
|
|||
"commander": "^12.0.0",
|
||||
"core": "file:../core",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"mac-ca": "^2.0.3",
|
||||
"ncp": "^2.0.0",
|
||||
"posthog-node": "^3.6.3",
|
||||
"system-ca": "^1.0.2",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.10"
|
||||
"vectordb": "^0.4.10",
|
||||
"win-ca": "^3.5.1"
|
||||
},
|
||||
"bin": {
|
||||
"binary": "out/index.js"
|
||||
|
|
@ -68,7 +71,7 @@
|
|||
"socket.io-client": "^4.7.3",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "0.4.12",
|
||||
"web-tree-sitter": "^0.21.0"
|
||||
|
|
@ -1015,6 +1018,15 @@
|
|||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
||||
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
||||
},
|
||||
"node_modules/bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bl": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
||||
|
|
@ -1387,6 +1399,12 @@
|
|||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
|
|
@ -1653,6 +1671,11 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-electron": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz",
|
||||
"integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg=="
|
||||
},
|
||||
"node_modules/is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
|
|
@ -1755,6 +1778,39 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mac-ca": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/mac-ca/-/mac-ca-2.0.3.tgz",
|
||||
"integrity": "sha512-FkcNXYdUzfNEElPoYYLDHOXPCQePj4iK7Ir4OYy6Tr7yAUS2bFud4Uh1QdIsATDwRQN/miNUyZEltX2nA/tDAQ==",
|
||||
"dependencies": {
|
||||
"node-forge": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/macos-export-certificate-and-key": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/macos-export-certificate-and-key/-/macos-export-certificate-and-key-1.1.1.tgz",
|
||||
"integrity": "sha512-J2g0dJRLG3DghmdCkbJnif/zPmSylj6ql//xBYff5allzNlHPnWxRoyho9XznBYLbPJw4jZlKjMO69jtV8VC7Q==",
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^4.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/merge2": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
||||
|
|
@ -1893,6 +1949,12 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
|
||||
"integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
|
|
@ -1913,6 +1975,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
||||
"engines": {
|
||||
"node": ">= 6.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
|
|
@ -1969,6 +2039,14 @@
|
|||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg": {
|
||||
"version": "5.8.1",
|
||||
"resolved": "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz",
|
||||
|
|
@ -2299,6 +2377,17 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/split": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
|
||||
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
|
||||
"dependencies": {
|
||||
"through": "2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/stream-meter": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz",
|
||||
|
|
@ -2384,6 +2473,15 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/system-ca": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/system-ca/-/system-ca-1.0.2.tgz",
|
||||
"integrity": "sha512-/6CCJOKB5Fpi0x7/DCbV7uiFPgwGCeJsAaSondXS2DjLBv7ER2worVGvQWJqPM0kgOKO6auaCcSWpJKnrDmXjw==",
|
||||
"optionalDependencies": {
|
||||
"macos-export-certificate-and-key": "^1.1.1",
|
||||
"win-export-certificate-and-key": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/table-layout": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz",
|
||||
|
|
@ -2465,6 +2563,11 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
|
|
@ -2609,6 +2712,33 @@
|
|||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/win-ca": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/win-ca/-/win-ca-3.5.1.tgz",
|
||||
"integrity": "sha512-RNy9gpBS6cxWHjfbqwBA7odaHyT+YQNhtdpJZwYCFoxB/Dq22oeOZ9YCXMwjhLytKpo7JJMnKdJ/ve7N12zzfQ==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"is-electron": "^2.2.0",
|
||||
"make-dir": "^1.3.0",
|
||||
"node-forge": "^1.2.1",
|
||||
"split": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/win-export-certificate-and-key": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/win-export-certificate-and-key/-/win-export-certificate-and-key-1.1.1.tgz",
|
||||
"integrity": "sha512-wvF1DKlbt/PLOSdnKzIqv0Ipj+87n2VYOJFbkqBoN7l3l244reT7Lf6+Dnu86bYVWoVpq3ZZG417OLNHFnkP6A==",
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^4.3.0",
|
||||
"node-forge": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/wordwrapjs": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz",
|
||||
|
|
|
|||
|
|
@ -41,9 +41,12 @@
|
|||
"commander": "^12.0.0",
|
||||
"core": "file:../core",
|
||||
"follow-redirects": "^1.15.5",
|
||||
"mac-ca": "^2.0.3",
|
||||
"ncp": "^2.0.0",
|
||||
"posthog-node": "^3.6.3",
|
||||
"system-ca": "^1.0.2",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.10"
|
||||
"vectordb": "^0.4.10",
|
||||
"win-ca": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
23
binary/src/ca.ts
Normal file
23
binary/src/ca.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { globalAgent } from "https";
|
||||
import { systemCertsAsync } from "system-ca";
|
||||
|
||||
export async function setupCa() {
|
||||
try {
|
||||
switch (process.platform) {
|
||||
case "darwin":
|
||||
// https://www.npmjs.com/package/mac-ca#usage
|
||||
require("mac-ca").addToGlobalAgent();
|
||||
break;
|
||||
case "win32":
|
||||
// https://www.npmjs.com/package/win-ca#caveats
|
||||
require("win-ca").inject("+");
|
||||
break;
|
||||
default:
|
||||
// https://www.npmjs.com/package/system-ca
|
||||
globalAgent.options.ca = await systemCertsAsync();
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Failed to setup CA: ", e);
|
||||
}
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ export class Core {
|
|||
|
||||
// History
|
||||
on("history/list", (msg) => {
|
||||
return historyManager.list();
|
||||
return historyManager.list(msg.data);
|
||||
});
|
||||
on("history/delete", (msg) => {
|
||||
historyManager.delete(msg.data.id);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { Command } from "commander";
|
|||
import { getCoreLogsPath } from "core/util/paths";
|
||||
import fs from "fs";
|
||||
import { IpcIde } from "./IpcIde";
|
||||
import { setupCa } from "./ca";
|
||||
import { Core } from "./core";
|
||||
import { IpcMessenger } from "./messenger";
|
||||
|
||||
|
|
@ -18,6 +19,8 @@ program.action(() => {
|
|||
// const ide = new FileSystemIde();
|
||||
const core = new Core(messenger, ide);
|
||||
|
||||
setupCa();
|
||||
|
||||
// setTimeout(() => {
|
||||
// messenger.mock({
|
||||
// messageId: "2fe7823c-10bd-4771-abb5-781f520039ec",
|
||||
|
|
|
|||
|
|
@ -80,14 +80,31 @@ export class IpcMessenger {
|
|||
// Call handler which is waiting for the response, nothing to return
|
||||
this.idListeners.get(msg.messageId)?.(msg);
|
||||
} catch (e) {
|
||||
console.error("Error parsing line: ", line, e);
|
||||
let truncatedLine = line;
|
||||
if (line.length > 200) {
|
||||
truncatedLine =
|
||||
line.substring(0, 100) + "..." + line.substring(line.length - 100);
|
||||
}
|
||||
console.error("Error parsing line: ", truncatedLine, e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private _unfinishedLine: string | undefined = undefined;
|
||||
private _handleData(data: Buffer) {
|
||||
const d = data.toString();
|
||||
const lines = d.split(/\r\n|\r|\n/).filter((line) => line.trim() !== "");
|
||||
const lines = d.split(/\r\n/).filter((line) => line.trim() !== "");
|
||||
if (lines.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._unfinishedLine) {
|
||||
lines[0] = this._unfinishedLine + lines[0];
|
||||
this._unfinishedLine = undefined;
|
||||
}
|
||||
if (!d.endsWith("\r\n")) {
|
||||
this._unfinishedLine = lines.pop();
|
||||
}
|
||||
lines.forEach((line) => this._handleLine(line));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import Handlebars from "handlebars";
|
||||
import ignore from "ignore";
|
||||
import path from "path";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { IDE, ILLM, Position, TabAutocompleteOptions } from "..";
|
||||
import { RangeInFileWithContents } from "../commands/util";
|
||||
|
|
@ -79,6 +81,8 @@ function formatExternalSnippet(
|
|||
return lines.join("\n");
|
||||
}
|
||||
|
||||
let shownGptClaudeWarning = false;
|
||||
|
||||
export async function getTabCompletion(
|
||||
token: AbortSignal,
|
||||
options: TabAutocompleteOptions,
|
||||
|
|
@ -115,6 +119,7 @@ export async function getTabCompletion(
|
|||
}
|
||||
|
||||
// Model
|
||||
if (!llm) return;
|
||||
if (llm instanceof OpenAI) {
|
||||
llm.useLegacyCompletionsEndpoint = true;
|
||||
} else if (
|
||||
|
|
@ -125,7 +130,16 @@ export async function getTabCompletion(
|
|||
"The only free trial model supported for tab-autocomplete is starcoder-7b.",
|
||||
);
|
||||
}
|
||||
if (!llm) return;
|
||||
|
||||
if (
|
||||
!shownGptClaudeWarning &&
|
||||
(llm.model.includes("gpt") || llm.model.includes("claude"))
|
||||
) {
|
||||
shownGptClaudeWarning = true;
|
||||
throw new Error(
|
||||
`Warning: ${llm.model} is not trained for tab-autocomplete, and will result in low-quality suggestions. See the docs to learn more about why: https://continue.dev/docs/walkthroughs/tab-autocomplete#i-want-better-completions-should-i-use-gpt-4`,
|
||||
);
|
||||
}
|
||||
|
||||
// Prompt
|
||||
const fullPrefix = getRangeInString(fileContents, {
|
||||
|
|
@ -367,13 +381,6 @@ export class CompletionProvider {
|
|||
input: AutocompleteInput,
|
||||
token: AbortSignal | undefined,
|
||||
): Promise<AutocompleteOutcome | undefined> {
|
||||
// Create abort signal if not given
|
||||
if (!token) {
|
||||
const controller = new AbortController();
|
||||
token = controller.signal;
|
||||
this._abortControllers.set(input.completionId, controller);
|
||||
}
|
||||
|
||||
try {
|
||||
// Debounce
|
||||
const uuid = uuidv4();
|
||||
|
|
@ -385,6 +392,36 @@ export class CompletionProvider {
|
|||
...config.tabAutocompleteOptions,
|
||||
};
|
||||
|
||||
// Check whether autocomplete is disabled for this file
|
||||
if (options.disableInFiles) {
|
||||
// Relative path needed for `ignore`
|
||||
const workspaceDirs = await this.ide.getWorkspaceDirs();
|
||||
let filepath = input.filepath;
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
if (filepath.startsWith(workspaceDir)) {
|
||||
filepath = path.relative(workspaceDir, filepath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Worst case we can check filetype glob patterns
|
||||
if (filepath === input.filepath) {
|
||||
filepath = getBasename(filepath);
|
||||
}
|
||||
|
||||
const pattern = ignore().add(options.disableInFiles);
|
||||
if (pattern.ignores(filepath)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
// Create abort signal if not given
|
||||
if (!token) {
|
||||
const controller = new AbortController();
|
||||
token = controller.signal;
|
||||
this._abortControllers.set(input.completionId, controller);
|
||||
}
|
||||
|
||||
// Allow disabling autocomplete from config.json
|
||||
if (options.disable) {
|
||||
return undefined;
|
||||
|
|
|
|||
|
|
@ -1,43 +1,58 @@
|
|||
import { CustomCommand, SlashCommand, SlashCommandDescription } from "..";
|
||||
import { stripImages } from "../llm/countTokens";
|
||||
import { renderTemplatedString } from "../llm/llms";
|
||||
import SlashCommands from "./slash";
|
||||
|
||||
export function slashFromCustomCommand(
|
||||
customCommand: CustomCommand,
|
||||
customCommand: CustomCommand,
|
||||
): SlashCommand {
|
||||
return {
|
||||
name: customCommand.name,
|
||||
description: customCommand.description,
|
||||
run: async function* ({ input, llm, history }) {
|
||||
const promptUserInput = `Task: ${customCommand.prompt}. Additional info: ${input}`;
|
||||
const messages = [...history];
|
||||
// Find the last chat message with this slash command and replace it with the user input
|
||||
for (let i = messages.length - 1; i >= 0; i--) {
|
||||
if (
|
||||
messages[i].role === "user" &&
|
||||
stripImages(messages[i].content).startsWith(`/${customCommand.name}`)
|
||||
) {
|
||||
messages[i] = { ...messages[i], content: promptUserInput };
|
||||
break;
|
||||
}
|
||||
}
|
||||
return {
|
||||
name: customCommand.name,
|
||||
description: customCommand.description,
|
||||
run: async function* ({ input, llm, history, ide }) {
|
||||
// Remove slash command prefix from input
|
||||
let userInput = input;
|
||||
if (userInput.startsWith(`/${customCommand.name}`)) {
|
||||
userInput = userInput
|
||||
.slice(customCommand.name.length + 1, userInput.length)
|
||||
.trimStart();
|
||||
}
|
||||
|
||||
for await (const chunk of llm.streamChat(messages)) {
|
||||
yield stripImages(chunk.content);
|
||||
}
|
||||
},
|
||||
};
|
||||
// Render prompt template
|
||||
const promptUserInput = await renderTemplatedString(
|
||||
customCommand.prompt,
|
||||
ide.readFile.bind(ide),
|
||||
{ input: userInput },
|
||||
);
|
||||
|
||||
const messages = [...history];
|
||||
// Find the last chat message with this slash command and replace it with the user input
|
||||
for (let i = messages.length - 1; i >= 0; i--) {
|
||||
if (
|
||||
messages[i].role === "user" &&
|
||||
stripImages(messages[i].content).startsWith(`/${customCommand.name}`)
|
||||
) {
|
||||
messages[i] = { ...messages[i], content: promptUserInput };
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for await (const chunk of llm.streamChat(messages)) {
|
||||
yield stripImages(chunk.content);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function slashCommandFromDescription(
|
||||
desc: SlashCommandDescription,
|
||||
desc: SlashCommandDescription,
|
||||
): SlashCommand | undefined {
|
||||
const cmd = SlashCommands.find((cmd) => cmd.name === desc.name);
|
||||
if (!cmd) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
...cmd,
|
||||
params: desc.params,
|
||||
};
|
||||
const cmd = SlashCommands.find((cmd) => cmd.name === desc.name);
|
||||
if (!cmd) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
...cmd,
|
||||
params: desc.params,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ export const defaultConfig: SerializedContinueConfig = {
|
|||
model: "claude-3-sonnet-20240229",
|
||||
},
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
title: "GPT-4 Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
model: "gpt-4-turbo",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
|
|
@ -55,13 +55,13 @@ export const defaultConfig: SerializedContinueConfig = {
|
|||
},
|
||||
],
|
||||
contextProviders: [
|
||||
{ name: "code", params: {} },
|
||||
{ name: "docs", params: {} },
|
||||
{ name: "diff", params: {} },
|
||||
{
|
||||
name: "open",
|
||||
params: {},
|
||||
},
|
||||
{ name: "open", params: {} },
|
||||
{ name: "terminal", params: {} },
|
||||
{ name: "problems", params: {} },
|
||||
{ name: "folder", params: {} },
|
||||
{ name: "codebase", params: {} },
|
||||
],
|
||||
tabAutocompleteModel: {
|
||||
|
|
@ -79,9 +79,9 @@ export const defaultConfigJetBrains: SerializedContinueConfig = {
|
|||
model: "claude-3-sonnet-20240229",
|
||||
},
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
title: "GPT-4 Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
model: "gpt-4-turbo",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
|
|
@ -121,12 +121,7 @@ export const defaultConfigJetBrains: SerializedContinueConfig = {
|
|||
description: "Write unit tests for highlighted code",
|
||||
},
|
||||
],
|
||||
contextProviders: [
|
||||
{
|
||||
name: "open",
|
||||
params: {},
|
||||
},
|
||||
],
|
||||
contextProviders: [{ name: "open", params: {} }],
|
||||
tabAutocompleteModel: {
|
||||
title: "Starcoder2 3b",
|
||||
provider: "ollama",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { ContinueConfig, ContinueRcJson, IDE, ILLM } from "..";
|
||||
import { IdeSettings } from "../protocol";
|
||||
import { fetchwithRequestOptions } from "../util/fetchWithOptions";
|
||||
import { Telemetry } from "../util/posthog";
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
finalToBrowserConfig,
|
||||
loadFullConfigNode,
|
||||
} from "./load";
|
||||
import { fetchwithRequestOptions } from "../util/fetchWithOptions";
|
||||
|
||||
export class ConfigHandler {
|
||||
private savedConfig: ContinueConfig | undefined;
|
||||
|
|
@ -16,7 +16,7 @@ export class ConfigHandler {
|
|||
private readonly ide: IDE,
|
||||
private ideSettingsPromise: Promise<IdeSettings>,
|
||||
private readonly writeLog: (text: string) => void,
|
||||
private readonly onConfigUpdate: () => void
|
||||
private readonly onConfigUpdate: () => void,
|
||||
) {
|
||||
this.ide = ide;
|
||||
this.ideSettingsPromise = ideSettingsPromise;
|
||||
|
|
@ -76,7 +76,7 @@ export class ConfigHandler {
|
|||
this.ide.readFile,
|
||||
workspaceConfigs,
|
||||
remoteConfigServerUrl,
|
||||
ideInfo.ideType
|
||||
ideInfo.ideType,
|
||||
);
|
||||
this.savedConfig.allowAnonymousTelemetry =
|
||||
this.savedConfig.allowAnonymousTelemetry &&
|
||||
|
|
@ -86,7 +86,7 @@ export class ConfigHandler {
|
|||
await Telemetry.setup(
|
||||
this.savedConfig.allowAnonymousTelemetry ?? true,
|
||||
await this.ide.getUniqueId(),
|
||||
ideInfo.extensionVersion
|
||||
ideInfo.extensionVersion,
|
||||
);
|
||||
|
||||
return this.savedConfig;
|
||||
|
|
@ -94,32 +94,43 @@ export class ConfigHandler {
|
|||
|
||||
setupLlm(llm: ILLM): ILLM {
|
||||
llm._fetch = async (input, init) => {
|
||||
const resp = await fetchwithRequestOptions(
|
||||
new URL(input),
|
||||
{ ...init },
|
||||
llm.requestOptions
|
||||
);
|
||||
|
||||
if (!resp.ok) {
|
||||
let text = await resp.text();
|
||||
if (resp.status === 404 && !resp.url.includes("/v1")) {
|
||||
if (text.includes("try pulling it first")) {
|
||||
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
|
||||
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
|
||||
} else if (text.includes("/api/chat")) {
|
||||
text =
|
||||
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
|
||||
} else {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`
|
||||
try {
|
||||
const resp = await fetchwithRequestOptions(
|
||||
new URL(input),
|
||||
{ ...init },
|
||||
llm.requestOptions,
|
||||
);
|
||||
}
|
||||
if (!resp.ok) {
|
||||
let text = await resp.text();
|
||||
if (resp.status === 404 && !resp.url.includes("/v1")) {
|
||||
if (text.includes("try pulling it first")) {
|
||||
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
|
||||
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
|
||||
} else if (text.includes("/api/chat")) {
|
||||
text =
|
||||
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
|
||||
} else {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`,
|
||||
);
|
||||
}
|
||||
|
||||
return resp;
|
||||
return resp;
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e.code === "ECONNREFUSED" &&
|
||||
e.message.includes("http://127.0.0.1:11434")
|
||||
) {
|
||||
throw new Error(
|
||||
"Failed to connect to local Ollama instance. To start Ollama, first download it at https://ollama.ai.",
|
||||
);
|
||||
}
|
||||
throw new Error(`${e}`);
|
||||
}
|
||||
};
|
||||
|
||||
llm.writeLog = async (log: string) => {
|
||||
|
|
|
|||
|
|
@ -272,13 +272,15 @@ async function intermediateToFinalConfig(
|
|||
}
|
||||
|
||||
// Embeddings Provider
|
||||
if (
|
||||
(config.embeddingsProvider as EmbeddingsProviderDescription | undefined)
|
||||
?.provider
|
||||
) {
|
||||
const { provider, ...options } =
|
||||
config.embeddingsProvider as EmbeddingsProviderDescription;
|
||||
config.embeddingsProvider = new AllEmbeddingsProviders[provider](options);
|
||||
const embeddingsProviderDescription = config.embeddingsProvider as
|
||||
| EmbeddingsProviderDescription
|
||||
| undefined;
|
||||
if (embeddingsProviderDescription?.provider) {
|
||||
const { provider, ...options } = embeddingsProviderDescription;
|
||||
const embeddingsProviderClass = AllEmbeddingsProviders[provider];
|
||||
if (embeddingsProviderClass) {
|
||||
config.embeddingsProvider = new embeddingsProviderClass(options);
|
||||
}
|
||||
}
|
||||
|
||||
if (!config.embeddingsProvider) {
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ export function setupOptimizedMode(
|
|||
model: "claude-3-sonnet-20240229",
|
||||
},
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
title: "GPT-4 Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
model: "gpt-4-turbo",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
|
|
@ -71,6 +71,11 @@ export function setupLocalMode(
|
|||
return {
|
||||
...config,
|
||||
models: [
|
||||
{
|
||||
title: "Llama 3",
|
||||
provider: "ollama",
|
||||
model: "llama3",
|
||||
},
|
||||
{
|
||||
title: "Ollama",
|
||||
provider: "ollama",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ declare global {
|
|||
postIntellijMessage?: (
|
||||
messageType: string,
|
||||
data: any,
|
||||
messageIde: string
|
||||
messageIde: string,
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
|
|
@ -45,6 +45,14 @@ declare global {
|
|||
prompt: string;
|
||||
completion: string;
|
||||
}
|
||||
|
||||
export type PromptTemplate =
|
||||
| string
|
||||
| ((
|
||||
history: ChatMessage[],
|
||||
otherData: Record<string, string>,
|
||||
) => string | ChatMessage[]);
|
||||
|
||||
export interface ILLM extends LLMOptions {
|
||||
get providerName(): ModelProvider;
|
||||
|
||||
|
|
@ -75,24 +83,35 @@ declare global {
|
|||
|
||||
streamComplete(
|
||||
prompt: string,
|
||||
options?: LLMFullCompletionOptions
|
||||
options?: LLMFullCompletionOptions,
|
||||
): AsyncGenerator<string, LLMReturnValue>;
|
||||
|
||||
streamChat(
|
||||
messages: ChatMessage[],
|
||||
options?: LLMFullCompletionOptions
|
||||
options?: LLMFullCompletionOptions,
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue>;
|
||||
|
||||
chat(
|
||||
messages: ChatMessage[],
|
||||
options?: LLMFullCompletionOptions
|
||||
options?: LLMFullCompletionOptions,
|
||||
): Promise<ChatMessage>;
|
||||
|
||||
countTokens(text: string): number;
|
||||
|
||||
supportsImages(): boolean;
|
||||
|
||||
supportsCompletions(): boolean;
|
||||
|
||||
supportsPrefill(): boolean;
|
||||
|
||||
listModels(): Promise<string[]>;
|
||||
|
||||
renderPromptTemplate(
|
||||
template: PromptTemplate,
|
||||
history: ChatMessage[],
|
||||
otherData: Record<string, string>,
|
||||
canPutWordsInModelsMouth?: boolean,
|
||||
): string | ChatMessage[];
|
||||
}
|
||||
|
||||
export type ContextProviderType = "normal" | "query" | "submenu";
|
||||
|
|
@ -108,6 +127,7 @@ declare global {
|
|||
export interface ContextProviderExtras {
|
||||
fullInput: string;
|
||||
embeddingsProvider: EmbeddingsProvider;
|
||||
reranker: Reranker | undefined;
|
||||
llm: ILLM;
|
||||
ide: IDE;
|
||||
selectedCode: RangeInFile[];
|
||||
|
|
@ -125,10 +145,10 @@ declare global {
|
|||
type?: ContextProviderType;
|
||||
getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras
|
||||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]>;
|
||||
loadSubmenuItems?: (
|
||||
args: LoadSubmenuItemsArgs
|
||||
args: LoadSubmenuItemsArgs,
|
||||
) => Promise<ContextSubmenuItem[]>;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +163,7 @@ declare global {
|
|||
|
||||
getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras
|
||||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]>;
|
||||
|
||||
loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise<ContextSubmenuItem[]>;
|
||||
|
|
@ -168,6 +188,11 @@ declare global {
|
|||
range: Range;
|
||||
}
|
||||
|
||||
export interface FileWithContents {
|
||||
filepath: string;
|
||||
contents: string;
|
||||
}
|
||||
|
||||
export interface Range {
|
||||
start: Position;
|
||||
end: Position;
|
||||
|
|
@ -228,9 +253,14 @@ declare global {
|
|||
editable?: boolean;
|
||||
}
|
||||
|
||||
export interface InputModifiers {
|
||||
useCodebase: boolean;
|
||||
}
|
||||
|
||||
export interface ChatHistoryItem {
|
||||
message: ChatMessage;
|
||||
editorState?: any;
|
||||
modifiers?: InputModifiers;
|
||||
contextItems: ContextItemWithId[];
|
||||
promptLogs?: [string, string][]; // [prompt, completion]
|
||||
}
|
||||
|
|
@ -240,7 +270,6 @@ declare global {
|
|||
// LLM
|
||||
|
||||
export interface LLMFullCompletionOptions extends BaseCompletionOptions {
|
||||
raw?: boolean;
|
||||
log?: boolean;
|
||||
|
||||
model?: string;
|
||||
|
|
@ -262,6 +291,8 @@ declare global {
|
|||
apiKey?: string;
|
||||
apiBase?: string;
|
||||
|
||||
useLegacyCompletionsEndpoint?: boolean;
|
||||
|
||||
// Azure options
|
||||
engine?: string;
|
||||
apiVersion?: string;
|
||||
|
|
@ -284,15 +315,15 @@ declare global {
|
|||
streamCompletion?: (
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
|
||||
) => AsyncGenerator<string>;
|
||||
streamChat?: (
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
|
||||
) => AsyncGenerator<string>;
|
||||
listModels?: (
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
|
||||
) => Promise<string[]>;
|
||||
}
|
||||
|
||||
|
|
@ -317,12 +348,27 @@ declare global {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export class Thread {
|
||||
name: string;
|
||||
id: number;
|
||||
}
|
||||
|
||||
export type IdeType = "vscode" | "jetbrains";
|
||||
export interface IdeInfo {
|
||||
ideType: IdeType;
|
||||
name: string;
|
||||
version: string;
|
||||
remoteName: string;
|
||||
extensionVersion: string;
|
||||
}
|
||||
|
||||
export interface BranchAndDir {
|
||||
branch: string;
|
||||
directory: string;
|
||||
}
|
||||
|
||||
export interface IndexTag extends BranchAndDir {
|
||||
artifactId: string;
|
||||
}
|
||||
|
||||
export interface IDE {
|
||||
|
|
@ -331,6 +377,12 @@ declare global {
|
|||
isTelemetryEnabled(): Promise<boolean>;
|
||||
getUniqueId(): Promise<string>;
|
||||
getTerminalContents(): Promise<string>;
|
||||
getDebugLocals(threadIndex: number): Promise<string>;
|
||||
getTopLevelCallStackSources(
|
||||
threadIndex: number,
|
||||
stackDepth: number,
|
||||
): Promise<string[]>;
|
||||
getAvailableThreads(): Promise<Thread[]>;
|
||||
listWorkspaceContents(directory?: string): Promise<string[]>;
|
||||
listFolders(): Promise<string[]>;
|
||||
getWorkspaceDirs(): Promise<string[]>;
|
||||
|
|
@ -346,12 +398,12 @@ declare global {
|
|||
showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number
|
||||
endLine: number,
|
||||
): Promise<void>;
|
||||
showDiff(
|
||||
filepath: string,
|
||||
newContents: string,
|
||||
stepIndex: number
|
||||
stepIndex: number,
|
||||
): Promise<void>;
|
||||
getOpenFiles(): Promise<string[]>;
|
||||
getPinnedFiles(): Promise<string[]>;
|
||||
|
|
@ -360,6 +412,8 @@ declare global {
|
|||
getProblems(filepath?: string | undefined): Promise<Problem[]>;
|
||||
getBranch(dir: string): Promise<string>;
|
||||
getStats(directory: string): Promise<{ [path: string]: number }>;
|
||||
getTags(artifactId: string): Promise<IndexTag[]>;
|
||||
getRepoName(dir: string): Promise<string | undefined>;
|
||||
}
|
||||
|
||||
// Slash Commands
|
||||
|
|
@ -405,6 +459,7 @@ declare global {
|
|||
| "diff"
|
||||
| "github"
|
||||
| "terminal"
|
||||
| "locals"
|
||||
| "open"
|
||||
| "google"
|
||||
| "search"
|
||||
|
|
@ -412,7 +467,14 @@ declare global {
|
|||
| "http"
|
||||
| "codebase"
|
||||
| "problems"
|
||||
| "folder";
|
||||
| "folder"
|
||||
| "jira"
|
||||
| "postgres"
|
||||
| "database"
|
||||
| "code"
|
||||
| "docs"
|
||||
| "gitlab-mr"
|
||||
| "os";
|
||||
|
||||
type TemplateType =
|
||||
| "llama2"
|
||||
|
|
@ -428,7 +490,8 @@ declare global {
|
|||
| "xwin-coder"
|
||||
| "neural-chat"
|
||||
| "codellama-70b"
|
||||
| "llava";
|
||||
| "llava"
|
||||
| "gemma";
|
||||
|
||||
type ModelProvider =
|
||||
| "openai"
|
||||
|
|
@ -441,14 +504,15 @@ declare global {
|
|||
| "llama.cpp"
|
||||
| "replicate"
|
||||
| "text-gen-webui"
|
||||
| "google-palm"
|
||||
| "gemini"
|
||||
| "lmstudio"
|
||||
| "llamafile"
|
||||
| "gemini"
|
||||
| "mistral"
|
||||
| "bedrock"
|
||||
| "deepinfra"
|
||||
| "flowise";
|
||||
| "flowise"
|
||||
| "groq";
|
||||
|
||||
export type ModelName =
|
||||
| "AUTODETECT"
|
||||
|
|
@ -465,6 +529,7 @@ declare global {
|
|||
| "mistral-8x7b"
|
||||
| "llama2-7b"
|
||||
| "llama2-13b"
|
||||
| "llama2-70b"
|
||||
| "codellama-7b"
|
||||
| "codellama-13b"
|
||||
| "codellama-34b"
|
||||
|
|
@ -481,8 +546,10 @@ declare global {
|
|||
| "neural-chat-7b"
|
||||
// Anthropic
|
||||
| "claude-2"
|
||||
// Google PaLM
|
||||
| "chat-bison-001"
|
||||
| "claude-3-opus-20240229"
|
||||
| "claude-3-sonnet-20240229"
|
||||
| "claude-3-haiku-20240307"
|
||||
| "claude-2.1"
|
||||
// Gemini
|
||||
| "gemini-pro"
|
||||
| "gemini-1.5-pro-latest"
|
||||
|
|
@ -494,6 +561,7 @@ declare global {
|
|||
| "deepseek-1b"
|
||||
| "starcoder-1b"
|
||||
| "starcoder-3b"
|
||||
| "starcoder2-3b"
|
||||
| "stable-code-3b";
|
||||
|
||||
export interface RequestOptions {
|
||||
|
|
@ -537,6 +605,10 @@ declare global {
|
|||
mirostat?: number;
|
||||
stop?: string[];
|
||||
maxTokens?: number;
|
||||
numThreads?: number;
|
||||
keepAlive?: number;
|
||||
raw?: boolean;
|
||||
stream?: boolean;
|
||||
}
|
||||
|
||||
export interface ModelDescription {
|
||||
|
|
@ -553,7 +625,11 @@ declare global {
|
|||
promptTemplates?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export type EmbeddingsProviderName = "transformers.js" | "ollama" | "openai";
|
||||
export type EmbeddingsProviderName =
|
||||
| "transformers.js"
|
||||
| "ollama"
|
||||
| "openai"
|
||||
| "free-trial";
|
||||
|
||||
export interface EmbedOptions {
|
||||
apiBase?: string;
|
||||
|
|
@ -570,7 +646,20 @@ declare global {
|
|||
embed(chunks: string[]): Promise<number[][]>;
|
||||
}
|
||||
|
||||
export type RerankerName = "voyage" | "llm" | "free-trial";
|
||||
|
||||
export interface RerankerDescription {
|
||||
name: RerankerName;
|
||||
params?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface Reranker {
|
||||
name: string;
|
||||
rerank(query: string, chunks: Chunk[]): Promise<number[]>;
|
||||
}
|
||||
|
||||
export interface TabAutocompleteOptions {
|
||||
disable: boolean;
|
||||
useCopyBuffer: boolean;
|
||||
useSuffix: boolean;
|
||||
maxPromptTokens: number;
|
||||
|
|
@ -578,10 +667,33 @@ declare global {
|
|||
maxSuffixPercentage: number;
|
||||
prefixPercentage: number;
|
||||
template?: string;
|
||||
disableMultiLineCompletions?: boolean;
|
||||
multilineCompletions: "always" | "never" | "auto";
|
||||
slidingWindowPrefixPercentage: number;
|
||||
slidingWindowSize: number;
|
||||
maxSnippetPercentage: number;
|
||||
recentlyEditedSimilarityThreshold: number;
|
||||
useCache: boolean;
|
||||
onlyMyCode: boolean;
|
||||
useOtherFiles: boolean;
|
||||
}
|
||||
|
||||
export interface ContinueUIConfig {
|
||||
codeBlockToolbarPosition?: "top" | "bottom";
|
||||
}
|
||||
|
||||
interface ContextMenuConfig {
|
||||
comment?: string;
|
||||
docstring?: string;
|
||||
fix?: string;
|
||||
optimize?: string;
|
||||
fixGrammar?: string;
|
||||
}
|
||||
interface ExperimantalConfig {
|
||||
contextMenuPrompts?: ContextMenuConfig;
|
||||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
env?: string[];
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
models: ModelDescription[];
|
||||
systemMessage?: string;
|
||||
|
|
@ -595,6 +707,9 @@ declare global {
|
|||
embeddingsProvider?: EmbeddingsProviderDescription;
|
||||
tabAutocompleteModel?: ModelDescription;
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: RerankerDescription;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export type ConfigMergeType = "merge" | "overwrite";
|
||||
|
|
@ -633,6 +748,12 @@ declare global {
|
|||
tabAutocompleteModel?: CustomLLM | ModelDescription;
|
||||
/** Options for tab autocomplete */
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
/** UI styles customization */
|
||||
ui?: ContinueUIConfig;
|
||||
/** Options for the reranker */
|
||||
reranker?: RerankerDescription | Reranker;
|
||||
/** Experimental configuration */
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export interface ContinueConfig {
|
||||
|
|
@ -648,6 +769,9 @@ declare global {
|
|||
embeddingsProvider: EmbeddingsProvider;
|
||||
tabAutocompleteModel?: ILLM;
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: Reranker;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export interface BrowserSerializedContinueConfig {
|
||||
|
|
@ -661,6 +785,9 @@ declare global {
|
|||
disableSessionTitles?: boolean;
|
||||
userToken?: string;
|
||||
embeddingsProvider?: string;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: RerankerDescription;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
} from "../..";
|
||||
import { fetchwithRequestOptions } from "../../util/fetchWithOptions";
|
||||
|
||||
class HttpContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
|
|
@ -28,18 +29,21 @@ class HttpContextProvider extends BaseContextProvider {
|
|||
query: string,
|
||||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]> {
|
||||
const response = await fetch(this.options.url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: query || "",
|
||||
fullInput: extras.fullInput,
|
||||
}),
|
||||
});
|
||||
|
||||
const json = await response.json();
|
||||
const response = await fetchwithRequestOptions(
|
||||
new URL(this.options.url),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: query || "",
|
||||
fullInput: extras.fullInput,
|
||||
}),
|
||||
}
|
||||
);
|
||||
|
||||
const json: any = await response.json();
|
||||
return [
|
||||
{
|
||||
description: json.description || "HTTP Context Item",
|
||||
|
|
|
|||
|
|
@ -66,24 +66,26 @@ export async function retrieveContextItemsFromEmbeddings(
|
|||
// Source: expansion with code graph
|
||||
// consider doing this after reranking? Or just having a lower reranking threshold
|
||||
// This is VS Code only until we use PSI for JetBrains or build our own general solution
|
||||
if ((await extras.ide.getIdeInfo()).ideType === "vscode") {
|
||||
const { expandSnippet } = await import(
|
||||
"../../../extensions/vscode/src/util/expandSnippet"
|
||||
);
|
||||
let expansionResults = (
|
||||
await Promise.all(
|
||||
extras.selectedCode.map(async (rif) => {
|
||||
return expandSnippet(
|
||||
rif.filepath,
|
||||
rif.range.start.line,
|
||||
rif.range.end.line,
|
||||
extras.ide,
|
||||
);
|
||||
}),
|
||||
)
|
||||
).flat() as Chunk[];
|
||||
retrievalResults.push(...expansionResults);
|
||||
}
|
||||
// TODO: Need to pass in the expandSnippet function as a function argument
|
||||
// because this import causes `tsc` to fail
|
||||
// if ((await extras.ide.getIdeInfo()).ideType === "vscode") {
|
||||
// const { expandSnippet } = await import(
|
||||
// "../../../extensions/vscode/src/util/expandSnippet"
|
||||
// );
|
||||
// let expansionResults = (
|
||||
// await Promise.all(
|
||||
// extras.selectedCode.map(async (rif) => {
|
||||
// return expandSnippet(
|
||||
// rif.filepath,
|
||||
// rif.range.start.line,
|
||||
// rif.range.end.line,
|
||||
// extras.ide,
|
||||
// );
|
||||
// }),
|
||||
// )
|
||||
// ).flat() as Chunk[];
|
||||
// retrievalResults.push(...expansionResults);
|
||||
// }
|
||||
|
||||
// Source: Open file exact match
|
||||
// Source: Class/function name exact match
|
||||
|
|
|
|||
16
core/index.d.ts
vendored
16
core/index.d.ts
vendored
|
|
@ -495,6 +495,7 @@ type ModelProvider =
|
|||
| "openai"
|
||||
| "free-trial"
|
||||
| "anthropic"
|
||||
| "cohere"
|
||||
| "together"
|
||||
| "ollama"
|
||||
| "huggingface-tgi"
|
||||
|
|
@ -502,7 +503,6 @@ type ModelProvider =
|
|||
| "llama.cpp"
|
||||
| "replicate"
|
||||
| "text-gen-webui"
|
||||
| "google-palm"
|
||||
| "lmstudio"
|
||||
| "llamafile"
|
||||
| "gemini"
|
||||
|
|
@ -520,11 +520,13 @@ export type ModelName =
|
|||
| "gpt-4"
|
||||
| "gpt-3.5-turbo-0613"
|
||||
| "gpt-4-32k"
|
||||
| "gpt-4-turbo"
|
||||
| "gpt-4-turbo-preview"
|
||||
| "gpt-4-vision-preview"
|
||||
// Open Source
|
||||
// Mistral
|
||||
| "mistral-7b"
|
||||
| "mistral-8x7b"
|
||||
// Llama 2
|
||||
| "llama2-7b"
|
||||
| "llama2-13b"
|
||||
| "llama2-70b"
|
||||
|
|
@ -532,6 +534,10 @@ export type ModelName =
|
|||
| "codellama-13b"
|
||||
| "codellama-34b"
|
||||
| "codellama-70b"
|
||||
// Llama 3
|
||||
| "llama3-8b"
|
||||
| "llama3-70b"
|
||||
// Other Open-source
|
||||
| "phi2"
|
||||
| "phind-codellama-34b"
|
||||
| "wizardcoder-7b"
|
||||
|
|
@ -548,8 +554,9 @@ export type ModelName =
|
|||
| "claude-3-sonnet-20240229"
|
||||
| "claude-3-haiku-20240307"
|
||||
| "claude-2.1"
|
||||
// Google PaLM
|
||||
| "chat-bison-001"
|
||||
// Cohere
|
||||
| "command-r"
|
||||
| "command-r-plus"
|
||||
// Gemini
|
||||
| "gemini-pro"
|
||||
| "gemini-1.5-pro-latest"
|
||||
|
|
@ -675,6 +682,7 @@ export interface TabAutocompleteOptions {
|
|||
useCache: boolean;
|
||||
onlyMyCode: boolean;
|
||||
useOtherFiles: boolean;
|
||||
disableInFiles?: string[];
|
||||
}
|
||||
|
||||
export interface ContinueUIConfig {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const DEFAULT_IGNORE_FILETYPES = [
|
|||
"*.dll",
|
||||
"*.obj",
|
||||
"*.o",
|
||||
"*.o.d",
|
||||
"*.a",
|
||||
"*.lib",
|
||||
"*.so",
|
||||
|
|
@ -54,6 +55,9 @@ const DEFAULT_IGNORE_FILETYPES = [
|
|||
"*.sqlite",
|
||||
"*.wasm",
|
||||
"*.plist",
|
||||
"*.profraw",
|
||||
"*.gcda",
|
||||
"*.gcno",
|
||||
];
|
||||
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);
|
||||
export const DEFAULT_IGNORE_DIRS = [
|
||||
|
|
@ -76,5 +80,6 @@ export const DEFAULT_IGNORE_DIRS = [
|
|||
".continue",
|
||||
"__pycache__",
|
||||
"site-packages",
|
||||
".cache",
|
||||
];
|
||||
export const defaultIgnoreDir = ignore().add(DEFAULT_IGNORE_DIRS);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@ export class CodebaseIndexer {
|
|||
|
||||
// Wait until Git Extension has loaded to report progress
|
||||
// so we don't appear stuck at 0% while waiting
|
||||
await this.ide.getRepoName(workspaceDirs[0]);
|
||||
if (workspaceDirs.length > 0) {
|
||||
await this.ide.getRepoName(workspaceDirs[0]);
|
||||
}
|
||||
yield {
|
||||
progress: 0,
|
||||
desc: "Starting indexing...",
|
||||
|
|
|
|||
|
|
@ -44,32 +44,38 @@ const PROVIDER_HANDLES_TEMPLATING: ModelProvider[] = [
|
|||
const PROVIDER_SUPPORTS_IMAGES: ModelProvider[] = [
|
||||
"openai",
|
||||
"ollama",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"free-trial",
|
||||
"anthropic",
|
||||
"bedrock",
|
||||
];
|
||||
|
||||
function modelSupportsImages(provider: ModelProvider, model: string): boolean {
|
||||
const MODEL_SUPPORTS_IMAGES: string[] = [
|
||||
"llava",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision",
|
||||
"claude-3",
|
||||
"gemini-ultra",
|
||||
"gemini-1.5-pro",
|
||||
"sonnet",
|
||||
"opus",
|
||||
"haiku",
|
||||
];
|
||||
|
||||
function modelSupportsImages(
|
||||
provider: ModelProvider,
|
||||
model: string,
|
||||
title: string | undefined,
|
||||
): boolean {
|
||||
if (!PROVIDER_SUPPORTS_IMAGES.includes(provider)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model.includes("llava")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (model.includes("claude-3")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (["gpt-4-vision-preview"].includes(model)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const lower = model.toLowerCase();
|
||||
if (
|
||||
model === "gemini-ultra" &&
|
||||
(provider === "google-palm" || provider === "free-trial")
|
||||
MODEL_SUPPORTS_IMAGES.some(
|
||||
(modelName) => lower.includes(modelName) || title?.includes(modelName),
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -81,7 +87,7 @@ const PARALLEL_PROVIDERS: ModelProvider[] = [
|
|||
"bedrock",
|
||||
"deepinfra",
|
||||
"gemini",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"huggingface-inference-api",
|
||||
"huggingface-tgi",
|
||||
"mistral",
|
||||
|
|
@ -110,6 +116,7 @@ function autodetectTemplateType(model: string): TemplateType | undefined {
|
|||
|
||||
if (
|
||||
lower.includes("gpt") ||
|
||||
lower.includes("command") ||
|
||||
lower.includes("chat-bison") ||
|
||||
lower.includes("pplx") ||
|
||||
lower.includes("gemini")
|
||||
|
|
@ -277,6 +284,8 @@ function autodetectPromptTemplates(
|
|||
editTemplate = claudeEditPrompt;
|
||||
} else if (templateType === "gemma") {
|
||||
editTemplate = gemmaEditPrompt;
|
||||
} else if (templateType === "none") {
|
||||
editTemplate = null;
|
||||
} else if (templateType) {
|
||||
editTemplate = gptEditPrompt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
import { DevDataSqliteDb } from "../util/devdataSqlite";
|
||||
import mergeJson from "../util/merge";
|
||||
import { Telemetry } from "../util/posthog";
|
||||
import { withExponentialBackoff } from "../util/withExponentialBackoff";
|
||||
import {
|
||||
autodetectPromptTemplates,
|
||||
autodetectTemplateFunction,
|
||||
|
|
@ -44,7 +45,25 @@ export abstract class BaseLLM implements ILLM {
|
|||
}
|
||||
|
||||
supportsImages(): boolean {
|
||||
return modelSupportsImages(this.providerName, this.model);
|
||||
return modelSupportsImages(this.providerName, this.model, this.title);
|
||||
}
|
||||
|
||||
supportsCompletions(): boolean {
|
||||
if (this.providerName === "openai") {
|
||||
if (
|
||||
this.apiBase?.includes("api.groq.com") ||
|
||||
this.apiBase?.includes(":1337") ||
|
||||
this._llmOptions.useLegacyCompletionsEndpoint?.valueOf() === false
|
||||
) {
|
||||
// Jan + Groq don't support completions : (
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
supportsPrefill(): boolean {
|
||||
return ["ollama", "anthropic"].includes(this.providerName);
|
||||
}
|
||||
|
||||
supportsCompletions(): boolean {
|
||||
|
|
@ -234,7 +253,12 @@ ${prompt}`;
|
|||
): Promise<Response> {
|
||||
if (this._fetch) {
|
||||
// Custom Node.js fetch
|
||||
return this._fetch(url, init);
|
||||
const customFetch = this._fetch;
|
||||
return withExponentialBackoff<Response>(
|
||||
() => customFetch(url, init),
|
||||
5,
|
||||
0.5,
|
||||
);
|
||||
}
|
||||
|
||||
// Most of the requestOptions aren't available in the browser
|
||||
|
|
@ -245,10 +269,12 @@ ${prompt}`;
|
|||
headers.append(key, value as string);
|
||||
}
|
||||
|
||||
return fetch(url, {
|
||||
...init,
|
||||
headers,
|
||||
});
|
||||
return withExponentialBackoff<Response>(() =>
|
||||
fetch(url, {
|
||||
...init,
|
||||
headers,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _parseCompletionOptions(options: LLMFullCompletionOptions) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import * as fs from "fs";
|
||||
import os from "os";
|
||||
import { join as joinPath } from "path";
|
||||
import { promisify } from "util";
|
||||
import { BaseLLM } from "..";
|
||||
|
|
@ -143,7 +144,7 @@ class Bedrock extends BaseLLM {
|
|||
|
||||
try {
|
||||
const data = await readFile(
|
||||
joinPath(process.env.HOME!, ".aws", "credentials"),
|
||||
joinPath(process.env.HOME ?? os.homedir(), ".aws", "credentials"),
|
||||
"utf8",
|
||||
);
|
||||
const credentials = this._parseCredentialsFile(data);
|
||||
|
|
|
|||
92
core/llm/llms/Cohere.ts
Normal file
92
core/llm/llms/Cohere.ts
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
import { BaseLLM } from "..";
|
||||
import {
|
||||
ChatMessage,
|
||||
CompletionOptions,
|
||||
LLMOptions,
|
||||
ModelProvider,
|
||||
} from "../..";
|
||||
import { stripImages } from "../countTokens";
|
||||
import { streamJSON } from "../stream";
|
||||
|
||||
class Cohere extends BaseLLM {
|
||||
static providerName: ModelProvider = "cohere";
|
||||
static defaultOptions: Partial<LLMOptions> = {
|
||||
apiBase: "https://api.cohere.ai/v1",
|
||||
};
|
||||
static maxStopSequences = 5;
|
||||
|
||||
private _convertMessages(msgs: ChatMessage[]): any[] {
|
||||
const messages = [];
|
||||
for (const m of msgs) {
|
||||
if (m.role === "system" || !m.content) {
|
||||
continue;
|
||||
}
|
||||
messages.push({
|
||||
role: m.role === "assistant" ? "chatbot" : m.role,
|
||||
message: m.content,
|
||||
});
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
|
||||
private _convertArgs(options: CompletionOptions) {
|
||||
return {
|
||||
model: options.model,
|
||||
stream: options.stream ?? true,
|
||||
temperature: options.temperature,
|
||||
max_tokens: options.maxTokens,
|
||||
k: options.topK,
|
||||
p: options.topP,
|
||||
stop_sequences: options.stop?.slice(0, Cohere.maxStopSequences),
|
||||
frequency_penalty: options.frequencyPenalty,
|
||||
presence_penalty: options.presencePenalty,
|
||||
raw_prompting: options.raw,
|
||||
};
|
||||
}
|
||||
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<string> {
|
||||
const messages = [{ role: "user" as const, content: prompt }];
|
||||
for await (const update of this._streamChat(messages, options)) {
|
||||
yield stripImages(update.content);
|
||||
}
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const headers = {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${this.apiKey}`,
|
||||
...this.requestOptions?.headers,
|
||||
};
|
||||
|
||||
const resp = await this.fetch(new URL("chat", this.apiBase), {
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify({
|
||||
...this._convertArgs(options),
|
||||
message: messages.pop()?.content,
|
||||
chat_history: this._convertMessages(messages),
|
||||
preamble: this.systemMessage,
|
||||
}),
|
||||
});
|
||||
|
||||
if (options.stream === false) {
|
||||
const data = await resp.json();
|
||||
yield { role: "assistant", content: data.text };
|
||||
return;
|
||||
}
|
||||
|
||||
for await (const value of streamJSON(resp)) {
|
||||
if (value.event_type === "text-generation") {
|
||||
yield { role: "assistant", content: value.text };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Cohere;
|
||||
|
|
@ -95,8 +95,8 @@ class FreeTrial extends BaseLLM {
|
|||
return [
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-4",
|
||||
"gemini-pro",
|
||||
"gpt-4-vision-preview",
|
||||
"gemini-1.5-pro-latest",
|
||||
"gpt-4-turbo",
|
||||
"codellama-70b",
|
||||
"claude-3-opus-20240229",
|
||||
"claude-3-sonnet-20240229",
|
||||
|
|
|
|||
|
|
@ -3,70 +3,179 @@ import {
|
|||
ChatMessage,
|
||||
CompletionOptions,
|
||||
LLMOptions,
|
||||
MessagePart,
|
||||
ModelProvider,
|
||||
} from "../..";
|
||||
import { stripImages } from "../countTokens";
|
||||
import { streamResponse } from "../stream";
|
||||
|
||||
class Gemini extends BaseLLM {
|
||||
static providerName: ModelProvider = "gemini";
|
||||
|
||||
static defaultOptions: Partial<LLMOptions> = {
|
||||
model: "gemini-pro",
|
||||
region: "us-central1",
|
||||
apiBase: "https://generativelanguage.googleapis.com/v1beta/",
|
||||
};
|
||||
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<string> {
|
||||
for await (const chunk of this._streamChat(
|
||||
[{ role: "user", content: prompt }],
|
||||
for await (const message of this._streamChat(
|
||||
[{ content: prompt, role: "user" }],
|
||||
options,
|
||||
)) {
|
||||
yield stripImages(chunk.content);
|
||||
yield stripImages(message.content);
|
||||
}
|
||||
}
|
||||
|
||||
private removeSystemMessage(messages: ChatMessage[]) {
|
||||
const msgs = [...messages];
|
||||
|
||||
if (msgs[0]?.role === "system") {
|
||||
let sysMsg = msgs.shift()!.content;
|
||||
// @ts-ignore
|
||||
if (msgs[0]?.role === "user") {
|
||||
msgs[0].content = `System message - follow these instructions in every response: ${sysMsg}\n\n---\n\n${msgs[0].content}`;
|
||||
}
|
||||
}
|
||||
|
||||
return msgs;
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const apiUrl = `https://${this.region}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/${this.region}/publishers/google/models/gemini-pro:streamGenerateContent`;
|
||||
let convertedMsgs = this.removeSystemMessage(messages);
|
||||
if (options.model.includes("gemini")) {
|
||||
for await (const message of this.streamChatGemini(
|
||||
convertedMsgs,
|
||||
options,
|
||||
)) {
|
||||
yield message;
|
||||
}
|
||||
} else {
|
||||
for await (const message of this.streamChatBison(
|
||||
convertedMsgs,
|
||||
options,
|
||||
)) {
|
||||
yield message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _continuePartToGeminiPart(part: MessagePart) {
|
||||
return part.type === "text"
|
||||
? {
|
||||
text: part.text,
|
||||
}
|
||||
: {
|
||||
inlineData: {
|
||||
mimeType: "image/jpeg",
|
||||
data: part.imageUrl?.url.split(",")[1],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *streamChatGemini(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const apiURL = new URL(
|
||||
`models/${options.model}:streamGenerateContent?key=${this.apiKey}`,
|
||||
this.apiBase,
|
||||
);
|
||||
const body = {
|
||||
contents: messages.map((msg) => {
|
||||
return {
|
||||
role: msg.role === "assistant" ? "ASSISTANT" : "USER",
|
||||
parts: [{ text: msg.content }],
|
||||
role: msg.role === "assistant" ? "model" : "user",
|
||||
parts:
|
||||
typeof msg.content === "string"
|
||||
? [{ text: msg.content }]
|
||||
: msg.content.map(this._continuePartToGeminiPart),
|
||||
};
|
||||
}),
|
||||
generationConfig: {
|
||||
temperature: options.temperature,
|
||||
topP: options.topP,
|
||||
topK: options.topK,
|
||||
candidateCount: 1,
|
||||
maxOutputTokens: options.maxTokens,
|
||||
stopSequences: options.stop,
|
||||
},
|
||||
};
|
||||
const response = await this.fetch(apiUrl, {
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.apiKey}`,
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
});
|
||||
const data = await response.json();
|
||||
if (data[0]?.error) {
|
||||
throw new Error(data[0].error.message);
|
||||
|
||||
let buffer = "";
|
||||
for await (const chunk of streamResponse(response)) {
|
||||
buffer += chunk;
|
||||
if (buffer.startsWith("[")) {
|
||||
buffer = buffer.slice(1);
|
||||
}
|
||||
if (buffer.endsWith("]")) {
|
||||
buffer = buffer.slice(0, -1);
|
||||
}
|
||||
if (buffer.startsWith(",")) {
|
||||
buffer = buffer.slice(1);
|
||||
}
|
||||
|
||||
const parts = buffer.split("\n,");
|
||||
|
||||
let foundIncomplete = false;
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const part = parts[i];
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(part);
|
||||
} catch (e) {
|
||||
foundIncomplete = true;
|
||||
continue;
|
||||
}
|
||||
if (data.error) {
|
||||
throw new Error(data.error.message);
|
||||
}
|
||||
|
||||
// Incrementally stream the content to make it smoother
|
||||
const content = data.candidates[0].content.parts[0].text;
|
||||
const words = content.split(" ");
|
||||
const delaySeconds = Math.min(4.0 / (words.length + 1), 0.1);
|
||||
while (words.length > 0) {
|
||||
const wordsToYield = Math.min(3, words.length);
|
||||
yield {
|
||||
role: "assistant",
|
||||
content: words.splice(0, wordsToYield).join(" ") + " ",
|
||||
};
|
||||
await delay(delaySeconds);
|
||||
}
|
||||
}
|
||||
if (foundIncomplete) {
|
||||
buffer = parts[parts.length - 1];
|
||||
} else {
|
||||
buffer = "";
|
||||
}
|
||||
}
|
||||
let combinedText = "";
|
||||
for (const entry of data || []) {
|
||||
combinedText += entry?.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
||||
}
|
||||
private async *streamChatBison(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const msgList = [];
|
||||
for (const message of messages) {
|
||||
msgList.push({ content: message.content });
|
||||
}
|
||||
|
||||
yield { role: "assistant", content: combinedText.trim() };
|
||||
const apiURL = new URL(
|
||||
`models/${options.model}:generateMessage?key=${this.apiKey}`,
|
||||
this.apiBase,
|
||||
);
|
||||
const body = { prompt: { messages: msgList } };
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
const data = await response.json();
|
||||
yield { role: "assistant", content: data.candidates[0].content };
|
||||
}
|
||||
}
|
||||
|
||||
async function delay(seconds: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
|
||||
export default Gemini;
|
||||
|
|
|
|||
|
|
@ -1,181 +0,0 @@
|
|||
import { BaseLLM } from "..";
|
||||
import {
|
||||
ChatMessage,
|
||||
CompletionOptions,
|
||||
LLMOptions,
|
||||
MessagePart,
|
||||
ModelProvider,
|
||||
} from "../..";
|
||||
import { stripImages } from "../countTokens";
|
||||
import { streamResponse } from "../stream";
|
||||
|
||||
class GooglePalm extends BaseLLM {
|
||||
static providerName: ModelProvider = "google-palm";
|
||||
|
||||
static defaultOptions: Partial<LLMOptions> = {
|
||||
model: "gemini-pro",
|
||||
apiBase: "https://generativelanguage.googleapis.com/v1beta/",
|
||||
};
|
||||
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<string> {
|
||||
for await (const message of this._streamChat(
|
||||
[{ content: prompt, role: "user" }],
|
||||
options,
|
||||
)) {
|
||||
yield stripImages(message.content);
|
||||
}
|
||||
}
|
||||
|
||||
private removeSystemMessage(messages: ChatMessage[]) {
|
||||
const msgs = [...messages];
|
||||
|
||||
if (msgs[0]?.role === "system") {
|
||||
let sysMsg = msgs.shift()!.content;
|
||||
// @ts-ignore
|
||||
if (msgs[0]?.role === "user") {
|
||||
msgs[0].content = `System message - follow these instructions in every response: ${sysMsg}\n\n---\n\n${msgs[0].content}`;
|
||||
}
|
||||
}
|
||||
|
||||
return msgs;
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
let convertedMsgs = this.removeSystemMessage(messages);
|
||||
if (options.model.includes("gemini")) {
|
||||
for await (const message of this.streamChatGemini(
|
||||
convertedMsgs,
|
||||
options,
|
||||
)) {
|
||||
yield message;
|
||||
}
|
||||
} else {
|
||||
for await (const message of this.streamChatBison(
|
||||
convertedMsgs,
|
||||
options,
|
||||
)) {
|
||||
yield message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _continuePartToGeminiPart(part: MessagePart) {
|
||||
return part.type === "text"
|
||||
? {
|
||||
text: part.text,
|
||||
}
|
||||
: {
|
||||
inlineData: {
|
||||
mimeType: "image/jpeg",
|
||||
data: part.imageUrl?.url.split(",")[1],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *streamChatGemini(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const apiURL = new URL(
|
||||
`models/${options.model}:streamGenerateContent?key=${this.apiKey}`,
|
||||
this.apiBase,
|
||||
);
|
||||
const body = {
|
||||
contents: messages.map((msg) => {
|
||||
return {
|
||||
role: msg.role === "assistant" ? "model" : "user",
|
||||
parts:
|
||||
typeof msg.content === "string"
|
||||
? [{ text: msg.content }]
|
||||
: msg.content.map(this._continuePartToGeminiPart),
|
||||
};
|
||||
}),
|
||||
};
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
|
||||
let buffer = "";
|
||||
for await (const chunk of streamResponse(response)) {
|
||||
buffer += chunk;
|
||||
if (buffer.startsWith("[")) {
|
||||
buffer = buffer.slice(1);
|
||||
}
|
||||
if (buffer.endsWith("]")) {
|
||||
buffer = buffer.slice(0, -1);
|
||||
}
|
||||
if (buffer.startsWith(",")) {
|
||||
buffer = buffer.slice(1);
|
||||
}
|
||||
|
||||
const parts = buffer.split("\n,");
|
||||
|
||||
let foundIncomplete = false;
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const part = parts[i];
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(part);
|
||||
} catch (e) {
|
||||
foundIncomplete = true;
|
||||
continue;
|
||||
}
|
||||
if (data.error) {
|
||||
throw new Error(data.error.message);
|
||||
}
|
||||
|
||||
// Incrementally stream the content to make it smoother
|
||||
const content = data.candidates[0].content.parts[0].text;
|
||||
const words = content.split(" ");
|
||||
const delaySeconds = Math.min(4.0 / (words.length + 1), 0.1);
|
||||
while (words.length > 0) {
|
||||
const wordsToYield = Math.min(3, words.length);
|
||||
yield {
|
||||
role: "assistant",
|
||||
content: words.splice(0, wordsToYield).join(" ") + " ",
|
||||
};
|
||||
await delay(delaySeconds);
|
||||
}
|
||||
}
|
||||
if (foundIncomplete) {
|
||||
buffer = parts[parts.length - 1];
|
||||
} else {
|
||||
buffer = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
private async *streamChatBison(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const msgList = [];
|
||||
for (const message of messages) {
|
||||
msgList.push({ content: message.content });
|
||||
}
|
||||
|
||||
const apiURL = new URL(
|
||||
`models/${options.model}:generateMessage?key=${this.apiKey}`,
|
||||
this.apiBase,
|
||||
);
|
||||
const body = { prompt: { messages: msgList } };
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
const data = await response.json();
|
||||
yield { role: "assistant", content: data.candidates[0].content };
|
||||
}
|
||||
}
|
||||
|
||||
async function delay(seconds: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
|
||||
export default GooglePalm;
|
||||
|
|
@ -10,7 +10,9 @@ class Groq extends OpenAI {
|
|||
private static modelConversion: { [key: string]: string } = {
|
||||
"llama2-70b": "llama2-70b-4096",
|
||||
"mistral-8x7b": "mixtral-8x7b-32768",
|
||||
"gemma": "gemma-7b-it",
|
||||
gemma: "gemma-7b-it",
|
||||
"llama3-8b": "llama3-8b-8192",
|
||||
"llama3-70b": "llama3-70b-8192",
|
||||
};
|
||||
protected _convertModelName(model: string): string {
|
||||
return Groq.modelConversion[model] ?? model;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class Ollama extends BaseLLM {
|
|||
if (!this.completionOptions.stop) {
|
||||
this.completionOptions.stop = [];
|
||||
}
|
||||
this.completionOptions.stop.push(value);
|
||||
this.completionOptions.stop.push(JSON.parse(value));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -76,6 +76,8 @@ class Ollama extends BaseLLM {
|
|||
"codellama-13b": "codellama:13b",
|
||||
"codellama-34b": "codellama:34b",
|
||||
"codellama-70b": "codellama:70b",
|
||||
"llama3-8b": "llama3:8b",
|
||||
"llama3-70b": "llama3:70b",
|
||||
"phi-2": "phi:2.7b",
|
||||
"phind-codellama-34b": "phind-codellama:34b-v2",
|
||||
"wizardcoder-7b": "wizardcoder:7b-python",
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const CHAT_ONLY_MODELS = [
|
|||
"gpt-3.5-turbo-0613",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4",
|
||||
"gpt-4-turbo",
|
||||
"gpt-35-turbo-16k",
|
||||
"gpt-35-turbo-0613",
|
||||
"gpt-35-turbo",
|
||||
|
|
@ -37,7 +38,12 @@ const CHAT_ONLY_MODELS = [
|
|||
];
|
||||
|
||||
class OpenAI extends BaseLLM {
|
||||
public useLegacyCompletionsEndpoint = false;
|
||||
public useLegacyCompletionsEndpoint: boolean | undefined = undefined;
|
||||
|
||||
constructor(options: LLMOptions) {
|
||||
super(options);
|
||||
this.useLegacyCompletionsEndpoint = options.useLegacyCompletionsEndpoint;
|
||||
}
|
||||
|
||||
constructor(options: LLMOptions) {
|
||||
super(options);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ class Replicate extends BaseLLM {
|
|||
"meta/codellama-70b-instruct:a279116fe47a0f65701a8817188601e2fe8f4b9e04a518789655ea7b995851bf",
|
||||
"llama2-7b": "meta/llama-2-7b-chat" as any,
|
||||
"llama2-13b": "meta/llama-2-13b-chat" as any,
|
||||
"llama3-8b": "meta/meta-llama-3-8b-instruct" as any,
|
||||
"llama3-70b": "meta/meta-llama-3-70b-instruct" as any,
|
||||
"zephyr-7b":
|
||||
"nateraw/zephyr-7b-beta:b79f33de5c6c4e34087d44eaea4a9d98ce5d3f3a09522f7328eea0685003a931",
|
||||
"mistral-7b":
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ class Together extends OpenAI {
|
|||
"codellama-13b": "togethercomputer/CodeLlama-13b-Instruct",
|
||||
"codellama-34b": "togethercomputer/CodeLlama-34b-Instruct",
|
||||
"codellama-70b": "codellama/CodeLlama-70b-Instruct-hf",
|
||||
"llama3-8b": "meta-llama/Llama-3-8b-chat-hf",
|
||||
"llama3-70b": "meta-llama/Llama-3-70b-chat-hf",
|
||||
"llama2-7b": "togethercomputer/llama-2-7b-chat",
|
||||
"llama2-13b": "togethercomputer/llama-2-13b-chat",
|
||||
"llama2-70b": "togethercomputer/llama-2-70b-chat",
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ import {
|
|||
import { DEFAULT_MAX_TOKENS } from "../constants";
|
||||
import Anthropic from "./Anthropic";
|
||||
import Bedrock from "./Bedrock";
|
||||
import Cohere from "./Cohere";
|
||||
import DeepInfra from "./DeepInfra";
|
||||
import Flowise from "./Flowise";
|
||||
import FreeTrial from "./FreeTrial";
|
||||
import Gemini from "./Gemini";
|
||||
import GooglePalm from "./GooglePalm";
|
||||
import Groq from "./Groq";
|
||||
import HuggingFaceInferenceAPI from "./HuggingFaceInferenceAPI";
|
||||
import HuggingFaceTGI from "./HuggingFaceTGI";
|
||||
|
|
@ -59,26 +59,27 @@ const getHandlebarsVars = (
|
|||
return [value, keysToFilepath];
|
||||
};
|
||||
|
||||
async function renderTemplatedString(
|
||||
export async function renderTemplatedString(
|
||||
template: string,
|
||||
readFile: (filepath: string) => Promise<string>,
|
||||
inputData: any,
|
||||
): Promise<string> {
|
||||
const [newTemplate, vars] = getHandlebarsVars(template);
|
||||
template = newTemplate;
|
||||
let data: any = {};
|
||||
for (let key in vars) {
|
||||
let fileContents = await readFile(vars[key]);
|
||||
data[key] = fileContents || vars[key];
|
||||
const data: any = { ...inputData };
|
||||
for (const key in vars) {
|
||||
const fileContents = await readFile(vars[key]);
|
||||
data[key] = fileContents || (inputData[vars[key]] ?? vars[key]);
|
||||
}
|
||||
const templateFn = Handlebars.compile(template);
|
||||
let final = templateFn(data);
|
||||
const templateFn = Handlebars.compile(newTemplate);
|
||||
const final = templateFn(data);
|
||||
return final;
|
||||
}
|
||||
|
||||
const LLMs = [
|
||||
Anthropic,
|
||||
Cohere,
|
||||
FreeTrial,
|
||||
GooglePalm,
|
||||
Gemini,
|
||||
Llamafile,
|
||||
Ollama,
|
||||
Replicate,
|
||||
|
|
@ -89,7 +90,6 @@ const LLMs = [
|
|||
LlamaCpp,
|
||||
OpenAI,
|
||||
LMStudio,
|
||||
Gemini,
|
||||
Mistral,
|
||||
Bedrock,
|
||||
DeepInfra,
|
||||
|
|
@ -117,7 +117,7 @@ export async function llmFromDescription(
|
|||
|
||||
systemMessage = desc.systemMessage ?? systemMessage;
|
||||
if (systemMessage !== undefined) {
|
||||
systemMessage = await renderTemplatedString(systemMessage, readFile);
|
||||
systemMessage = await renderTemplatedString(systemMessage, readFile, {});
|
||||
}
|
||||
|
||||
const options: LLMOptions = {
|
||||
|
|
|
|||
|
|
@ -73,3 +73,18 @@ export async function* streamSse(response: Response): AsyncGenerator<any> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function* streamJSON(response: Response): AsyncGenerator<any> {
|
||||
let buffer = "";
|
||||
for await (const value of streamResponse(response)) {
|
||||
buffer += value;
|
||||
|
||||
let position;
|
||||
while ((position = buffer.indexOf("\n")) >= 0) {
|
||||
const line = buffer.slice(0, position);
|
||||
const data = JSON.parse(line);
|
||||
yield data;
|
||||
buffer = buffer.slice(position + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
core/package-lock.json
generated
8
core/package-lock.json
generated
|
|
@ -42,7 +42,7 @@
|
|||
"socket.io-client": "^4.7.3",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "0.4.12",
|
||||
"web-tree-sitter": "^0.21.0"
|
||||
|
|
@ -9395,9 +9395,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/tree-sitter-wasms": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.7.tgz",
|
||||
"integrity": "sha512-/EnmSDDqEnSnIuCqVhSOc14T8r792LmiztqlZMFSRg+4ACrgUWNLvEr2AUP1K76XCJrvuH8liSWfkdQpK41hIA=="
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.11.tgz",
|
||||
"integrity": "sha512-26sE4+qoTi1CbzHdo9sHs9pRE/jXVFVRigSG/5TNAbwhSMVjHfMAg4UjmOhAFAIx5UxgoQuaURwqhm0SRNrpWA=="
|
||||
},
|
||||
"node_modules/ts-jest": {
|
||||
"version": "29.1.2",
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
"socket.io-client": "^4.7.3",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "0.4.12",
|
||||
"web-tree-sitter": "^0.21.0"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ export type ProtocolGeneratorType<T> = AsyncGenerator<{
|
|||
content: T;
|
||||
}>;
|
||||
|
||||
export interface ListHistoryOptions {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type Protocol = {
|
||||
// New
|
||||
"update/modelChange": [string, void];
|
||||
|
|
@ -27,7 +32,7 @@ export type Protocol = {
|
|||
abort: [undefined, void];
|
||||
|
||||
// History
|
||||
"history/list": [undefined, SessionInfo[]];
|
||||
"history/list": [ListHistoryOptions, SessionInfo[]];
|
||||
"history/delete": [{ id: string }, void];
|
||||
"history/load": [{ id: string }, PersistedSessionInfo];
|
||||
"history/save": [PersistedSessionInfo, void];
|
||||
|
|
@ -82,6 +87,7 @@ export type Protocol = {
|
|||
},
|
||||
string,
|
||||
];
|
||||
"llm/listModels": [{ title: string }, string[] | undefined];
|
||||
"llm/streamComplete": [
|
||||
{
|
||||
prompt: string;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ describe("LLM", () => {
|
|||
// testLLM(new HuggingFaceTGI({ model: "codellama-7b" }));
|
||||
// testLLM(new HuggingFaceInferenceAPI({ model: "codellama-7b" }));
|
||||
// testLLM(
|
||||
// new GooglePalm({
|
||||
// new Gemini({
|
||||
// model: "gemini-pro",
|
||||
// // model: "chat-bison-001",
|
||||
// apiKey: process.env.GOOGLE_PALM_API_KEY,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { http, https } from "follow-redirects";
|
||||
import * as fs from "fs";
|
||||
import { HttpProxyAgent } from "http-proxy-agent";
|
||||
import { globalAgent } from "https";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import fetch, { RequestInit, Response } from "node-fetch";
|
||||
import tls from "tls";
|
||||
|
|
@ -13,7 +14,15 @@ export function fetchwithRequestOptions(
|
|||
): Promise<Response> {
|
||||
const TIMEOUT = 7200; // 7200 seconds = 2 hours
|
||||
|
||||
const ca = [...tls.rootCertificates];
|
||||
let globalCerts: string[] = [];
|
||||
if (process.env.IS_BINARY) {
|
||||
if (Array.isArray(globalAgent.options.ca)) {
|
||||
globalCerts = [...globalAgent.options.ca.map((cert) => cert.toString())];
|
||||
} else if (typeof globalAgent.options.ca !== "undefined") {
|
||||
globalCerts.push(globalAgent.options.ca.toString());
|
||||
}
|
||||
}
|
||||
const ca = Array.from(new Set([...tls.rootCertificates, ...globalCerts]));
|
||||
const customCerts =
|
||||
typeof requestOptions?.caBundlePath === "string"
|
||||
? [requestOptions?.caBundlePath]
|
||||
|
|
|
|||
|
|
@ -1,18 +1,26 @@
|
|||
import * as fs from "fs";
|
||||
import { PersistedSessionInfo, SessionInfo } from "..";
|
||||
import { ListHistoryOptions } from "../protocol";
|
||||
import { getSessionFilePath, getSessionsListPath } from "./paths";
|
||||
|
||||
class HistoryManager {
|
||||
list(): SessionInfo[] {
|
||||
list(options: ListHistoryOptions): SessionInfo[] {
|
||||
const filepath = getSessionsListPath();
|
||||
if (!fs.existsSync(filepath)) {
|
||||
return [];
|
||||
}
|
||||
const content = fs.readFileSync(filepath, "utf8");
|
||||
const sessions = JSON.parse(content).filter((session: any) => {
|
||||
let sessions = JSON.parse(content).filter((session: any) => {
|
||||
// Filter out old format
|
||||
return typeof session.session_id !== "string";
|
||||
});
|
||||
|
||||
// Apply limit and offset
|
||||
if (options.limit) {
|
||||
const offset = options.offset || 0;
|
||||
sessions = sessions.slice(offset, offset + options.limit);
|
||||
}
|
||||
|
||||
return sessions;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = {
|
|||
useCache: true,
|
||||
onlyMyCode: true,
|
||||
useOtherFiles: false,
|
||||
disableInFiles: undefined,
|
||||
};
|
||||
|
||||
export const RETRIEVAL_PARAMS = {
|
||||
|
|
@ -26,4 +27,4 @@ export const RETRIEVAL_PARAMS = {
|
|||
};
|
||||
|
||||
// export const SERVER_URL = "http://localhost:3000";
|
||||
export const SERVER_URL = "https://proxy-server-green-l6vsfbzhba-uw.a.run.app";
|
||||
export const SERVER_URL = "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app";
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const supportedLanguages: { [key: string]: string } = {
|
|||
rs: "rust",
|
||||
rdl: "systemrdl",
|
||||
toml: "toml",
|
||||
sol: "solidity",
|
||||
|
||||
// jl: "julia",
|
||||
// swift: "swift",
|
||||
|
|
|
|||
|
|
@ -5512,10 +5512,10 @@ tr46@~0.0.3:
|
|||
resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz"
|
||||
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
|
||||
|
||||
tree-sitter-wasms@^0.1.6:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.7.tgz"
|
||||
integrity sha512-/EnmSDDqEnSnIuCqVhSOc14T8r792LmiztqlZMFSRg+4ACrgUWNLvEr2AUP1K76XCJrvuH8liSWfkdQpK41hIA==
|
||||
tree-sitter-wasms@^0.1.11, tree-sitter-wasms@^0.1.6:
|
||||
version "0.1.11"
|
||||
resolved "https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.11.tgz"
|
||||
integrity sha512-26sE4+qoTi1CbzHdo9sHs9pRE/jXVFVRigSG/5TNAbwhSMVjHfMAg4UjmOhAFAIx5UxgoQuaURwqhm0SRNrpWA==
|
||||
|
||||
ts-jest@^29.1.1:
|
||||
version "29.1.2"
|
||||
|
|
|
|||
|
|
@ -73,8 +73,6 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
|
|||
"neural-chat-7b"
|
||||
# Anthropic
|
||||
"claude-2",
|
||||
# Google PaLM
|
||||
"chat-bison-001",
|
||||
```
|
||||
|
||||
If you want to use a model not listed here, you can still do that by specifying whichever value of `model` you need. But if there's something you think we should add as a default, let us know!
|
||||
|
|
@ -208,7 +206,7 @@ This is an example of serving a model using an OpenAI-compatible API on http://l
|
|||
"title": "OpenAI-compatible API",
|
||||
"provider": "openai",
|
||||
"model": "codellama-13b",
|
||||
"api_base": "http://localhost:8000"
|
||||
"api_base": "http://localhost:8000/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: Select a provider
|
||||
description: Swap out different LLM providers
|
||||
keywords: [openai, anthropic, PaLM, ollama, ggml]
|
||||
keywords: [openai, anthropic, gemini, ollama, ggml]
|
||||
---
|
||||
|
||||
# Select a model provider
|
||||
|
|
@ -57,6 +57,6 @@ You can use commercial LLMs via APIs using:
|
|||
- [OpenAI API](../reference/Model%20Providers/openai.md)
|
||||
- [Azure OpenAI Service](../reference/Model%20Providers/openai.md) (OpenAI compatible API)
|
||||
- [Anthrophic API](../reference/Model%20Providers/anthropicllm.md)
|
||||
- [Google PaLM API](../reference/Model%20Providers/googlepalmapi.md)
|
||||
- [Google Gemini API](../reference/Model%20Providers/googlepalmapi.md)
|
||||
- [OpenAI free trial](../reference/Model%20Providers/freetrial.md)
|
||||
- [Mistral API](../reference/Model%20Providers/mistral.md)
|
||||
|
|
|
|||
20
docs/docs/reference/Model Providers/cohere.md
Normal file
20
docs/docs/reference/Model Providers/cohere.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Cohere
|
||||
|
||||
To setup Cohere, add the following to your `config.json` file:
|
||||
|
||||
```json title="~/.continue/config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "Cohere",
|
||||
"provider": "cohere",
|
||||
"model": "command-r-plus",
|
||||
"apiKey": "YOUR_API_KEY"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.
|
||||
|
||||
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Cohere.ts)
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
# GooglePaLMAPI
|
||||
# Gemini API
|
||||
|
||||
The Google PaLM API is currently in beta. You can [create an API key in Google MakerSuite](https://makersuite.google.com/u/2/app/apikey) and use either the `chat-bison-001` model or `gemini-pro`. Change `~/.continue/config.json` to look like this:
|
||||
The Google Gemini API is currently in beta. You can [create an API key in Google AI Studio](https://aistudio.google.com) and use `gemini-1.5-pro-latest`. Change `~/.continue/config.json` to look like this:
|
||||
|
||||
```json title="~/.continue/config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "Gemini Pro",
|
||||
"provider": "google-palm",
|
||||
"model": "gemini-pro",
|
||||
"provider": "gemini",
|
||||
"model": "gemini-1.5-pro-latest",
|
||||
"apiKey": "YOUR_API_KEY"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/GooglePalm.ts)
|
||||
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Gemini.ts)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ The easiest way to find this information is from the chat playground in the Azur
|
|||
### OpenAI compatible servers / APIs
|
||||
|
||||
OpenAI compatible servers
|
||||
|
||||
- [KoboldCpp](https://github.com/lostruins/koboldcpp)
|
||||
- [text-gen-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai#setup--installation)
|
||||
- [FastChat](https://github.com/lm-sys/FastChat/blob/main/docs/openai_api.md)
|
||||
|
|
@ -46,10 +47,16 @@ If you are [using an OpenAI compatible server / API](../../model-setup/select-pr
|
|||
"provider": "openai",
|
||||
"model": "MODEL_NAME",
|
||||
"apiKey": "EMPTY",
|
||||
"apiBase": "http://localhost:8000"
|
||||
"apiBase": "http://localhost:8000/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
To force usage of `chat/completions` instead of `completions` endpoint you can set
|
||||
|
||||
```json
|
||||
"useLegacyCompletionsEndpoint": false
|
||||
```
|
||||
|
||||
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/OpenAI.ts)
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh
|
|||
"neural-chat-7b",
|
||||
# Anthropic
|
||||
"claude-2",
|
||||
# Google PaLM
|
||||
"chat-bison-001",
|
||||
```
|
||||
|
||||
If you want to use a model not listed here, you can still do that by specifying whichever value of `model` you need. But if there's something you think we should add as a default, let us know!
|
||||
|
|
@ -207,7 +205,7 @@ This is an example of serving a model using an OpenAI-compatible API on http://l
|
|||
"title": "OpenAI-compatible API",
|
||||
"provider": "openai",
|
||||
"model": "codellama-13b",
|
||||
"api_base": "http://localhost:8000"
|
||||
"api_base": "http://localhost:8000/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
74
docs/static/schemas/config.json
vendored
74
docs/static/schemas/config.json
vendored
|
|
@ -134,6 +134,7 @@
|
|||
"openai",
|
||||
"free-trial",
|
||||
"anthropic",
|
||||
"cohere",
|
||||
"bedrock",
|
||||
"together",
|
||||
"ollama",
|
||||
|
|
@ -141,7 +142,7 @@
|
|||
"huggingface-inference-api",
|
||||
"llama.cpp",
|
||||
"replicate",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"lmstudio",
|
||||
"llamafile",
|
||||
"mistral",
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
|
||||
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
|
||||
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
|
||||
"### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
|
||||
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
|
||||
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
|
||||
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run <MODEL_NAME>`. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
|
||||
|
|
@ -160,7 +162,7 @@
|
|||
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
|
||||
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
|
||||
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
|
||||
"### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
|
||||
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
|
||||
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
|
||||
|
|
@ -175,7 +177,7 @@
|
|||
},
|
||||
"apiKey": {
|
||||
"title": "Api Key",
|
||||
"description": "OpenAI, Anthropic, Together, or other API key",
|
||||
"description": "OpenAI, Anthropic, Cohere, Together, or other API key",
|
||||
"type": "string"
|
||||
},
|
||||
"apiBase": {
|
||||
|
|
@ -303,7 +305,8 @@
|
|||
"enum": [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"google-palm",
|
||||
"cohere",
|
||||
"gemini",
|
||||
"huggingface-inference-api",
|
||||
"replicate",
|
||||
"together"
|
||||
|
|
@ -373,7 +376,7 @@
|
|||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"AUTODETECT"
|
||||
]
|
||||
},
|
||||
|
|
@ -400,6 +403,8 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -471,7 +476,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -481,6 +486,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -540,6 +547,23 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["cohere"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["command-r", "command-r-plus"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -572,7 +596,7 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["google-palm"]
|
||||
"enum": ["gemini"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
|
|
@ -580,7 +604,11 @@
|
|||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["chat-bison-001", "gemini-pro"]
|
||||
"enum": [
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -604,6 +632,8 @@
|
|||
"mistral-8x7b",
|
||||
"llama2-7b",
|
||||
"llama2-13b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -666,6 +696,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -712,6 +744,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phi-2",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
|
|
@ -768,7 +802,13 @@
|
|||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["llama2-70b", "mistral-8x7b", "gemma"]
|
||||
"enum": [
|
||||
"llama2-70b",
|
||||
"mistral-8x7b",
|
||||
"gemma",
|
||||
"llama3-8b",
|
||||
"llama3-70b"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -902,7 +942,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -912,6 +952,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -926,8 +968,11 @@
|
|||
"claude-3-sonnet-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-2.1",
|
||||
"command-r",
|
||||
"command-r-plus",
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest",
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
|
|
@ -1585,7 +1630,7 @@
|
|||
{
|
||||
"name": "test",
|
||||
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
"description": "This is an example custom command. Use /config to edit it and create more"
|
||||
"description": "This is an example custom command. Open config.json to edit it and create more"
|
||||
}
|
||||
],
|
||||
"type": "array",
|
||||
|
|
@ -1794,6 +1839,13 @@
|
|||
"useOtherFiles": {
|
||||
"type": "boolean",
|
||||
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
|
||||
},
|
||||
"disableInFiles": {
|
||||
"description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ pluginGroup = com.github.continuedev.continueintellijextension
|
|||
pluginName = continue-intellij-extension
|
||||
pluginRepositoryUrl = https://github.com/continuedev/continue
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion = 0.0.42
|
||||
pluginVersion = 0.0.45
|
||||
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild = 223
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@
|
|||
"openai",
|
||||
"free-trial",
|
||||
"anthropic",
|
||||
"cohere",
|
||||
"bedrock",
|
||||
"together",
|
||||
"ollama",
|
||||
|
|
@ -141,7 +142,7 @@
|
|||
"huggingface-inference-api",
|
||||
"llama.cpp",
|
||||
"replicate",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"lmstudio",
|
||||
"llamafile",
|
||||
"mistral",
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
|
||||
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
|
||||
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
|
||||
"### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
|
||||
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
|
||||
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
|
||||
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run <MODEL_NAME>`. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
|
||||
|
|
@ -160,7 +162,7 @@
|
|||
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
|
||||
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
|
||||
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
|
||||
"### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
|
||||
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
|
||||
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
|
||||
|
|
@ -175,7 +177,7 @@
|
|||
},
|
||||
"apiKey": {
|
||||
"title": "Api Key",
|
||||
"description": "OpenAI, Anthropic, Together, or other API key",
|
||||
"description": "OpenAI, Anthropic, Cohere, Together, or other API key",
|
||||
"type": "string"
|
||||
},
|
||||
"apiBase": {
|
||||
|
|
@ -303,7 +305,8 @@
|
|||
"enum": [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"google-palm",
|
||||
"cohere",
|
||||
"gemini",
|
||||
"huggingface-inference-api",
|
||||
"replicate",
|
||||
"together"
|
||||
|
|
@ -373,7 +376,7 @@
|
|||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"AUTODETECT"
|
||||
]
|
||||
},
|
||||
|
|
@ -400,6 +403,8 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -471,7 +476,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -481,6 +486,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -540,6 +547,23 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["cohere"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["command-r", "command-r-plus"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -572,7 +596,7 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["google-palm"]
|
||||
"enum": ["gemini"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
|
|
@ -580,7 +604,11 @@
|
|||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["chat-bison-001", "gemini-pro"]
|
||||
"enum": [
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -604,6 +632,8 @@
|
|||
"mistral-8x7b",
|
||||
"llama2-7b",
|
||||
"llama2-13b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -666,6 +696,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -712,6 +744,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phi-2",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
|
|
@ -768,7 +802,13 @@
|
|||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["llama2-70b", "mistral-8x7b", "gemma"]
|
||||
"enum": [
|
||||
"llama2-70b",
|
||||
"mistral-8x7b",
|
||||
"gemma",
|
||||
"llama3-8b",
|
||||
"llama3-70b"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -902,7 +942,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -912,6 +952,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -926,8 +968,11 @@
|
|||
"claude-3-sonnet-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-2.1",
|
||||
"command-r",
|
||||
"command-r-plus",
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest",
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
|
|
@ -1585,7 +1630,7 @@
|
|||
{
|
||||
"name": "test",
|
||||
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
"description": "This is an example custom command. Use /config to edit it and create more"
|
||||
"description": "This is an example custom command. Open config.json to edit it and create more"
|
||||
}
|
||||
],
|
||||
"type": "array",
|
||||
|
|
@ -1794,6 +1839,13 @@
|
|||
"useOtherFiles": {
|
||||
"type": "boolean",
|
||||
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
|
||||
},
|
||||
"disableInFiles": {
|
||||
"description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Welcome to Continue!
|
|||
|
||||
_________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@
|
|||
"openai",
|
||||
"free-trial",
|
||||
"anthropic",
|
||||
"cohere",
|
||||
"bedrock",
|
||||
"together",
|
||||
"ollama",
|
||||
|
|
@ -141,7 +142,7 @@
|
|||
"huggingface-inference-api",
|
||||
"llama.cpp",
|
||||
"replicate",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"lmstudio",
|
||||
"llamafile",
|
||||
"mistral",
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
|
||||
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
|
||||
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
|
||||
"### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
|
||||
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
|
||||
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
|
||||
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run <MODEL_NAME>`. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
|
||||
|
|
@ -160,7 +162,7 @@
|
|||
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
|
||||
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
|
||||
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
|
||||
"### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
|
||||
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
|
||||
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
|
||||
|
|
@ -175,7 +177,7 @@
|
|||
},
|
||||
"apiKey": {
|
||||
"title": "Api Key",
|
||||
"description": "OpenAI, Anthropic, Together, or other API key",
|
||||
"description": "OpenAI, Anthropic, Cohere, Together, or other API key",
|
||||
"type": "string"
|
||||
},
|
||||
"apiBase": {
|
||||
|
|
@ -303,7 +305,8 @@
|
|||
"enum": [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"google-palm",
|
||||
"cohere",
|
||||
"gemini",
|
||||
"huggingface-inference-api",
|
||||
"replicate",
|
||||
"together"
|
||||
|
|
@ -373,7 +376,7 @@
|
|||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"AUTODETECT"
|
||||
]
|
||||
},
|
||||
|
|
@ -400,6 +403,8 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -471,7 +476,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -481,6 +486,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -540,6 +547,23 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["cohere"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["command-r", "command-r-plus"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -572,7 +596,7 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["google-palm"]
|
||||
"enum": ["gemini"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
|
|
@ -608,6 +632,8 @@
|
|||
"mistral-8x7b",
|
||||
"llama2-7b",
|
||||
"llama2-13b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -670,6 +696,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -716,6 +744,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phi-2",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
|
|
@ -772,7 +802,13 @@
|
|||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": ["llama2-70b", "mistral-8x7b", "gemma"]
|
||||
"enum": [
|
||||
"llama2-70b",
|
||||
"mistral-8x7b",
|
||||
"gemma",
|
||||
"llama3-8b",
|
||||
"llama3-70b"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -906,7 +942,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -916,6 +952,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -930,6 +968,8 @@
|
|||
"claude-3-sonnet-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-2.1",
|
||||
"command-r",
|
||||
"command-r-plus",
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest",
|
||||
|
|
@ -1590,7 +1630,7 @@
|
|||
{
|
||||
"name": "test",
|
||||
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
"description": "This is an example custom command. Use /config to edit it and create more"
|
||||
"description": "This is an example custom command. Open config.json to edit it and create more"
|
||||
}
|
||||
],
|
||||
"type": "array",
|
||||
|
|
@ -1799,6 +1839,13 @@
|
|||
"useOtherFiles": {
|
||||
"type": "boolean",
|
||||
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
|
||||
},
|
||||
"disableInFiles": {
|
||||
"description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@
|
|||
"openai",
|
||||
"free-trial",
|
||||
"anthropic",
|
||||
"cohere",
|
||||
"bedrock",
|
||||
"together",
|
||||
"ollama",
|
||||
|
|
@ -141,7 +142,7 @@
|
|||
"huggingface-inference-api",
|
||||
"llama.cpp",
|
||||
"replicate",
|
||||
"google-palm",
|
||||
"gemini",
|
||||
"lmstudio",
|
||||
"llamafile",
|
||||
"mistral",
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/openai)",
|
||||
"### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)",
|
||||
"### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)",
|
||||
"### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/cohere)",
|
||||
"### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock/claude/)",
|
||||
"### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)",
|
||||
"### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run <MODEL_NAME>`. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)",
|
||||
|
|
@ -160,7 +162,7 @@
|
|||
"### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)",
|
||||
"### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)",
|
||||
"### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/replicatellm)",
|
||||
"### Google PALM\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/googlepalmapi)",
|
||||
"### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/lmstudio)",
|
||||
"### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamafile)",
|
||||
"### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)",
|
||||
|
|
@ -175,7 +177,7 @@
|
|||
},
|
||||
"apiKey": {
|
||||
"title": "Api Key",
|
||||
"description": "OpenAI, Anthropic, Together, or other API key",
|
||||
"description": "OpenAI, Anthropic, Cohere, Together, or other API key",
|
||||
"type": "string"
|
||||
},
|
||||
"apiBase": {
|
||||
|
|
@ -312,7 +314,8 @@
|
|||
"enum": [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"google-palm",
|
||||
"cohere",
|
||||
"gemini",
|
||||
"huggingface-inference-api",
|
||||
"replicate",
|
||||
"together"
|
||||
|
|
@ -401,7 +404,7 @@
|
|||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"AUTODETECT"
|
||||
]
|
||||
},
|
||||
|
|
@ -432,6 +435,8 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -511,7 +516,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -521,6 +526,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -584,6 +591,30 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": [
|
||||
"cohere"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"model": {
|
||||
"enum": [
|
||||
"command-r",
|
||||
"command-r-plus"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
|
@ -621,7 +652,7 @@
|
|||
"properties": {
|
||||
"provider": {
|
||||
"enum": [
|
||||
"google-palm"
|
||||
"gemini"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -634,7 +665,8 @@
|
|||
"model": {
|
||||
"enum": [
|
||||
"chat-bison-001",
|
||||
"gemini-pro"
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -663,6 +695,8 @@
|
|||
"mistral-8x7b",
|
||||
"llama2-7b",
|
||||
"llama2-13b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"codellama-7b",
|
||||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
|
|
@ -731,6 +765,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -781,6 +817,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phi-2",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
|
|
@ -852,7 +890,9 @@
|
|||
"enum": [
|
||||
"llama2-70b",
|
||||
"mistral-8x7b",
|
||||
"gemma"
|
||||
"gemma",
|
||||
"llama3-8b",
|
||||
"llama3-70b"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1013,7 +1053,7 @@
|
|||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-vision-preview",
|
||||
"mistral-7b",
|
||||
"mistral-8x7b",
|
||||
|
|
@ -1023,6 +1063,8 @@
|
|||
"codellama-13b",
|
||||
"codellama-34b",
|
||||
"codellama-70b",
|
||||
"llama3-8b",
|
||||
"llama3-70b",
|
||||
"phind-codellama-34b",
|
||||
"wizardcoder-7b",
|
||||
"wizardcoder-13b",
|
||||
|
|
@ -1037,8 +1079,11 @@
|
|||
"claude-3-sonnet-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-2.1",
|
||||
"command-r",
|
||||
"command-r-plus",
|
||||
"chat-bison-001",
|
||||
"gemini-pro",
|
||||
"gemini-1.5-pro-latest",
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
|
|
@ -1778,7 +1823,7 @@
|
|||
{
|
||||
"name": "test",
|
||||
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
"description": "This is an example custom command. Use /config to edit it and create more"
|
||||
"description": "This is an example custom command. Open config.json to edit it and create more"
|
||||
}
|
||||
],
|
||||
"type": "array",
|
||||
|
|
@ -2024,6 +2069,13 @@
|
|||
"useOtherFiles": {
|
||||
"type": "boolean",
|
||||
"description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
|
||||
},
|
||||
"disableInFiles": {
|
||||
"description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
"""
|
||||
_________ _____ _____
|
||||
__ ____/______ _______ __ /____(_)_______ ____ _______
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
|
||||
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
|
||||
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
|
||||
|
||||
Welcome to Continue! This is a 2 minute tutorial.
|
||||
|
||||
You can either
|
||||
- follow the instructions on your own, or
|
||||
- follow along by clicking the gray CodeLens buttons above the lines, in order, starting with "Begin Section"
|
||||
You can click the gray buttons, starting with "Highlight the function" to follow along.
|
||||
"""
|
||||
|
||||
# region —————————————————————————— Part 1: Ask a question about code [Cmd+L] ——————————————————————————
|
||||
|
|
@ -78,4 +76,4 @@ print_sum(["a", "b", "c"])
|
|||
|
||||
# endregion
|
||||
|
||||
# Ready to learn more? Check out the Continue documentation: https://continue.dev/docs
|
||||
# Ready to learn more? Check out the Continue documentation: https://continue.dev/docs
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
extensions/vscode/media/sidebar-icon.png
Normal file
BIN
extensions/vscode/media/sidebar-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
## ❗️ Before you get started
|
||||
|
||||
Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer. You can move it back at any time.
|
||||
Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer.
|
||||
|
||||
You can move it back at any time. If you close the sidebar, it can be re-opened with <kbd>Cmd/Ctrl</kbd> + <kbd>L</kbd>.
|
||||
|
||||

|
||||
|
||||
## 🔑 Most important shortcuts
|
||||
|
||||
> If you've been using Continue, these have changed. You can always customize them in VS Code settings.
|
||||
> If you'd prefer different keys, these shortcuts can be customized in VS Code settings.
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>L</kbd> = Select code
|
||||
|
||||
|
|
@ -17,13 +19,3 @@ Continue is currently in the left sidebar, but we recommend moving it to the rig
|
|||
<kbd>Cmd/Ctrl</kbd> + <kbd>I</kbd> = Quick edit
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> = Automatically debug terminal
|
||||
|
||||
## ⚡️ Setting up tab autocomplete
|
||||
|
||||
1. Download [Ollama](https://ollama.ai)
|
||||
2. Download starcoder2:3b by running `ollama run starcoder2:3b` in the terminal
|
||||
3. That's it! You can disable autocomplete at any time by clicking the `Continue` button in the status bar (bottom right of the VS Code window)
|
||||
|
||||
> Learn how to customize your autocomplete experience in [our walkthrough](https://continue.dev/docs/walkthroughs/tab-autocomplete)
|
||||
|
||||

|
||||
|
|
|
|||
2
extensions/vscode/package-lock.json
generated
2
extensions/vscode/package-lock.json
generated
|
|
@ -122,7 +122,7 @@
|
|||
"socket.io-client": "^4.7.3",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "0.4.12",
|
||||
"web-tree-sitter": "^0.21.0"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"version": "0.9.92",
|
||||
"version": "0.9.93",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
"homepage": "https://continue.dev",
|
||||
"qna": "https://github.com/continuedev/continue/issues/new/choose",
|
||||
"license": "Apache-2.0",
|
||||
"displayName": "Continue - Claude, CodeLlama, GPT-4, and more",
|
||||
"displayName": "Continue - Llama 3, GPT-4, and more",
|
||||
"pricing": "Free",
|
||||
"description": "Open-source autopilot for software development - bring the power of ChatGPT to your IDE",
|
||||
"publisher": "Continue",
|
||||
|
|
@ -41,6 +41,7 @@
|
|||
"github",
|
||||
"copilot",
|
||||
"llama",
|
||||
"3",
|
||||
"codegpt",
|
||||
"ai"
|
||||
],
|
||||
|
|
@ -149,6 +150,18 @@
|
|||
"icon": "$(fullscreen)",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.openConfigJson",
|
||||
"category": "Continue",
|
||||
"title": "Open config.json",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.toggleTabAutocompleteEnabled",
|
||||
"category": "Continue",
|
||||
"title": "Toggle Autocomplete Enabled",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.shareSession",
|
||||
"category": "Continue",
|
||||
|
|
@ -263,6 +276,16 @@
|
|||
"mac": "cmd+k cmd+m",
|
||||
"key": "ctrl+k ctrl+m",
|
||||
"when": "!terminalFocus"
|
||||
},
|
||||
{
|
||||
"command": "continue.toggleTabAutocompleteEnabled",
|
||||
"mac": "cmd+k cmd+a",
|
||||
"key": "ctrl+k ctrl+a"
|
||||
},
|
||||
{
|
||||
"command": "continue.openConfigJson",
|
||||
"mac": "cmd+k cmd+c",
|
||||
"key": "ctrl+k ctrl+c"
|
||||
}
|
||||
],
|
||||
"submenus": [
|
||||
|
|
@ -382,7 +405,7 @@
|
|||
{
|
||||
"id": "continue",
|
||||
"title": "Continue",
|
||||
"icon": "media/continue-dev-square.png"
|
||||
"icon": "media/sidebar-icon.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ if (!fs.existsSync("build")) {
|
|||
}
|
||||
|
||||
const command = isPreRelease
|
||||
? "vsce package --out ./build patch --pre-release" // --yarn"
|
||||
: "vsce package --out ./build patch"; // --yarn";
|
||||
? "npx vsce package --out ./build patch --pre-release" // --yarn"
|
||||
: "npx vsce package --out ./build patch"; // --yarn";
|
||||
|
||||
exec(command, (error) => {
|
||||
if (error) throw error;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ if (!target) {
|
|||
s390x: "x64",
|
||||
x64: "x64",
|
||||
}[process.arch];
|
||||
} else {
|
||||
[os, arch] = target.split("-");
|
||||
}
|
||||
|
||||
if (os === "alpine") {
|
||||
|
|
|
|||
|
|
@ -16,13 +16,19 @@ export class ContinueCompletionProvider
|
|||
implements vscode.InlineCompletionItemProvider
|
||||
{
|
||||
private onError(e: any) {
|
||||
vscode.window.showErrorMessage(e.message, "Documentation").then((val) => {
|
||||
const options = ["Documentation"];
|
||||
if (e.message.includes("https://ollama.ai")) {
|
||||
options.push("Download Ollama");
|
||||
}
|
||||
vscode.window.showErrorMessage(e.message, ...options).then((val) => {
|
||||
if (val === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete",
|
||||
),
|
||||
);
|
||||
} else if (val === "Download Ollama") {
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -32,14 +38,14 @@ export class ContinueCompletionProvider
|
|||
constructor(
|
||||
private readonly configHandler: ConfigHandler,
|
||||
private readonly ide: IDE,
|
||||
private readonly tabAutocompleteModel: TabAutocompleteModel
|
||||
private readonly tabAutocompleteModel: TabAutocompleteModel,
|
||||
) {
|
||||
this.completionProvider = new CompletionProvider(
|
||||
this.configHandler,
|
||||
this.ide,
|
||||
this.tabAutocompleteModel.get.bind(this.tabAutocompleteModel),
|
||||
this.onError.bind(this),
|
||||
getDefinitionsFromLsp
|
||||
getDefinitionsFromLsp,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +53,7 @@ export class ContinueCompletionProvider
|
|||
document: vscode.TextDocument,
|
||||
position: vscode.Position,
|
||||
context: vscode.InlineCompletionContext,
|
||||
token: vscode.CancellationToken
|
||||
token: vscode.CancellationToken,
|
||||
//@ts-ignore
|
||||
): ProviderResult<InlineCompletionItem[] | InlineCompletionList> {
|
||||
const enableTabAutocomplete =
|
||||
|
|
@ -75,14 +81,14 @@ export class ContinueCompletionProvider
|
|||
pos: { line: position.line, character: position.character },
|
||||
recentlyEditedFiles: [],
|
||||
recentlyEditedRanges: [],
|
||||
clipboardText: clipboardText
|
||||
clipboardText: clipboardText,
|
||||
};
|
||||
|
||||
setupStatusBar(true, true);
|
||||
const outcome =
|
||||
await this.completionProvider.provideInlineCompletionItems(
|
||||
input,
|
||||
signal
|
||||
signal,
|
||||
);
|
||||
|
||||
if (!outcome || !outcome.completion) {
|
||||
|
|
@ -107,13 +113,13 @@ export class ContinueCompletionProvider
|
|||
outcome.completion,
|
||||
new vscode.Range(
|
||||
position,
|
||||
position.translate(0, outcome.completion.length)
|
||||
position.translate(0, outcome.completion.length),
|
||||
),
|
||||
{
|
||||
title: "Log Autocomplete Outcome",
|
||||
command: "continue.logAutocompleteOutcome",
|
||||
arguments: [outcome, logRejectionTimeout],
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { IDE } from "core";
|
|||
import { AutocompleteOutcome } from "core/autocomplete/completionProvider";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
import { getConfigJsonPath } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import { ContinueGUIWebviewViewProvider } from "./debugPanel";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
|
|
@ -21,10 +22,45 @@ function getFullScreenTab() {
|
|||
);
|
||||
}
|
||||
|
||||
function addHighlightedCodeToContext(
|
||||
async function addHighlightedCodeToContext(
|
||||
edit: boolean,
|
||||
webviewProtocol: VsCodeWebviewProtocol | undefined,
|
||||
) {
|
||||
// Capture highlighted terminal text
|
||||
// const activeTerminal = vscode.window.activeTerminal;
|
||||
// if (activeTerminal) {
|
||||
// // Copy selected text
|
||||
// const tempCopyBuffer = await vscode.env.clipboard.readText();
|
||||
// await vscode.commands.executeCommand(
|
||||
// "workbench.action.terminal.copySelection",
|
||||
// );
|
||||
// await vscode.commands.executeCommand(
|
||||
// "workbench.action.terminal.clearSelection",
|
||||
// );
|
||||
// const contents = (await vscode.env.clipboard.readText()).trim();
|
||||
// await vscode.env.clipboard.writeText(tempCopyBuffer);
|
||||
|
||||
// // Add to context
|
||||
// const rangeInFileWithContents = {
|
||||
// filepath: activeTerminal.name,
|
||||
// contents,
|
||||
// range: {
|
||||
// start: {
|
||||
// line: 0,
|
||||
// character: 0,
|
||||
// },
|
||||
// end: {
|
||||
// line: contents.split("\n").length,
|
||||
// character: 0,
|
||||
// },
|
||||
// },
|
||||
// };
|
||||
|
||||
// webviewProtocol?.request("highlightedCode", {
|
||||
// rangeInFileWithContents,
|
||||
// });
|
||||
// }
|
||||
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor) {
|
||||
const selection = editor.selection;
|
||||
|
|
@ -147,7 +183,7 @@ const commandsMap: (
|
|||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
}
|
||||
sidebar.webviewProtocol?.request("focusContinueInput", undefined);
|
||||
addHighlightedCodeToContext(false, sidebar.webviewProtocol);
|
||||
await addHighlightedCodeToContext(false, sidebar.webviewProtocol);
|
||||
},
|
||||
"continue.focusContinueInputWithoutClear": async () => {
|
||||
if (!getFullScreenTab()) {
|
||||
|
|
@ -157,12 +193,12 @@ const commandsMap: (
|
|||
"focusContinueInputWithoutClear",
|
||||
undefined,
|
||||
);
|
||||
addHighlightedCodeToContext(true, sidebar.webviewProtocol);
|
||||
await addHighlightedCodeToContext(true, sidebar.webviewProtocol);
|
||||
},
|
||||
"continue.toggleAuxiliaryBar": () => {
|
||||
vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
|
||||
},
|
||||
"continue.quickEdit": async () => {
|
||||
"continue.quickEdit": async (prompt?: string) => {
|
||||
const selectionEmpty = vscode.window.activeTextEditor?.selection.isEmpty;
|
||||
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
|
@ -199,6 +235,7 @@ const commandsMap: (
|
|||
: `Describe how to edit the highlighted code${addContextMsg}`,
|
||||
title: `${getPlatform() === "mac" ? "Cmd" : "Ctrl"}+I`,
|
||||
prompt: `[${defaultModelTitle}]`,
|
||||
value: prompt,
|
||||
};
|
||||
if (previousInput) {
|
||||
textInputOptions.value = previousInput + ", ";
|
||||
|
|
@ -441,6 +478,9 @@ const commandsMap: (
|
|||
extensionContext.subscriptions,
|
||||
);
|
||||
},
|
||||
"continue.openConfigJson": () => {
|
||||
ide.openFile(getConfigJsonPath());
|
||||
},
|
||||
"continue.selectFilesAsContext": (
|
||||
firstUri: vscode.Uri,
|
||||
uris: vscode.Uri[],
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ export class VerticalPerLineDiffManager {
|
|||
);
|
||||
} catch (e) {
|
||||
console.error("Error streaming diff:", e);
|
||||
vscode.window.showErrorMessage(`Error streaming diff: ${e}`);
|
||||
} finally {
|
||||
vscode.commands.executeCommand(
|
||||
"setContext",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { ConfigHandler } from "core/config/handler";
|
||||
import { CodebaseIndexer, PauseToken } from "core/indexing/indexCodebase";
|
||||
import { IdeSettings } from "core/protocol";
|
||||
import { getConfigJsonPath, getConfigTsPath } from "core/util/paths";
|
||||
import fs from "fs";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { ContinueCompletionProvider } from "../autocomplete/completionProvider";
|
||||
|
|
@ -189,17 +191,20 @@ export class VsCodeExtension {
|
|||
// Indexing
|
||||
this.ide.getWorkspaceDirs().then((dirs) => this.refreshCodebaseIndex(dirs));
|
||||
|
||||
// Listen for file saving
|
||||
// Listen for file saving - use global file watcher so that changes
|
||||
// from outside the window are also caught
|
||||
fs.watchFile(getConfigJsonPath(), { interval: 1000 }, (stats) => {
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
fs.watchFile(getConfigTsPath(), { interval: 1000 }, (stats) => {
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
vscode.workspace.onDidSaveTextDocument((event) => {
|
||||
// Listen for file changes in the workspace
|
||||
const filepath = event.uri.fsPath;
|
||||
|
||||
if (
|
||||
filepath.endsWith(".continue/config.json") ||
|
||||
filepath.endsWith(".continue\\config.json") ||
|
||||
filepath.endsWith(".continue/config.ts") ||
|
||||
filepath.endsWith(".continue\\config.ts") ||
|
||||
filepath.endsWith(".continuerc.json")
|
||||
) {
|
||||
if (filepath.endsWith(".continuerc.json")) {
|
||||
this.configHandler.reloadConfig();
|
||||
this.tabAutocompleteModel.clearLlm();
|
||||
} else if (
|
||||
|
|
|
|||
|
|
@ -30,9 +30,12 @@ class VsCodeIde implements IDE {
|
|||
|
||||
async getRepoName(dir: string): Promise<string | undefined> {
|
||||
const repo = await this.getRepo(vscode.Uri.file(dir));
|
||||
const remotes = repo?.repository?.remotes;
|
||||
if (!remotes) {
|
||||
return undefined;
|
||||
}
|
||||
const remote =
|
||||
repo?.repository.remotes.find((r: any) => r.name === "origin") ??
|
||||
repo?.repository.remotes[0];
|
||||
remotes?.find((r: any) => r.name === "origin") ?? remotes?.[0];
|
||||
if (!remote) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
@ -228,8 +231,10 @@ class VsCodeIde implements IDE {
|
|||
|
||||
async runCommand(command: string): Promise<void> {
|
||||
if (vscode.window.terminals.length) {
|
||||
vscode.window.terminals[0].show();
|
||||
vscode.window.terminals[0].sendText(command, false);
|
||||
const terminal =
|
||||
vscode.window.activeTerminal ?? vscode.window.terminals[0];
|
||||
terminal.show();
|
||||
terminal.sendText(command, false);
|
||||
} else {
|
||||
const terminal = vscode.window.createTerminal();
|
||||
terminal.show();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import * as vscode from "vscode";
|
|||
import { DIFF_DIRECTORY, DiffManager } from "../diff/horizontal";
|
||||
import { VerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
|
||||
import { editorSuggestionsLocked, editorToSuggestions } from "../suggestions";
|
||||
import { getAltOrOption, getMetaKeyLabel } from "../util/util";
|
||||
import { getAltOrOption, getMetaKeyLabel, getPlatform } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
|
||||
class VerticalPerLineCodeLensProvider implements vscode.CodeLensProvider {
|
||||
|
|
@ -227,12 +227,15 @@ interface TutorialCodeLensItems {
|
|||
lineIncludes: string;
|
||||
commands: vscode.Command[];
|
||||
}
|
||||
|
||||
const cmdCtrl = getPlatform() === "mac" ? "Cmd" : "Ctrl";
|
||||
|
||||
const actions: TutorialCodeLensItems[] = [
|
||||
{
|
||||
lineIncludes: "Step 2: Use the keyboard shortcut cmd/ctrl + L",
|
||||
lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+L]`,
|
||||
commands: [
|
||||
{
|
||||
title: `Do it for me`,
|
||||
title: `${cmdCtrl}+L`,
|
||||
command: "continue.focusContinueInput",
|
||||
},
|
||||
],
|
||||
|
|
@ -253,17 +256,12 @@ const actions: TutorialCodeLensItems[] = [
|
|||
],
|
||||
},
|
||||
{
|
||||
lineIncludes: 'Step 3: Type "<your edit request>" and press Enter',
|
||||
lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+I] to edit`,
|
||||
commands: [
|
||||
{
|
||||
title: `"/edit make this more efficient"`,
|
||||
command: "continue.sendMainUserInput",
|
||||
arguments: ["/edit make this more efficient"],
|
||||
},
|
||||
{
|
||||
title: `"/edit write comments for this function"`,
|
||||
command: "continue.sendMainUserInput",
|
||||
arguments: ["/edit write comments for this function"],
|
||||
title: `${cmdCtrl}+I`,
|
||||
command: "continue.quickEdit",
|
||||
arguments: ["Add comments"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -290,6 +288,15 @@ const actions: TutorialCodeLensItems[] = [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
lineIncludes: `Step 2: Use the keyboard shortcut [${cmdCtrl}+Shift+R]`,
|
||||
commands: [
|
||||
{
|
||||
title: `${cmdCtrl}+Shift+R`,
|
||||
command: "continue.debugTerminal",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
class TutorialCodeLensProvider implements vscode.CodeLensProvider {
|
||||
|
|
@ -346,26 +353,26 @@ class TutorialCodeLensProvider implements vscode.CodeLensProvider {
|
|||
}
|
||||
|
||||
// Folding of the tutorial
|
||||
const regionLines = lines
|
||||
.map((line, i) => [line, i])
|
||||
.filter(([line, i]) => (line as string).startsWith("# region "))
|
||||
.map(([line, i]) => i);
|
||||
for (const lineOfRegion of regionLines as number[]) {
|
||||
const range = new vscode.Range(lineOfRegion, 0, lineOfRegion + 1, 0);
|
||||
// const regionLines = lines
|
||||
// .map((line, i) => [line, i])
|
||||
// .filter(([line, i]) => (line as string).startsWith("# region "))
|
||||
// .map(([line, i]) => i);
|
||||
// for (const lineOfRegion of regionLines as number[]) {
|
||||
// const range = new vscode.Range(lineOfRegion, 0, lineOfRegion + 1, 0);
|
||||
|
||||
const linesToFold = regionLines
|
||||
.filter((i) => lineOfRegion !== i)
|
||||
.flatMap((i) => {
|
||||
return [i, (i as number) + 1];
|
||||
});
|
||||
codeLenses.push(
|
||||
new vscode.CodeLens(range, {
|
||||
title: `Begin Section`,
|
||||
command: "continue.foldAndUnfold",
|
||||
arguments: [linesToFold, [lineOfRegion, lineOfRegion + 1]],
|
||||
}),
|
||||
);
|
||||
}
|
||||
// const linesToFold = regionLines
|
||||
// .filter((i) => lineOfRegion !== i)
|
||||
// .flatMap((i) => {
|
||||
// return [i, (i as number) + 1];
|
||||
// });
|
||||
// codeLenses.push(
|
||||
// new vscode.CodeLens(range, {
|
||||
// title: `Begin Section`,
|
||||
// command: "continue.foldAndUnfold",
|
||||
// arguments: [linesToFold, [lineOfRegion, lineOfRegion + 1]],
|
||||
// }),
|
||||
// );
|
||||
// }
|
||||
|
||||
return codeLenses;
|
||||
}
|
||||
|
|
|
|||
16
extensions/vscode/src/util/cleanSlate.ts
Normal file
16
extensions/vscode/src/util/cleanSlate.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { ExtensionContext } from "vscode";
|
||||
/**
|
||||
* Clear all Continue-related artifacts to simulate a brand new user
|
||||
*/
|
||||
export function cleanSlate(context: ExtensionContext) {
|
||||
// Commented just to be safe
|
||||
// // Remove ~/.continue
|
||||
// const continuePath = getContinueGlobalPath();
|
||||
// if (fs.existsSync(continuePath)) {
|
||||
// fs.rmSync(continuePath, { recursive: true, force: true });
|
||||
// }
|
||||
// // Clear extension's globalState
|
||||
// context.globalState.keys().forEach((key) => {
|
||||
// context.globalState.update(key, undefined);
|
||||
// });
|
||||
}
|
||||
|
|
@ -56,6 +56,7 @@ export class TabAutocompleteModel {
|
|||
vscode.window
|
||||
.showWarningMessage(
|
||||
"Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs",
|
||||
"Download Ollama",
|
||||
"Documentation",
|
||||
)
|
||||
.then((value) => {
|
||||
|
|
@ -65,6 +66,8 @@ export class TabAutocompleteModel {
|
|||
"https://continue.dev/docs/walkthroughs/tab-autocomplete",
|
||||
),
|
||||
);
|
||||
} else if (value === "Download Ollama") {
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai"));
|
||||
}
|
||||
});
|
||||
this.shownOllamaWarning = true;
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ export class VsCodeWebviewProtocol {
|
|||
});
|
||||
// History
|
||||
this.on("history/list", (msg) => {
|
||||
return historyManager.list();
|
||||
return historyManager.list(msg.data);
|
||||
});
|
||||
this.on("history/save", (msg) => {
|
||||
historyManager.save(msg.data);
|
||||
|
|
@ -335,6 +335,17 @@ export class VsCodeWebviewProtocol {
|
|||
this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
this.on("llm/listModels", async (msg) => {
|
||||
try {
|
||||
const model = await this.configHandler.llmFromTitle(msg.data.title);
|
||||
const models = await model.listModels();
|
||||
return models;
|
||||
} catch (e) {
|
||||
console.warn("Error listing models", e);
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
||||
async function* llmStreamComplete(
|
||||
protocol: VsCodeWebviewProtocol,
|
||||
msg: Message<WebviewProtocol["llm/streamComplete"][0]>,
|
||||
|
|
@ -579,6 +590,7 @@ export class VsCodeWebviewProtocol {
|
|||
? setupOptimizedMode
|
||||
: setupOptimizedExistingUserMode,
|
||||
);
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
this.on("openUrl", (msg) => {
|
||||
|
|
@ -605,6 +617,9 @@ export class VsCodeWebviewProtocol {
|
|||
);
|
||||
});
|
||||
});
|
||||
this.on("copyText", async (msg) => {
|
||||
await vscode.env.clipboard.writeText(msg.data.text);
|
||||
});
|
||||
}
|
||||
|
||||
public request<T extends keyof ReverseWebviewProtocol>(
|
||||
|
|
@ -612,10 +627,16 @@ export class VsCodeWebviewProtocol {
|
|||
data: ReverseWebviewProtocol[T][0],
|
||||
): Promise<ReverseWebviewProtocol[T][1]> {
|
||||
const messageId = uuidv4();
|
||||
return new Promise((resolve) => {
|
||||
if (!this.webview) {
|
||||
resolve(undefined);
|
||||
return;
|
||||
return new Promise(async (resolve) => {
|
||||
let i = 0;
|
||||
while (!this.webview) {
|
||||
if (i >= 10) {
|
||||
resolve(undefined);
|
||||
return;
|
||||
} else {
|
||||
await new Promise((res) => setTimeout(res, i >= 5 ? 1000 : 500));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
this.send(messageType, data, messageId);
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
"resolveJsonModule": true /* Enable importing .json files */
|
||||
},
|
||||
"include": ["src/**/*", "../../core/**/*.ts"],
|
||||
"exclude": ["../../core/dist/**/*"]
|
||||
"exclude": ["../../core/dist/**/*", "../../core/test/**/*"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2389,7 +2389,7 @@ core-util-is@1.0.2:
|
|||
socket.io-client "^4.7.3"
|
||||
sqlite "^5.1.1"
|
||||
sqlite3 "^5.1.7"
|
||||
tree-sitter-wasms "^0.1.6"
|
||||
tree-sitter-wasms "^0.1.11"
|
||||
uuid "^9.0.1"
|
||||
vectordb "0.4.12"
|
||||
web-tree-sitter "^0.21.0"
|
||||
|
|
|
|||
2
gui/package-lock.json
generated
2
gui/package-lock.json
generated
|
|
@ -111,7 +111,7 @@
|
|||
"socket.io-client": "^4.7.3",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "0.4.12",
|
||||
"web-tree-sitter": "^0.21.0"
|
||||
|
|
|
|||
BIN
gui/public/logos/cohere.png
Normal file
BIN
gui/public/logos/cohere.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
|
|
@ -16,6 +16,7 @@ import { ContextSubmenuItem } from "core";
|
|||
import useSubmenuContextProviders from "./hooks/useSubmenuContextProviders";
|
||||
import { useVscTheme } from "./hooks/useVscTheme";
|
||||
import GUI from "./pages/gui";
|
||||
import LocalOnboarding from "./pages/localOnboarding";
|
||||
import ExistingUserOnboarding from "./pages/onboarding/existingUserOnboarding";
|
||||
import Onboarding from "./pages/onboarding/onboarding";
|
||||
import Stats from "./pages/stats";
|
||||
|
|
@ -74,6 +75,10 @@ const router = createMemoryRouter([
|
|||
path: "/existingUserOnboarding",
|
||||
element: <ExistingUserOnboarding />,
|
||||
},
|
||||
{
|
||||
path: "/localOnboarding",
|
||||
element: <LocalOnboarding />,
|
||||
},
|
||||
{
|
||||
path: "/migration",
|
||||
element: <MigrationPage />,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { HeaderButton, StyledTooltip } from ".";
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
interface HeaderButtonWithTextProps {
|
||||
text: string;
|
||||
text: string | undefined;
|
||||
onClick?: (e: any) => void;
|
||||
children: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
|
|
@ -15,6 +15,8 @@ interface HeaderButtonWithTextProps {
|
|||
onKeyDown?: (e: any) => void;
|
||||
tabIndex?: number;
|
||||
style?: React.CSSProperties;
|
||||
backgroundColor?: string;
|
||||
hoverBackgroundColor?: string;
|
||||
}
|
||||
|
||||
const HeaderButtonWithText = React.forwardRef<
|
||||
|
|
@ -29,6 +31,8 @@ const HeaderButtonWithText = React.forwardRef<
|
|||
return (
|
||||
<>
|
||||
<HeaderButton
|
||||
hoverBackgroundColor={props.hoverBackgroundColor}
|
||||
backgroundColor={props.backgroundColor}
|
||||
data-tooltip-id={`header_button_${id}`}
|
||||
inverted={props.inverted}
|
||||
disabled={props.disabled}
|
||||
|
|
@ -49,7 +53,8 @@ const HeaderButtonWithText = React.forwardRef<
|
|||
>
|
||||
{props.children}
|
||||
</HeaderButton>
|
||||
{tooltipPortalDiv &&
|
||||
{props.text &&
|
||||
tooltipPortalDiv &&
|
||||
ReactDOM.createPortal(
|
||||
<StyledTooltip id={`header_button_${id}`} place="bottom">
|
||||
{props.text}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import { useDispatch, useSelector } from "react-redux";
|
|||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
CustomScrollbarDiv,
|
||||
defaultBorderRadius,
|
||||
vscBackground,
|
||||
vscForeground,
|
||||
vscInputBackground,
|
||||
} from ".";
|
||||
|
|
@ -32,26 +32,9 @@ import ModelSelect from "./modelSelection/ModelSelect";
|
|||
// #region Styled Components
|
||||
const FOOTER_HEIGHT = "1.8em";
|
||||
|
||||
const LayoutTopDiv = styled.div`
|
||||
const LayoutTopDiv = styled(CustomScrollbarDiv)`
|
||||
height: 100%;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
scrollbar-base-color: transparent;
|
||||
scrollbar-width: thin;
|
||||
background-color: ${vscBackground};
|
||||
|
||||
& * {
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar:horizontal {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const BottomMessageDiv = styled.div<{ displayOnBottom: boolean }>`
|
||||
|
|
@ -103,6 +86,12 @@ const DropdownPortalDiv = styled.div`
|
|||
|
||||
// #endregion
|
||||
|
||||
const HIDE_FOOTER_ON_PAGES = [
|
||||
"/onboarding",
|
||||
"/existingUserOnboarding",
|
||||
"/localOnboarding",
|
||||
];
|
||||
|
||||
const Layout = () => {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
|
@ -179,6 +168,9 @@ const Layout = () => {
|
|||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isJetBrains()) {
|
||||
return;
|
||||
}
|
||||
const onboardingComplete = getLocalStorage("onboardingComplete");
|
||||
if (
|
||||
!onboardingComplete &&
|
||||
|
|
@ -220,9 +212,10 @@ const Layout = () => {
|
|||
<GridDiv>
|
||||
<Outlet />
|
||||
<DropdownPortalDiv id="model-select-top-div"></DropdownPortalDiv>
|
||||
<Footer>
|
||||
<div className="mr-auto flex gap-2 items-center">
|
||||
{/* {localStorage.getItem("ide") === "jetbrains" ||
|
||||
{HIDE_FOOTER_ON_PAGES.includes(location.pathname) || (
|
||||
<Footer>
|
||||
<div className="mr-auto flex gap-2 items-center">
|
||||
{/* {localStorage.getItem("ide") === "jetbrains" ||
|
||||
localStorage.getItem("hideFeature") === "true" || (
|
||||
<SparklesIcon
|
||||
className="cursor-pointer"
|
||||
|
|
@ -250,43 +243,44 @@ const Layout = () => {
|
|||
color="yellow"
|
||||
/>
|
||||
)} */}
|
||||
<ModelSelect />
|
||||
{indexingProgress >= 1 && // Would take up too much space together with indexing progress
|
||||
defaultModel?.provider === "free-trial" &&
|
||||
(location.pathname === "/settings" ||
|
||||
parseInt(localStorage.getItem("ftc") || "0") >= 125) && (
|
||||
<ProgressBar
|
||||
completed={parseInt(localStorage.getItem("ftc") || "0")}
|
||||
total={250}
|
||||
<ModelSelect />
|
||||
{indexingProgress >= 1 && // Would take up too much space together with indexing progress
|
||||
defaultModel?.provider === "free-trial" &&
|
||||
(location.pathname === "/settings" ||
|
||||
parseInt(localStorage.getItem("ftc") || "0") >= 125) && (
|
||||
<ProgressBar
|
||||
completed={parseInt(localStorage.getItem("ftc") || "0")}
|
||||
total={250}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isJetBrains() || (
|
||||
<IndexingProgressBar
|
||||
currentlyIndexing={indexingTask}
|
||||
completed={indexingProgress * 100}
|
||||
total={100}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isJetBrains() || (
|
||||
<IndexingProgressBar
|
||||
currentlyIndexing={indexingTask}
|
||||
completed={indexingProgress * 100}
|
||||
total={100}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<HeaderButtonWithText
|
||||
text="Help"
|
||||
onClick={() => {
|
||||
navigate("/help");
|
||||
}}
|
||||
>
|
||||
<QuestionMarkCircleIcon width="1.4em" height="1.4em" />
|
||||
</HeaderButtonWithText>
|
||||
<HeaderButtonWithText
|
||||
onClick={() => {
|
||||
// navigate("/settings");
|
||||
postToIde("openConfigJson", undefined);
|
||||
}}
|
||||
text="Configure Continue"
|
||||
>
|
||||
<Cog6ToothIcon width="1.4em" height="1.4em" />
|
||||
</HeaderButtonWithText>
|
||||
</Footer>
|
||||
</div>
|
||||
<HeaderButtonWithText
|
||||
text="Help"
|
||||
onClick={() => {
|
||||
navigate("/help");
|
||||
}}
|
||||
>
|
||||
<QuestionMarkCircleIcon width="1.4em" height="1.4em" />
|
||||
</HeaderButtonWithText>
|
||||
<HeaderButtonWithText
|
||||
onClick={() => {
|
||||
// navigate("/settings");
|
||||
postToIde("openConfigJson", undefined);
|
||||
}}
|
||||
text="Configure Continue"
|
||||
>
|
||||
<Cog6ToothIcon width="1.4em" height="1.4em" />
|
||||
</HeaderButtonWithText>
|
||||
</Footer>
|
||||
)}
|
||||
</GridDiv>
|
||||
|
||||
<BottomMessageDiv
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@ function AddDocsDialog() {
|
|||
<div className="p-4">
|
||||
<h3>Add Docs</h3>
|
||||
|
||||
<p>
|
||||
Continue pre-indexes many common documentation sites, but if there's one
|
||||
you don't see in the dropdown, enter the URL here. Continue's indexing
|
||||
engine will crawl the site and generate embeddings so that you can ask
|
||||
questions.
|
||||
</p>
|
||||
|
||||
<Input
|
||||
type="url"
|
||||
placeholder="URL"
|
||||
|
|
|
|||
|
|
@ -116,17 +116,17 @@ const vscodeShortcuts: KeyboardShortcutProps[] = [
|
|||
},
|
||||
{
|
||||
mac: "⌥ ⌘ Y",
|
||||
windows: "⎇ ⌃ Y",
|
||||
windows: "Alt ⌃ Y",
|
||||
description: "Accept Top Change in Diff",
|
||||
},
|
||||
{
|
||||
mac: "⌥ ⌘ N",
|
||||
windows: "⎇ ⌃ N",
|
||||
windows: "Alt ⌃ N",
|
||||
description: "Reject Top Change in Diff",
|
||||
},
|
||||
{
|
||||
mac: "⌥ ⌘ L",
|
||||
windows: "⎇ ⌃ L",
|
||||
windows: "Alt ⌃ L",
|
||||
description: "Toggle Auxiliary Bar",
|
||||
},
|
||||
{
|
||||
|
|
@ -184,12 +184,12 @@ const jetbrainsShortcuts: KeyboardShortcutProps[] = [
|
|||
},
|
||||
{
|
||||
mac: "⌥ ⇧ J",
|
||||
windows: "⎇ ⇧ J",
|
||||
windows: "Alt ⇧ J",
|
||||
description: "Quick Input",
|
||||
},
|
||||
{
|
||||
mac: "⌥ ⌘ J",
|
||||
windows: "⎇ ⌃ J",
|
||||
windows: "Alt ⌃ J",
|
||||
description: "Toggle Sidebar",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,20 +139,40 @@ export const Button = styled.button`
|
|||
}
|
||||
`;
|
||||
|
||||
export const StyledTooltip = styled(Tooltip)`
|
||||
font-size: 12px;
|
||||
background-color: ${vscEditorBackground};
|
||||
color: ${vscForeground};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
box-shadow: 0 0 1px 0 ${vscForeground};
|
||||
padding: 2px;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
z-index: 1000;
|
||||
export const CustomScrollbarDiv = styled.div`
|
||||
scrollbar-base-color: transparent;
|
||||
scrollbar-width: thin;
|
||||
background-color: ${vscBackground};
|
||||
|
||||
max-width: 80vw;
|
||||
& * {
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar:horizontal {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const TooltipStyles = {
|
||||
fontSize: "12px",
|
||||
backgroundColor: vscInputBackground,
|
||||
boxShadow: `0px 0px 2px 1px ${vscBadgeBackground}`,
|
||||
color: vscForeground,
|
||||
padding: "2px 6px",
|
||||
zIndex: 1000,
|
||||
maxWidth: "80vw",
|
||||
};
|
||||
|
||||
export function StyledTooltip(props) {
|
||||
return <Tooltip {...props} style={TooltipStyles} />;
|
||||
}
|
||||
|
||||
export const TextArea = styled.textarea`
|
||||
padding: 8px;
|
||||
font-family: inherit;
|
||||
|
|
@ -305,9 +325,14 @@ export const appear = keyframes`
|
|||
}
|
||||
`;
|
||||
|
||||
export const HeaderButton = styled.button<{ inverted: boolean | undefined }>`
|
||||
background-color: ${({ inverted }) =>
|
||||
inverted ? vscForeground : "transparent"};
|
||||
export const HeaderButton = styled.button<{
|
||||
inverted: boolean | undefined;
|
||||
backgroundColor?: string;
|
||||
hoverBackgroundColor?: string;
|
||||
}>`
|
||||
background-color: ${({ inverted, backgroundColor }) => {
|
||||
return backgroundColor ?? (inverted ? vscForeground : "transparent");
|
||||
}};
|
||||
color: ${({ inverted }) => (inverted ? vscBackground : vscForeground)};
|
||||
|
||||
border: none;
|
||||
|
|
@ -320,9 +345,9 @@ export const HeaderButton = styled.button<{ inverted: boolean | undefined }>`
|
|||
}
|
||||
|
||||
&:hover {
|
||||
background-color: ${({ inverted }) =>
|
||||
background-color: ${({ inverted, hoverBackgroundColor }) =>
|
||||
typeof inverted === "undefined" || inverted
|
||||
? vscInputBackground
|
||||
? hoverBackgroundColor ?? vscInputBackground
|
||||
: "transparent"};
|
||||
}
|
||||
display: flex;
|
||||
|
|
@ -15,6 +15,7 @@ import {
|
|||
} from "..";
|
||||
import { defaultModelSelector } from "../../redux/selectors/modelSelectors";
|
||||
import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
|
||||
import { isJetBrains } from "../../util/ide";
|
||||
|
||||
const StyledDiv = styled.div<{ hidden?: boolean }>`
|
||||
position: absolute;
|
||||
|
|
@ -89,7 +90,11 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
+ Add Context
|
||||
</span>
|
||||
{defaultModel &&
|
||||
modelSupportsImages(defaultModel.provider, defaultModel.model) && (
|
||||
modelSupportsImages(
|
||||
defaultModel.provider,
|
||||
defaultModel.model,
|
||||
defaultModel.title,
|
||||
) && (
|
||||
<span
|
||||
className="ml-1.5 mt-0.5"
|
||||
onMouseLeave={() => setFileSelectHovered(false)}
|
||||
|
|
@ -128,22 +133,25 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
</span>
|
||||
)}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
color: props.usingCodebase ? vscBadgeBackground : lightGray,
|
||||
backgroundColor: props.usingCodebase ? lightGray + "33" : undefined,
|
||||
borderRadius: defaultBorderRadius,
|
||||
padding: "2px 4px",
|
||||
}}
|
||||
onClick={(e) => {
|
||||
props.onEnter({
|
||||
useCodebase: true,
|
||||
});
|
||||
}}
|
||||
className={"hover:underline cursor-pointer float-right"}
|
||||
>
|
||||
{getMetaKeyLabel()} ⏎ Use Codebase
|
||||
</span>
|
||||
|
||||
{isJetBrains() || (
|
||||
<span
|
||||
style={{
|
||||
color: props.usingCodebase ? vscBadgeBackground : lightGray,
|
||||
backgroundColor: props.usingCodebase ? lightGray + "33" : undefined,
|
||||
borderRadius: defaultBorderRadius,
|
||||
padding: "2px 4px",
|
||||
}}
|
||||
onClick={(e) => {
|
||||
props.onEnter({
|
||||
useCodebase: true,
|
||||
});
|
||||
}}
|
||||
className={"hover:underline cursor-pointer float-right"}
|
||||
>
|
||||
{getMetaKeyLabel()} ⏎ Use Codebase
|
||||
</span>
|
||||
)}
|
||||
|
||||
<EnterButton
|
||||
offFocus={props.usingCodebase}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ const ItemsDiv = styled.div`
|
|||
0 0 0 1px rgba(0, 0, 0, 0.05),
|
||||
0px 10px 20px rgba(0, 0, 0, 0.1);
|
||||
font-size: 0.9rem;
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
padding: 0.2rem;
|
||||
position: relative;
|
||||
|
||||
|
|
@ -315,6 +315,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
) : (
|
||||
<>
|
||||
{subMenuTitle && <ItemDiv className="mb-2">{subMenuTitle}</ItemDiv>}
|
||||
{/* <CustomScrollbarDiv className="overflow-y-scroll max-h-96"> */}
|
||||
{allItems.length ? (
|
||||
allItems.map((item, index) => (
|
||||
<ItemDiv
|
||||
|
|
@ -369,6 +370,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
) : (
|
||||
<ItemDiv className="item">No results</ItemDiv>
|
||||
)}
|
||||
{/* </CustomScrollbarDiv> */}
|
||||
</>
|
||||
)}
|
||||
</ItemsDiv>
|
||||
|
|
|
|||
|
|
@ -575,7 +575,13 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
setShowDragOverMsg(true);
|
||||
}}
|
||||
onDrop={(event) => {
|
||||
if (!modelSupportsImages(defaultModel.provider, defaultModel.model)) {
|
||||
if (
|
||||
!modelSupportsImages(
|
||||
defaultModel.provider,
|
||||
defaultModel.model,
|
||||
defaultModel.title,
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
setShowDragOverMsg(false);
|
||||
|
|
@ -626,7 +632,11 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
}}
|
||||
/>
|
||||
{showDragOverMsg &&
|
||||
modelSupportsImages(defaultModel.provider, defaultModel.model) && (
|
||||
modelSupportsImages(
|
||||
defaultModel.provider,
|
||||
defaultModel.model,
|
||||
defaultModel.title,
|
||||
) && (
|
||||
<>
|
||||
<HoverDiv></HoverDiv>
|
||||
<HoverTextDiv>Hold ⇧ to drop image</HoverTextDiv>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function getSuggestion(
|
|||
items: (props: { query: string }) => Promise<ComboBoxItem[]>,
|
||||
enterSubmenu: (editor: Editor, providerId: string) => void = (editor) => {},
|
||||
onClose: () => void = () => {},
|
||||
onOpen: () => void = () => {}
|
||||
onOpen: () => void = () => {},
|
||||
) {
|
||||
return {
|
||||
items,
|
||||
|
|
@ -82,19 +82,19 @@ export function getMentionSuggestion(
|
|||
getSubmenuContextItemsRef: MutableRefObject<
|
||||
(
|
||||
providerTitle: string | undefined,
|
||||
query: string
|
||||
query: string,
|
||||
) => (ContextSubmenuItem & { providerTitle: string })[]
|
||||
>,
|
||||
enterSubmenu: (editor: Editor, providerId: string) => void,
|
||||
onClose: () => void,
|
||||
onOpen: () => void,
|
||||
inSubmenu: MutableRefObject<string | undefined>
|
||||
inSubmenu: MutableRefObject<string | undefined>,
|
||||
) {
|
||||
const items = async ({ query }) => {
|
||||
if (inSubmenu.current) {
|
||||
const results = getSubmenuContextItemsRef.current(
|
||||
inSubmenu.current,
|
||||
query
|
||||
query,
|
||||
);
|
||||
return results.map((result) => {
|
||||
return {
|
||||
|
|
@ -111,7 +111,7 @@ export function getMentionSuggestion(
|
|||
?.filter(
|
||||
(provider) =>
|
||||
provider.title.toLowerCase().startsWith(query.toLowerCase()) ||
|
||||
provider.displayTitle.toLowerCase().startsWith(query.toLowerCase())
|
||||
provider.displayTitle.toLowerCase().startsWith(query.toLowerCase()),
|
||||
)
|
||||
.map((provider) => ({
|
||||
name: provider.displayTitle,
|
||||
|
|
@ -144,7 +144,7 @@ export function getMentionSuggestion(
|
|||
action: () => {
|
||||
ideRequest(
|
||||
"openUrl",
|
||||
"https://continue.dev/docs/customization/context-providers#built-in-context-providers"
|
||||
"https://continue.dev/docs/customization/context-providers#built-in-context-providers",
|
||||
);
|
||||
},
|
||||
description: "",
|
||||
|
|
@ -159,7 +159,7 @@ export function getMentionSuggestion(
|
|||
export function getCommandSuggestion(
|
||||
availableSlashCommandsRef: MutableRefObject<ComboBoxItem[]>,
|
||||
onClose: () => void,
|
||||
onOpen: () => void
|
||||
onOpen: () => void,
|
||||
) {
|
||||
const items = async ({ query }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -40,6 +40,35 @@ interface CodeBlockToolBarProps {
|
|||
}
|
||||
|
||||
const terminalLanguages = ["bash", "sh"];
|
||||
const commonTerminalCommands = [
|
||||
"npm",
|
||||
"pnpm",
|
||||
"yarn",
|
||||
"bun",
|
||||
"deno",
|
||||
"npx",
|
||||
"cd",
|
||||
"ls",
|
||||
"pwd",
|
||||
"pip",
|
||||
"python",
|
||||
"node",
|
||||
"git",
|
||||
"curl",
|
||||
"wget",
|
||||
"rbenv",
|
||||
"gem",
|
||||
"ruby",
|
||||
"bundle",
|
||||
];
|
||||
function isTerminalCodeBlock(language: string | undefined, text: string) {
|
||||
return (
|
||||
terminalLanguages.includes(language) ||
|
||||
(language?.length === 0 &&
|
||||
(text.trim().split("\n").length === 1 ||
|
||||
commonTerminalCommands.some((c) => text.trim().startsWith(c))))
|
||||
);
|
||||
}
|
||||
|
||||
function CodeBlockToolBar(props: CodeBlockToolBarProps) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
|
@ -52,7 +81,7 @@ function CodeBlockToolBar(props: CodeBlockToolBarProps) {
|
|||
<>
|
||||
<HeaderButtonWithText
|
||||
text={
|
||||
terminalLanguages.includes(props.language)
|
||||
isTerminalCodeBlock(props.language, props.text)
|
||||
? "Run in terminal"
|
||||
: applying
|
||||
? "Applying..."
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ function ListBoxOption({
|
|||
<span>{option.title}</span>
|
||||
{hovered && showDelete && (
|
||||
<HeaderButtonWithText
|
||||
text="Delete"
|
||||
text={undefined}
|
||||
onClick={(e) => {
|
||||
dispatch(setShowDialog(true));
|
||||
dispatch(
|
||||
|
|
@ -164,7 +164,8 @@ function ListBoxOption({
|
|||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
style={{ backgroundColor: vscInputBackground }}
|
||||
backgroundColor={vscInputBackground}
|
||||
hoverBackgroundColor={vscBackground}
|
||||
className="absolute right-0 p-1"
|
||||
>
|
||||
<TrashIcon width="1.2em" height="1.2em" />
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { defaultModelSelector } from "../redux/selectors/modelSelectors";
|
|||
import { newSession } from "../redux/slices/stateSlice";
|
||||
import { RootState } from "../redux/store";
|
||||
import { ideRequest } from "../util/ide";
|
||||
import { getLocalStorage, setLocalStorage } from "../util/localStorage";
|
||||
|
||||
function truncateText(text: string, maxLength: number) {
|
||||
if (text.length > maxLength) {
|
||||
|
|
@ -20,11 +21,14 @@ function useHistory(dispatch: Dispatch) {
|
|||
const state = useSelector((state: RootState) => state.state);
|
||||
const defaultModel = useSelector(defaultModelSelector);
|
||||
const disableSessionTitles = useSelector(
|
||||
(store: RootState) => store.state.config.disableSessionTitles
|
||||
(store: RootState) => store.state.config.disableSessionTitles,
|
||||
);
|
||||
|
||||
async function getHistory(): Promise<SessionInfo[]> {
|
||||
return await ideRequest("history/list", undefined);
|
||||
async function getHistory(
|
||||
offset?: number,
|
||||
limit?: number,
|
||||
): Promise<SessionInfo[]> {
|
||||
return await ideRequest("history/list", { offset, limit });
|
||||
}
|
||||
|
||||
async function saveSession() {
|
||||
|
|
@ -39,7 +43,7 @@ function useHistory(dispatch: Dispatch) {
|
|||
.split("\n")
|
||||
.filter((l) => l.trim() !== "")
|
||||
.slice(-1)[0] || "",
|
||||
50
|
||||
50,
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -72,6 +76,7 @@ function useHistory(dispatch: Dispatch) {
|
|||
sessionId: stateCopy.sessionId,
|
||||
workspaceDirectory: window.workspacePaths?.[0] || "",
|
||||
};
|
||||
setLocalStorage("lastSessionId", stateCopy.sessionId);
|
||||
return await ideRequest("history/save", sessionInfo);
|
||||
}
|
||||
|
||||
|
|
@ -80,10 +85,31 @@ function useHistory(dispatch: Dispatch) {
|
|||
}
|
||||
|
||||
async function loadSession(id: string): Promise<PersistedSessionInfo> {
|
||||
return await ideRequest("history/load", { id });
|
||||
setLocalStorage("lastSessionId", state.sessionId);
|
||||
const json: PersistedSessionInfo = await ideRequest("history/load", { id });
|
||||
dispatch(newSession(json));
|
||||
return json;
|
||||
}
|
||||
|
||||
return { getHistory, saveSession, deleteSession, loadSession };
|
||||
async function loadLastSession(): Promise<PersistedSessionInfo> {
|
||||
const lastSessionId = getLocalStorage("lastSessionId");
|
||||
if (lastSessionId) {
|
||||
return await loadSession(lastSessionId);
|
||||
}
|
||||
}
|
||||
|
||||
function getLastSessionId(): string {
|
||||
return getLocalStorage("lastSessionId");
|
||||
}
|
||||
|
||||
return {
|
||||
getHistory,
|
||||
saveSession,
|
||||
deleteSession,
|
||||
loadSession,
|
||||
loadLastSession,
|
||||
getLastSessionId,
|
||||
};
|
||||
}
|
||||
|
||||
export default useHistory;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ContextSubmenuItem } from "core";
|
||||
import { getBasename, getLastNPathParts } from "core/util";
|
||||
import { deduplicateArray, getBasename, getLastNPathParts } from "core/util";
|
||||
import MiniSearch, { SearchResult } from "minisearch";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
|
@ -13,6 +13,8 @@ const MINISEARCH_OPTIONS = {
|
|||
fuzzy: 2,
|
||||
};
|
||||
|
||||
const MAX_LENGTH = 10;
|
||||
|
||||
function useSubmenuContextProviders() {
|
||||
// TODO: Refresh periodically
|
||||
|
||||
|
|
@ -24,7 +26,7 @@ function useSubmenuContextProviders() {
|
|||
}>({});
|
||||
|
||||
const contextProviderDescriptions = useSelector(
|
||||
selectContextProviderDescriptions
|
||||
selectContextProviderDescriptions,
|
||||
);
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
|
@ -57,11 +59,17 @@ function useSubmenuContextProviders() {
|
|||
|
||||
if (data.provider === "file") {
|
||||
const openFiles = await getOpenFileItems();
|
||||
setFallbackResults((prev) => ({ ...prev, file: openFiles }));
|
||||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
file: [
|
||||
...openFiles,
|
||||
...data.submenuItems.slice(0, MAX_LENGTH - openFiles.length),
|
||||
],
|
||||
}));
|
||||
} else {
|
||||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
[data.provider]: data.submenuItems.slice(0, 6),
|
||||
[data.provider]: data.submenuItems.slice(0, MAX_LENGTH),
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
|
@ -77,7 +85,13 @@ function useSubmenuContextProviders() {
|
|||
// Refresh open files periodically
|
||||
const interval = setInterval(async () => {
|
||||
const openFiles = await getOpenFileItems();
|
||||
setFallbackResults((prev) => ({ ...prev, file: openFiles }));
|
||||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
file: deduplicateArray(
|
||||
[...openFiles, ...(Array.isArray(prev.file) ? prev.file : [])],
|
||||
(a, b) => a.id === b.id,
|
||||
),
|
||||
}));
|
||||
}, 2_000);
|
||||
|
||||
return () => {
|
||||
|
|
@ -103,11 +117,17 @@ function useSubmenuContextProviders() {
|
|||
|
||||
if (description.title === "file") {
|
||||
const openFiles = await getOpenFileItems();
|
||||
setFallbackResults((prev) => ({ ...prev, file: openFiles }));
|
||||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
file: [
|
||||
...openFiles,
|
||||
...items.slice(0, MAX_LENGTH - openFiles.length),
|
||||
],
|
||||
}));
|
||||
} else {
|
||||
setFallbackResults((prev) => ({
|
||||
...prev,
|
||||
[description.title]: items.slice(0, 6),
|
||||
[description.title]: items.slice(0, MAX_LENGTH),
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
|
@ -115,14 +135,14 @@ function useSubmenuContextProviders() {
|
|||
|
||||
function getSubmenuSearchResults(
|
||||
providerTitle: string | undefined,
|
||||
query: string
|
||||
query: string,
|
||||
): SearchResult[] {
|
||||
if (providerTitle === undefined) {
|
||||
// Return search combined from all providers
|
||||
const results = Object.keys(minisearches).map((providerTitle) => {
|
||||
const results = minisearches[providerTitle].search(
|
||||
query,
|
||||
MINISEARCH_OPTIONS
|
||||
MINISEARCH_OPTIONS,
|
||||
);
|
||||
return results.map((result) => {
|
||||
return { ...result, providerTitle };
|
||||
|
|
@ -145,7 +165,7 @@ function useSubmenuContextProviders() {
|
|||
function getSubmenuContextItems(
|
||||
providerTitle: string | undefined,
|
||||
query: string,
|
||||
limit: number = 10
|
||||
limit: number = MAX_LENGTH,
|
||||
): (ContextSubmenuItem & { providerTitle: string })[] {
|
||||
const results = getSubmenuSearchResults(providerTitle, query);
|
||||
if (results.length === 0) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
ArrowLeftIcon,
|
||||
ChatBubbleOvalLeftIcon,
|
||||
CodeBracketSquareIcon,
|
||||
ExclamationTriangleIcon,
|
||||
|
|
@ -102,7 +103,7 @@ const NewSessionButton = styled.div`
|
|||
font-size: 12px;
|
||||
|
||||
border-radius: ${defaultBorderRadius};
|
||||
padding: 2px 8px;
|
||||
padding: 2px 6px;
|
||||
color: ${lightGray};
|
||||
|
||||
&:hover {
|
||||
|
|
@ -256,10 +257,10 @@ function GUI(props: GUIProps) {
|
|||
dispatch(
|
||||
setDialogMessage(
|
||||
<div className="text-center p-4">
|
||||
👋 Thanks for using Continue. We are a beta product and love
|
||||
working closely with our first users. If you're interested in
|
||||
speaking, enter your name and email. We won't use this
|
||||
information for anything other than reaching out.
|
||||
👋 Thanks for using Continue. We are always trying to improve
|
||||
and love hearing from users. If you're interested in speaking,
|
||||
enter your name and email. We won't use this information for
|
||||
anything other than reaching out.
|
||||
<br />
|
||||
<br />
|
||||
<form
|
||||
|
|
@ -327,7 +328,8 @@ function GUI(props: GUIProps) {
|
|||
],
|
||||
);
|
||||
|
||||
const { saveSession } = useHistory(dispatch);
|
||||
const { saveSession, getLastSessionId, loadLastSession } =
|
||||
useHistory(dispatch);
|
||||
|
||||
useWebviewListener(
|
||||
"newSession",
|
||||
|
|
@ -467,6 +469,16 @@ function GUI(props: GUIProps) {
|
|||
>
|
||||
New Session ({getMetaKeyLabel()} {isJetBrains() ? "J" : "L"})
|
||||
</NewSessionButton>
|
||||
) : getLastSessionId() ? (
|
||||
<NewSessionButton
|
||||
onClick={async () => {
|
||||
loadLastSession();
|
||||
}}
|
||||
className="mr-auto flex items-center gap-1"
|
||||
>
|
||||
<ArrowLeftIcon width="11px" height="11px" />
|
||||
Last Session
|
||||
</NewSessionButton>
|
||||
) : null}
|
||||
</div>
|
||||
</TopGuiDiv>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ArrowLeftIcon, TrashIcon } from "@heroicons/react/24/outline";
|
||||
import { PersistedSessionInfo, SessionInfo } from "core";
|
||||
import { SessionInfo } from "core";
|
||||
import MiniSearch from "minisearch";
|
||||
import React, { Fragment, useEffect, useState } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
|
@ -16,7 +16,6 @@ import {
|
|||
import HeaderButtonWithText from "../components/HeaderButtonWithText";
|
||||
import useHistory from "../hooks/useHistory";
|
||||
import { useNavigationListener } from "../hooks/useNavigationListener";
|
||||
import { newSession } from "../redux/slices/stateSlice";
|
||||
import { getFontSize } from "../util";
|
||||
|
||||
const SearchBar = styled.input`
|
||||
|
|
@ -106,10 +105,7 @@ function TableRow({
|
|||
// Save current session
|
||||
saveSession();
|
||||
|
||||
const json: PersistedSessionInfo = await loadSession(
|
||||
session.sessionId
|
||||
);
|
||||
dispatch(newSession(json));
|
||||
await loadSession(session.sessionId);
|
||||
navigate("/");
|
||||
}}
|
||||
>
|
||||
|
|
@ -165,7 +161,7 @@ function History() {
|
|||
|
||||
const deleteSessionInUI = async (sessionId: string) => {
|
||||
setSessions((prev) =>
|
||||
prev.filter((session) => session.sessionId !== sessionId)
|
||||
prev.filter((session) => session.sessionId !== sessionId),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -182,7 +178,7 @@ function History() {
|
|||
new MiniSearch({
|
||||
fields: ["title"],
|
||||
storeFields: ["title", "sessionId", "id"],
|
||||
})
|
||||
}),
|
||||
);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
|
||||
|
|
@ -195,7 +191,7 @@ function History() {
|
|||
title: session.title,
|
||||
sessionId: session.sessionId,
|
||||
id: session.sessionId,
|
||||
}))
|
||||
})),
|
||||
);
|
||||
};
|
||||
fetchSessions();
|
||||
|
|
@ -227,8 +223,8 @@ function History() {
|
|||
.sort(
|
||||
(a, b) =>
|
||||
parseDate(b.dateCreated).getTime() -
|
||||
parseDate(a.dateCreated).getTime()
|
||||
)
|
||||
parseDate(a.dateCreated).getTime(),
|
||||
),
|
||||
);
|
||||
}, [filteringByWorkspace, sessions, searchTerm, minisearch]);
|
||||
|
||||
|
|
|
|||
297
gui/src/pages/localOnboarding.tsx
Normal file
297
gui/src/pages/localOnboarding.tsx
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
import { CheckIcon, PlayIcon } from "@heroicons/react/24/outline";
|
||||
import { CheckCircleIcon as CheckCircleIconSolid } from "@heroicons/react/24/solid";
|
||||
import { useEffect, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
Button,
|
||||
StyledTooltip,
|
||||
defaultBorderRadius,
|
||||
lightGray,
|
||||
vscButtonBackground,
|
||||
vscButtonForeground,
|
||||
vscForeground,
|
||||
} from "../components";
|
||||
import { ideRequest } from "../util/ide";
|
||||
import { WebviewIde } from "../util/webviewIde";
|
||||
import { StyledButton } from "./onboarding/components";
|
||||
|
||||
const ModelPillDiv = styled.div<{ selected: boolean }>`
|
||||
padding: 4px 4px;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
border: 0.5px solid ${lightGray};
|
||||
background-color: ${({ selected }) =>
|
||||
selected ? vscButtonBackground : "transparent"};
|
||||
color: ${({ selected }) => (selected ? vscButtonForeground : vscForeground)};
|
||||
cursor: pointer;
|
||||
transition: background-color 0.1s ease-out;
|
||||
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
color: ${vscButtonForeground};
|
||||
background-color: ${vscButtonBackground};
|
||||
}
|
||||
`;
|
||||
|
||||
function CheckMarkHeader(props: { children: string; complete: boolean }) {
|
||||
return (
|
||||
<div className="flex gap-4 items-center">
|
||||
{props.complete ? (
|
||||
<CheckCircleIconSolid
|
||||
width="24px"
|
||||
height="24px"
|
||||
color="#0b0"
|
||||
className="flex-none"
|
||||
></CheckCircleIconSolid>
|
||||
) : (
|
||||
<div
|
||||
className="flex-none border border-solid rounded-full w-5 h-5 mt-1"
|
||||
style={{ borderColor: lightGray }}
|
||||
></div>
|
||||
)}
|
||||
<h3>{props.children}</h3>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const RunInTerminalDiv = styled.div<{ clicked: boolean }>`
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
display: flex;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
width: fit-content;
|
||||
gap: 8px;
|
||||
|
||||
${({ clicked }) => clicked && "background-color: #0f02;"}
|
||||
|
||||
align-items: center;
|
||||
|
||||
border: 1px solid ${lightGray};
|
||||
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background-color: ${({ clicked }) => (clicked ? "#0f02" : "#fff1")};
|
||||
}
|
||||
`;
|
||||
|
||||
function RunInTerminalButton(props: { command: string }) {
|
||||
const [clicked, setClicked] = useState(false);
|
||||
|
||||
const id = `info-hover-${encodeURIComponent(props.command)}`;
|
||||
const tooltipPortalDiv = document.getElementById("tooltip-portal-div");
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className="flex items-center justify-center mt-8"
|
||||
data-tooltip-id={id}
|
||||
>
|
||||
<RunInTerminalDiv
|
||||
clicked={clicked}
|
||||
style={{ border: `0.5px solid ${lightGray}` }}
|
||||
className="grid-cols-2"
|
||||
onClick={() => {
|
||||
new WebviewIde().runCommand(props.command);
|
||||
setClicked(true);
|
||||
setTimeout(() => setClicked(false), 2000);
|
||||
ideRequest("copyText", { text: props.command });
|
||||
}}
|
||||
>
|
||||
<pre>
|
||||
<code
|
||||
style={{
|
||||
color: vscForeground,
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
{props.command}
|
||||
</code>
|
||||
</pre>
|
||||
{clicked ? (
|
||||
<CheckIcon
|
||||
width="20px"
|
||||
height="20px"
|
||||
className="cursor-pointer hover:bg-white"
|
||||
color="#0b0"
|
||||
/>
|
||||
) : (
|
||||
<PlayIcon
|
||||
width="20px"
|
||||
height="20px"
|
||||
className="cursor-pointer hover:bg-white"
|
||||
/>
|
||||
)}
|
||||
</RunInTerminalDiv>
|
||||
</div>
|
||||
{tooltipPortalDiv &&
|
||||
ReactDOM.createPortal(
|
||||
<StyledTooltip id={id} place="top">
|
||||
Run in terminal
|
||||
</StyledTooltip>,
|
||||
tooltipPortalDiv,
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// The "Ollama" title is assumed from core/config/onboarding.ts
|
||||
const assumedModelTitle = "Ollama";
|
||||
const recommendedChatModel = "llama3";
|
||||
const recommendedAutocompleteModel = "starcoder2:3b";
|
||||
|
||||
function LocalOnboarding() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [stage1Done, setStage1Done] = useState(false);
|
||||
const [stage2Done, setStage2Done] = useState(false);
|
||||
const [stage3Done, setStage3Done] = useState(false);
|
||||
|
||||
const [ollamaModels, setOllamaModels] = useState<string[] | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const [ollamaConnectionStatus, setOllamaConnectionStatus] = useState<
|
||||
"waitingToDownload" | "downloading" | "verified"
|
||||
>("waitingToDownload");
|
||||
|
||||
const [selectedModel, setSelectedModel] = useState<string | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (ollamaModels?.some((model) => model.startsWith(recommendedChatModel))) {
|
||||
setStage2Done(true);
|
||||
|
||||
// Send an empty request to load the model
|
||||
ideRequest("llm/complete", {
|
||||
completionOptions: {},
|
||||
prompt: "",
|
||||
title: assumedModelTitle,
|
||||
});
|
||||
}
|
||||
}, [ollamaModels]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
ollamaModels?.some((model) =>
|
||||
model.startsWith(recommendedAutocompleteModel),
|
||||
)
|
||||
) {
|
||||
setStage3Done(true);
|
||||
}
|
||||
}, [ollamaModels]);
|
||||
|
||||
useEffect(() => {
|
||||
const checkModels = async () => {
|
||||
const models = await ideRequest("llm/listModels", {
|
||||
title: assumedModelTitle,
|
||||
});
|
||||
if (Array.isArray(models)) {
|
||||
setOllamaConnectionStatus("verified");
|
||||
setStage1Done(true);
|
||||
setOllamaModels(models);
|
||||
}
|
||||
};
|
||||
checkModels();
|
||||
const interval = setInterval(checkModels, 1000);
|
||||
|
||||
return () => {
|
||||
clearInterval(interval);
|
||||
};
|
||||
}, [ollamaConnectionStatus]);
|
||||
|
||||
return (
|
||||
<div className="p-8 overflow-y-scroll">
|
||||
<h1 className="text-center">Set up your local LLM</h1>
|
||||
<CheckMarkHeader complete={stage1Done}>
|
||||
1. Download Ollama
|
||||
</CheckMarkHeader>
|
||||
{ollamaConnectionStatus === "verified" || (
|
||||
<>
|
||||
<p>
|
||||
Click below to download Ollama from https://ollama.ai. Once
|
||||
downloaded, you only need to start the application.
|
||||
</p>
|
||||
<div className="text-center">
|
||||
<a href="https://ollama.ai">
|
||||
<Button onClick={() => setOllamaConnectionStatus("downloading")}>
|
||||
Download Ollama
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{ollamaConnectionStatus === "downloading" && (
|
||||
<p>Checking for connection to Ollama...</p>
|
||||
)}
|
||||
{ollamaConnectionStatus === "verified" && <p>Ollama is connected!</p>}
|
||||
<br></br>
|
||||
<CheckMarkHeader complete={stage2Done}>
|
||||
2. Download a model for chat
|
||||
</CheckMarkHeader>
|
||||
{stage1Done && (
|
||||
<>
|
||||
We recommend using Llama 3, the latest open-source model trained by
|
||||
Meta.
|
||||
<br></br>
|
||||
<RunInTerminalButton
|
||||
command={`ollama run ${recommendedChatModel}`}
|
||||
></RunInTerminalButton>
|
||||
</>
|
||||
)}
|
||||
<br></br>
|
||||
<CheckMarkHeader complete={stage3Done}>
|
||||
3. Download a model for tab autocomplete
|
||||
</CheckMarkHeader>
|
||||
{stage1Done && (
|
||||
<>
|
||||
We recommend using Starcoder 2, a state-of-the-art 3b parameter
|
||||
autocomplete model trained by Hugging Face.
|
||||
<br></br>
|
||||
<RunInTerminalButton
|
||||
command={`ollama run ${recommendedAutocompleteModel}`}
|
||||
></RunInTerminalButton>
|
||||
</>
|
||||
)}
|
||||
{/* {ollamaModels?.length > 0 || (
|
||||
<div>
|
||||
<p>
|
||||
It looks like you don't have any models downloaded. Click here to
|
||||
download the recommended model, "starcoder2:3b". This will take up
|
||||
1.7GB of space.
|
||||
</p>
|
||||
<div className="text-right">
|
||||
<Button onClick={() => {}}>Download Starcoder 2</Button>
|
||||
</div>
|
||||
</div>
|
||||
)} */}
|
||||
{/* <div className="flex gap-1 flex-wrap">
|
||||
{ollamaModels?.map((model) => {
|
||||
return (
|
||||
<ModelPillDiv
|
||||
selected={selectedModel === model}
|
||||
onClick={() => setSelectedModel(model)}
|
||||
>
|
||||
{model}
|
||||
</ModelPillDiv>
|
||||
);
|
||||
})}
|
||||
</div> */}
|
||||
<br></br>
|
||||
<div className="flex flex-col justify-end mt-8">
|
||||
<StyledButton
|
||||
disabled={false}
|
||||
onClick={() => {
|
||||
navigate("/");
|
||||
}}
|
||||
>
|
||||
Continue
|
||||
</StyledButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default LocalOnboarding;
|
||||
|
|
@ -95,34 +95,54 @@ function Models() {
|
|||
</GridDiv>
|
||||
) : (
|
||||
<GridDiv>
|
||||
{Object.entries(MODEL_INFO).map(([name, pkg]) => (
|
||||
<ModelCard
|
||||
title={pkg.title}
|
||||
description={pkg.description}
|
||||
tags={pkg.tags}
|
||||
icon={pkg.icon}
|
||||
dimensions={pkg.dimensions}
|
||||
providerOptions={pkg.providerOptions}
|
||||
onClick={(e, dimensionChoices, selectedProvider) => {
|
||||
const model = {
|
||||
...pkg.params,
|
||||
..._.merge(
|
||||
{},
|
||||
...(pkg.dimensions?.map((dimension, i) => {
|
||||
if (!dimensionChoices?.[i]) return {};
|
||||
return {
|
||||
...dimension.options[dimensionChoices[i]],
|
||||
};
|
||||
}) || [])
|
||||
),
|
||||
provider: PROVIDER_INFO[selectedProvider].provider,
|
||||
};
|
||||
postToIde("config/addModel", { model });
|
||||
dispatch(setDefaultModel(model.title));
|
||||
navigate("/");
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
{MODEL_INFO.map((pkg) => {
|
||||
if (typeof pkg === "string") {
|
||||
return (
|
||||
<div className="-my-8 grid grid-cols-[auto_1fr] w-full items-center">
|
||||
<h3 className="">{pkg}</h3>
|
||||
<hr
|
||||
className="ml-2"
|
||||
style={{
|
||||
height: "0px",
|
||||
width: "calc(100% - 16px)",
|
||||
color: lightGray,
|
||||
border: `1px solid ${lightGray}`,
|
||||
borderRadius: "2px",
|
||||
}}
|
||||
></hr>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<ModelCard
|
||||
title={pkg.title}
|
||||
description={pkg.description}
|
||||
tags={pkg.tags}
|
||||
icon={pkg.icon}
|
||||
dimensions={pkg.dimensions}
|
||||
providerOptions={pkg.providerOptions}
|
||||
onClick={(e, dimensionChoices, selectedProvider) => {
|
||||
const model = {
|
||||
...pkg.params,
|
||||
..._.merge(
|
||||
{},
|
||||
...(pkg.dimensions?.map((dimension, i) => {
|
||||
if (!dimensionChoices?.[i]) return {};
|
||||
return {
|
||||
...dimension.options[dimensionChoices[i]],
|
||||
};
|
||||
}) || []),
|
||||
),
|
||||
provider: PROVIDER_INFO[selectedProvider].provider,
|
||||
};
|
||||
postToIde("config/addModel", { model });
|
||||
dispatch(setDefaultModel(model.title));
|
||||
navigate("/");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</GridDiv>
|
||||
)}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
vscForeground,
|
||||
} from "../../components";
|
||||
|
||||
export const StyledButton = styled(Button)`
|
||||
export const StyledButton = styled(Button)<{ blurColor?: string }>`
|
||||
margin-left: auto;
|
||||
background-color: transparent;
|
||||
color: ${vscForeground};
|
||||
|
|
@ -15,7 +15,8 @@ export const StyledButton = styled(Button)`
|
|||
|
||||
&:hover {
|
||||
${(props) =>
|
||||
!props.disabled && `box-shadow: 0 0 4px 4px ${vscButtonBackground};`}
|
||||
!props.disabled &&
|
||||
`box-shadow: 0 0 4px 4px ${props.blurColor ?? vscButtonBackground};`}
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ function Onboarding() {
|
|||
<b>Embeddings:</b> Local sentence-transformers model
|
||||
<br />
|
||||
<br />
|
||||
<b>Autocomplete:</b> Starcoder2 3b (manual setup with Ollama, LM
|
||||
Studio, etc.)
|
||||
<b>Autocomplete:</b> Starcoder2 3b (set up with Ollama, LM Studio,
|
||||
etc.)
|
||||
<br />
|
||||
<br />
|
||||
<b>Chat:</b> Manual setup with Ollama, LM Studio, etc.
|
||||
<b>Chat:</b> Llama 3 with Ollama, LM Studio, etc.
|
||||
</p>
|
||||
)}
|
||||
<br></br>
|
||||
|
|
@ -106,19 +106,47 @@ function Onboarding() {
|
|||
This can always be done later.
|
||||
</p>
|
||||
</Div>
|
||||
{selected === 2 && (
|
||||
<p className="px-3">
|
||||
Use <code>config.json</code> to configure your own{" "}
|
||||
<a href="https://continue.dev/docs/model-setup/overview">models</a>,{" "}
|
||||
<a href="https://continue.dev/docs/customization/context-providers">
|
||||
context providers
|
||||
</a>
|
||||
,{" "}
|
||||
<a href="https://continue.dev/docs/customization/slash-commands">
|
||||
slash commands
|
||||
</a>
|
||||
, and <a href="https://continue.dev/docs/reference/config">more</a>.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<br />
|
||||
<div className="flex">
|
||||
<StyledButton
|
||||
blurColor={
|
||||
selected === 0
|
||||
? greenButtonColor
|
||||
: selected === 1
|
||||
? "#be841b"
|
||||
: "#1b84be"
|
||||
}
|
||||
disabled={selected < 0}
|
||||
onClick={() => {
|
||||
postToIde("showTutorial", undefined);
|
||||
postToIde("completeOnboarding", {
|
||||
mode: ["local", "optimized", "custom"][selected] as any,
|
||||
});
|
||||
setLocalStorage("onboardingComplete", true);
|
||||
postToIde("index/forceReIndex", undefined);
|
||||
navigate("/");
|
||||
|
||||
if (selected === 0) {
|
||||
navigate("/localOnboarding");
|
||||
} else {
|
||||
// Only needed when we switch from the default (local) embeddings provider
|
||||
postToIde("index/forceReIndex", undefined);
|
||||
// Don't show the tutorial above yet because there's another step to complete at /localOnboarding
|
||||
postToIde("showTutorial", undefined);
|
||||
navigate("/");
|
||||
}
|
||||
}}
|
||||
>
|
||||
Continue
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ const initialState: State = {
|
|||
contextProviders: [],
|
||||
models: [
|
||||
{
|
||||
title: "GPT-4 Vision (Free Trial)",
|
||||
title: "GPT-4 Turbo (Free Trial)",
|
||||
provider: "free-trial",
|
||||
model: "gpt-4-vision-preview",
|
||||
model: "gpt-4-turbo",
|
||||
},
|
||||
{
|
||||
title: "GPT-3.5-Turbo (Free Trial)",
|
||||
|
|
@ -164,7 +164,9 @@ export const stateSlice = createSlice({
|
|||
) => {
|
||||
const defaultModelTitle =
|
||||
config.models.find((model) => model.title === state.defaultModelTitle)
|
||||
?.title || config.models[0].title;
|
||||
?.title ||
|
||||
config.models[0]?.title ||
|
||||
"";
|
||||
state.config = config;
|
||||
state.defaultModelTitle = defaultModelTitle;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
type LocalStorageTypes = {
|
||||
onboardingComplete: boolean;
|
||||
mainTextEntryCounter: number;
|
||||
lastSessionId: string | undefined;
|
||||
};
|
||||
|
||||
export function getLocalStorage<T extends keyof LocalStorageTypes>(
|
||||
|
|
|
|||
|
|
@ -231,6 +231,32 @@ const mixtralTrial: ModelPackage = {
|
|||
providerOptions: ["freetrial", "groq"],
|
||||
};
|
||||
|
||||
const llama38bChat: ModelPackage = {
|
||||
title: "Llama3 8b",
|
||||
description: "The latest Llama model from Meta, fine-tuned for chat",
|
||||
refUrl: "",
|
||||
params: {
|
||||
title: "Llama3-8b",
|
||||
model: "llama3-8b",
|
||||
contextLength: 8192,
|
||||
},
|
||||
icon: "meta.png",
|
||||
providerOptions: ["groq"],
|
||||
};
|
||||
|
||||
const llama370bChat: ModelPackage = {
|
||||
title: "Llama3 70b Chat",
|
||||
description: "The latest Llama model from Meta, fine-tuned for chat",
|
||||
refUrl: "",
|
||||
params: {
|
||||
title: "Llama3-70b",
|
||||
model: "llama3-70b",
|
||||
contextLength: 8192,
|
||||
},
|
||||
icon: "meta.png",
|
||||
providerOptions: ["groq"],
|
||||
};
|
||||
|
||||
const llama270bChat: ModelPackage = {
|
||||
title: "Llama2 70b Chat",
|
||||
description: "The latest Llama model from Meta, fine-tuned for chat",
|
||||
|
|
@ -244,14 +270,14 @@ const llama270bChat: ModelPackage = {
|
|||
providerOptions: ["groq"],
|
||||
};
|
||||
|
||||
const llama2Chat: ModelPackage = {
|
||||
title: "Llama2 Chat",
|
||||
description: "The latest Llama model from Meta, fine-tuned for chat",
|
||||
const llama3Chat: ModelPackage = {
|
||||
title: "Llama3 Chat",
|
||||
description: "The latest model from Meta, fine-tuned for chat",
|
||||
refUrl: "",
|
||||
params: {
|
||||
title: "Llama2-7b",
|
||||
model: "llama2-7b",
|
||||
contextLength: 4096,
|
||||
title: "Llama3-8b",
|
||||
model: "llama3-8b",
|
||||
contextLength: 8192,
|
||||
},
|
||||
icon: "meta.png",
|
||||
dimensions: [
|
||||
|
|
@ -259,17 +285,13 @@ const llama2Chat: ModelPackage = {
|
|||
name: "Parameter Count",
|
||||
description: "The number of parameters in the model",
|
||||
options: {
|
||||
"7b": {
|
||||
model: "llama2-7b",
|
||||
title: "Llama2-7b",
|
||||
"8b": {
|
||||
model: "llama3-8b",
|
||||
title: "Llama3-8b",
|
||||
},
|
||||
"13b": {
|
||||
model: "llama2-13b",
|
||||
title: "Llama2-13b",
|
||||
},
|
||||
"34b": {
|
||||
model: "llama2-34b",
|
||||
title: "Llama2-34b",
|
||||
"70b": {
|
||||
model: "llama3-70b",
|
||||
title: "Llama3-70b",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -418,7 +440,19 @@ const geminiPro: ModelPackage = {
|
|||
apiKey: "<API_KEY>",
|
||||
},
|
||||
icon: "gemini.png",
|
||||
providerOptions: ["palm", "freetrial"],
|
||||
providerOptions: ["gemini"],
|
||||
};
|
||||
const gemini15Pro: ModelPackage = {
|
||||
title: "Gemini 1.5 Pro",
|
||||
description: "A newer Gemini model with 1M token context length",
|
||||
params: {
|
||||
title: "Gemini 1.5 Pro",
|
||||
model: "gemini-1.5-pro-latest",
|
||||
contextLength: 1_000_000,
|
||||
apiKey: "<API_KEY>",
|
||||
},
|
||||
icon: "gemini.png",
|
||||
providerOptions: ["gemini", "freetrial"],
|
||||
};
|
||||
|
||||
const zephyr: ModelPackage = {
|
||||
|
|
@ -490,30 +524,45 @@ const neuralChat: ModelPackage = {
|
|||
providerOptions: ["ollama", "lmstudio", "llamacpp", "replicate"],
|
||||
};
|
||||
|
||||
const commandR: ModelPackage = {
|
||||
title: "Command R",
|
||||
description:
|
||||
"Command R is a scalable generative model targeting RAG and Tool Use to enable production-scale AI for enterprise.",
|
||||
params: {
|
||||
model: "command-r",
|
||||
contextLength: 128_000,
|
||||
title: "Command R",
|
||||
apiKey: "",
|
||||
},
|
||||
providerOptions: ["cohere"],
|
||||
icon: "cohere.png",
|
||||
};
|
||||
|
||||
const commandRPlus: ModelPackage = {
|
||||
title: "Command R+",
|
||||
description:
|
||||
"Command R+ is a state-of-the-art RAG-optimized model designed to tackle enterprise-grade workloads",
|
||||
params: {
|
||||
model: "command-r-plus",
|
||||
contextLength: 128_000,
|
||||
title: "Command R+",
|
||||
apiKey: "",
|
||||
},
|
||||
providerOptions: ["cohere"],
|
||||
icon: "cohere.png",
|
||||
};
|
||||
|
||||
const osModels = [
|
||||
llama3Chat,
|
||||
deepseek,
|
||||
wizardCoder,
|
||||
codeLlamaInstruct,
|
||||
mistral,
|
||||
phindCodeLlama,
|
||||
llama2Chat,
|
||||
zephyr,
|
||||
neuralChat,
|
||||
];
|
||||
|
||||
const gpt4turbo: ModelPackage = {
|
||||
title: "GPT-4 Turbo",
|
||||
description:
|
||||
"A faster, cheaper version of GPT-4 with a longer context length",
|
||||
params: {
|
||||
model: "gpt-4-turbo-preview",
|
||||
contextLength: 128_000,
|
||||
title: "gpt-4-turbo-preview",
|
||||
},
|
||||
providerOptions: ["openai", "freetrial"],
|
||||
icon: "openai.png",
|
||||
};
|
||||
|
||||
const gpt4: ModelPackage = {
|
||||
title: "GPT-4",
|
||||
description: "The most powerful model from OpenAI",
|
||||
|
|
@ -526,14 +575,14 @@ const gpt4: ModelPackage = {
|
|||
icon: "openai.png",
|
||||
};
|
||||
|
||||
const gpt4vision: ModelPackage = {
|
||||
title: "GPT-4 Vision",
|
||||
const gpt4turbo: ModelPackage = {
|
||||
title: "GPT-4 Turbo",
|
||||
description:
|
||||
"A faster version of GPT-4 with longer context length and image support",
|
||||
"A faster and more capable version of GPT-4 with longer context length and image support",
|
||||
params: {
|
||||
model: "gpt-4-vision-preview",
|
||||
model: "gpt-4-turbo",
|
||||
contextLength: 128_000,
|
||||
title: "GPT-4 Vision",
|
||||
title: "GPT-4 Turbo",
|
||||
},
|
||||
providerOptions: ["openai", "freetrial"],
|
||||
icon: "openai.png",
|
||||
|
|
@ -607,20 +656,6 @@ const claude3Haiku: ModelPackage = {
|
|||
icon: "anthropic.png",
|
||||
};
|
||||
|
||||
const chatBison: ModelPackage = {
|
||||
title: "chat-bison-001",
|
||||
description:
|
||||
"Google PaLM's chat-bison-001 model, fine-tuned for chatting about code",
|
||||
params: {
|
||||
model: "chat-bison-001",
|
||||
contextLength: 8000,
|
||||
apiKey: "",
|
||||
title: "Chat Bison",
|
||||
},
|
||||
providerOptions: ["palm"],
|
||||
icon: "google-palm.png",
|
||||
};
|
||||
|
||||
const AUTODETECT: ModelPackage = {
|
||||
title: "Autodetect",
|
||||
description:
|
||||
|
|
@ -631,22 +666,30 @@ const AUTODETECT: ModelPackage = {
|
|||
providerOptions: [],
|
||||
};
|
||||
|
||||
export const MODEL_INFO: ModelPackage[] = [
|
||||
export const MODEL_INFO: (ModelPackage | string)[] = [
|
||||
"OpenAI",
|
||||
gpt4turbo,
|
||||
gpt4,
|
||||
gpt35turbo,
|
||||
geminiPro,
|
||||
"Anthropic",
|
||||
claude3Opus,
|
||||
claude3Sonnet,
|
||||
claude3Haiku,
|
||||
claude2,
|
||||
"Cohere",
|
||||
commandR,
|
||||
commandRPlus,
|
||||
"Gemini",
|
||||
gemini15Pro,
|
||||
geminiPro,
|
||||
"Open Source",
|
||||
llama3Chat,
|
||||
deepseek,
|
||||
mistral,
|
||||
codellama70bTrial,
|
||||
wizardCoder,
|
||||
codeLlamaInstruct,
|
||||
phindCodeLlama,
|
||||
llama2Chat,
|
||||
zephyr,
|
||||
];
|
||||
|
||||
|
|
@ -663,7 +706,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
gpt4,
|
||||
gpt35turbo,
|
||||
gpt4turbo,
|
||||
gpt4vision,
|
||||
gpt4turbo,
|
||||
{
|
||||
...AUTODETECT,
|
||||
params: {
|
||||
|
|
@ -709,6 +752,28 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
],
|
||||
packages: [claude3Opus, claude3Sonnet, claude3Haiku, claude2],
|
||||
},
|
||||
cohere: {
|
||||
title: "Cohere",
|
||||
provider: "cohere",
|
||||
refPage: "cohere",
|
||||
description:
|
||||
"Optimized for enterprise generative AI, search and discovery, and advanced retrieval.",
|
||||
icon: "cohere.png",
|
||||
tags: [ModelProviderTag["Requires API Key"]],
|
||||
longDescription:
|
||||
"To use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.",
|
||||
collectInputFor: [
|
||||
{
|
||||
inputType: CollectInputType.text,
|
||||
key: "apiKey",
|
||||
label: "API Key",
|
||||
placeholder: "Enter your Cohere API key",
|
||||
required: true,
|
||||
},
|
||||
...completionParamsInputs,
|
||||
],
|
||||
packages: [commandR, commandRPlus],
|
||||
},
|
||||
ollama: {
|
||||
title: "Ollama",
|
||||
provider: "ollama",
|
||||
|
|
@ -758,7 +823,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
},
|
||||
...completionParamsInputs,
|
||||
],
|
||||
packages: [llama2Chat, codeLlamaInstruct, mistral].map((p) => {
|
||||
packages: [llama3Chat, codeLlamaInstruct, mistral].map((p) => {
|
||||
p.params.contextLength = 4096;
|
||||
return p;
|
||||
}),
|
||||
|
|
@ -785,6 +850,8 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
},
|
||||
],
|
||||
packages: [
|
||||
llama370bChat,
|
||||
llama38bChat,
|
||||
{ ...mixtralTrial, title: "Mixtral" },
|
||||
llama270bChat,
|
||||
{
|
||||
|
|
@ -797,9 +864,9 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
,
|
||||
],
|
||||
},
|
||||
palm: {
|
||||
gemini: {
|
||||
title: "Google Gemini API",
|
||||
provider: "google-palm",
|
||||
provider: "gemini",
|
||||
refPage: "googlepalmapi",
|
||||
description:
|
||||
"Try out Google's state-of-the-art Gemini model from their API.",
|
||||
|
|
@ -815,7 +882,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
required: true,
|
||||
},
|
||||
],
|
||||
packages: [geminiPro],
|
||||
packages: [gemini15Pro, geminiPro],
|
||||
},
|
||||
mistral: {
|
||||
title: "Mistral API",
|
||||
|
|
@ -905,7 +972,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
|
|||
ModelProviderTag["Requires API Key"],
|
||||
ModelProviderTag["Open-Source"],
|
||||
],
|
||||
packages: [codeLlamaInstruct, llama2Chat, wizardCoder, mistral, zephyr],
|
||||
packages: [llama3Chat, codeLlamaInstruct, wizardCoder, mistral, zephyr],
|
||||
},
|
||||
llamacpp: {
|
||||
title: "llama.cpp",
|
||||
|
|
@ -989,8 +1056,8 @@ After it's up and running, you can start using Continue.`,
|
|||
{ ...claude3Opus, title: "Claude 3 Opus (trial)" },
|
||||
{ ...claude3Sonnet, title: "Claude 3 Sonnet (trial)" },
|
||||
{ ...claude3Haiku, title: "Claude 3 Haiku (trial)" },
|
||||
{ ...geminiPro, title: "Gemini Pro (trial)" },
|
||||
{ ...gpt4vision, title: "GPT-4 Vision (trial)" },
|
||||
{ ...gemini15Pro, title: "Gemini 1.5 Pro (trial)" },
|
||||
{ ...gpt4turbo, title: "GPT-4 Turbo (trial)" },
|
||||
{ ...gpt35turbo, title: "GPT-3.5-Turbo (trial)" },
|
||||
{
|
||||
...AUTODETECT,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
const colors = require("tailwindcss/colors");
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
|
|
@ -12,7 +11,6 @@ module.exports = {
|
|||
colors: {
|
||||
"vsc-background": "rgb(var(--vsc-background) / <alpha-value>)",
|
||||
"secondary-dark": "rgb(var(--secondary-dark) / <alpha-value>)",
|
||||
...colors,
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# This is used in a task in .vscode/tasks.json
|
||||
# Start developing with:
|
||||
# - Run Task -> Install Dependencies
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue