Dev (#1780)
* Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: Priyash <38959321+priyashpatil@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> Co-authored-by: YohannZe <99359799+YohannZe@users.noreply.github.com> Co-authored-by: Dan Dascalescu <ddascalescu+github@gmail.com> * temporary patch for type errs * Dev (#1689) * Fix an issue where CMD+K does not clear the terminal when the terminal has focus (#1671) On MacOS, ⌘+K is bound, by default, to Terminal:Clear. Without this change ⌘+K does not clear the terminal but instead iniates a chord sequence and waits for the next stroke of the chord. Co-authored-by: Rob Leidle <rleidle@tesla.com> * Change treeSitter to cache the Language objects it loads from wasm (#1672) Without this change, for a repository with 600 typescript files, the indexer would fail to finish correctly and there would be many of the following errors in the webview console log: 'Unable to load language for file ${path} RuntimeError: table index is out of bounds' The following bash will create a repo that reproduces the problem: current_path="." for ((i=1; i<=20; i++)); do new_folder="folder-$i" mkdir -p "$current_path/$new_folder" current_path="$current_path/$new_folder" for ((a=1; a<=30; a++)); do head -c 10000 /dev/urandom | base64 > "$current_path/file-$a.ts" done done Co-authored-by: Rob Leidle <rleidle@tesla.com> * acknowledge sourcemap flag in esbuild.js * don't run jetbrains-release.yaml on vscode releases * further testing for walkDir * chore: add telemetry to commands (#1673) * test: Add basic unit test to baseLLM (#1668) * update version * test: Add basic unit test to baseLLM --------- Co-authored-by: Nate Sesti <sestinj@gmail.com> Co-authored-by: inimaz <imaz@ai-verse.com> * feat: add Quick Actions CodeLens feature (#1674) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: add quick actions * Update index.d.ts * quick actions mvp * update docs * subscribe to vscode change settings * Update commands.ts * cleanup * Update quick-actions.md * Update VerticalPerLineCodeLensProvider.ts * resolve feedback --------- Co-authored-by: Nate Sesti <sestinj@gmail.com> Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> * chore: add `isCommandEvent` to command telemetry (#1675) * chore: add `isCommandEvent` to command telemetry * Update commands.ts * Nate/better retrieval (#1677) * deduplicatearray tests * break out separate retrieval pipelines * IConfigHandler * tests for codebase indexer * better .continueignore for continue * indexing fixes * ignore .gitignore and .continueignore when indexing * retrieval pipeline improvements * fix formatting err in out .continueignore * add necessary filter to lance_db_cache * update package.json version * skip unused tests * don't ignore .prompt files * update version * Update pull_request_template.md * don't use multi-media format when there are multiple text items * add free trial experience (#1685) * fix: add code range for quick actions/fixes (#1687) * fix: add code range for quick actions/fixes * Update test.js * add pathSep message type * docs improvements * jetbrains fix * update package.json version --------- Co-authored-by: Rob Leidle <rleidle@gmail.com> Co-authored-by: Rob Leidle <rleidle@tesla.com> Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: inimaz <49730431+inimaz@users.noreply.github.com> Co-authored-by: inimaz <imaz@ai-verse.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> Co-authored-by: Priyash <38959321+priyashpatil@users.noreply.github.com> * update package.json version * skip extension tests * update package.json version * handlebars import * don't push package.json version change from CI * fix: scroll issues w/ code blocks (#1688) * fix: scroll issues w/ code blocks * chore: name offset * chore: remove docs start * chore: update headings on troubleshooting.md (#1696) * ignore .svn folder for indexing (#1699) * chore: clearer naming for `useSuffix` (#1702) * chore: clearer naming for `useSuffix` * schema updates * fix: cmd+shft+l closes sidebar if focused (#1638) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: close panel if main input is focused * add skip param * Update TipTapEditor.tsx * merge dev * Update commands.ts --------- Co-authored-by: Nate Sesti <sestinj@gmail.com> Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> * bugfix: quick actions undefined array (#1704) * feat: add rich quick pick for quick edit (#1706) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * Create deepseek.md (#1708) * style: add max height to model selector (#1712) * update styling * remove testing code * remove comments * feat: add tutorial card (#1716) * feat: create tutorial card * Update TutorialCard.tsx * feat: add file search to quick edit (#1714) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * add file search * complete file search * remove unused import * add comments * Update utils.ts * update naming * chore: move quick pick instantiation (#1723) * Break out into NPM modules (#1726) * config.json types * export all schemas * break out request logic into packages * update openai adapters to export body types * update packaging of npm modules * update packages * continue proxy * mistral * Fix typo in documentation (#1722) In set-up-codestral.md "Trobleshooting" -> "Troubleshooting" * update package.json version * 🪄 model dropdown, control plane (#1692) * Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: Priyash <38959321+priyashpatil@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> Co-authored-by: YohannZe <99359799+YohannZe@users.noreply.github.com> Co-authored-by: Dan Dascalescu <ddascalescu+github@gmail.com> * temporary patch for type errs --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: Priyash <38959321+priyashpatil@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> Co-authored-by: YohannZe <99359799+YohannZe@users.noreply.github.com> Co-authored-by: Dan Dascalescu <ddascalescu+github@gmail.com> * skip extension tests * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * fix: wrap editor buttons when out of space (#1727) * Add .continuerc file to config directory on activation to prevent it's indexing. (#1733) * Updated the content links that were deprecated in the document (#1709) Co-authored-by: Ihe Fan <ih.fan.1027@gmail.com> * Nate/dev (#1739) * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * llm-info package * small profile switching improvements * instruct cmd+I not to leave placeholders * @ files in context-providers docs * onboarding fix * update jetbrains ci to build gui * feat: single default quick pick to edit (#1743) * feat: single default quick pick to edit * Update quick-actions.md * Update quick-actions.md * use defaultQuickAction * quick fixes * fix: handle line removal diff (#1744) * fix: handle line removal diff * remove comments * Configurable `maxChunkSize` for embedding providers (#1746) * Add `maxChunkSize` to `EmbeddingsProvider` * Add `maxChunkSize` to schema * add support for docs via config (#1594) * mistral mamba (#1748) * 🐍 mistral mamba * autoscale retrieval based on context length * autoscale retrieval based on context length * fix input box movement * update jetbrains build * test: add myers diff tests (#1754) * feat: enhance help center (#1755) * feat: enhance help center * Update help.tsx * feat: add azure provider config (#1764) * autocomplete reload fix * logout of control plane * Update QuickEditQuickPick.ts (#1772) * Update QuickEditQuickPick.ts * updates * Update QuickEditQuickPick.ts * pass refreshed access token to continue-proxy model * test: add dir read check for walkDir (#1773) * test: add dir read check for walkDir * Update ignore.ts * Update walkDir.test.ts * Update walkDir.test.ts * gpt-4o-mini * gpt-4o-mini * gpt4omini to ui selector * fix: layout alignment (#1779) * fix: delete old docs index on force re-index (#1778) * add "Codebase Force Re-Index" command (#1757) * Add `HuggingFaceTEIReranker` (#1711) * Add `HuggingFaceTEIReranker` * Add `huggingface-tei` to `config_schema.json` * update package.json version * update config schemas --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: Priyash <38959321+priyashpatil@users.noreply.github.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com> Co-authored-by: YohannZe <99359799+YohannZe@users.noreply.github.com> Co-authored-by: Dan Dascalescu <ddascalescu+github@gmail.com> Co-authored-by: Rob Leidle <rleidle@gmail.com> Co-authored-by: Rob Leidle <rleidle@tesla.com> Co-authored-by: inimaz <49730431+inimaz@users.noreply.github.com> Co-authored-by: inimaz <imaz@ai-verse.com> Co-authored-by: Anaël Bonnafous <71386173+AnaelBonnafous@users.noreply.github.com> Co-authored-by: Huy Tran <119860259+tranquochuy645@users.noreply.github.com> Co-authored-by: Gabriel Gordbegli <ggordbegli@gmail.com> Co-authored-by: Raven-1027 <83693755+Raven-1027@users.noreply.github.com> Co-authored-by: Ihe Fan <ih.fan.1027@gmail.com> Co-authored-by: Lukas Kreussel <65088241+LLukas22@users.noreply.github.com>
This commit is contained in:
parent
82ac619cf1
commit
62fa541a24
51 changed files with 736 additions and 356 deletions
|
|
@ -523,6 +523,7 @@ declare global {
|
|||
| "gpt-4-32k"
|
||||
| "gpt-4-turbo"
|
||||
| "gpt-4o"
|
||||
| "gpt-4o-mini"
|
||||
| "gpt-4-turbo-preview"
|
||||
| "gpt-4-vision-preview"
|
||||
// Mistral
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@ import { CohereReranker } from "./cohere.js";
|
|||
import { FreeTrialReranker } from "./freeTrial.js";
|
||||
import { LLMReranker } from "./llm.js";
|
||||
import { VoyageReranker } from "./voyage.js";
|
||||
import {HuggingFaceTEIReranker} from "./tei.js"
|
||||
|
||||
export const AllRerankers: { [key in RerankerName]: any } = {
|
||||
cohere: CohereReranker,
|
||||
llm: LLMReranker,
|
||||
voyage: VoyageReranker,
|
||||
"free-trial": FreeTrialReranker,
|
||||
"huggingface-tei": HuggingFaceTEIReranker
|
||||
};
|
||||
|
|
|
|||
49
core/context/rerankers/tei.ts
Normal file
49
core/context/rerankers/tei.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import fetch from "node-fetch";
|
||||
import { Chunk, Reranker } from "../../index.js";
|
||||
|
||||
export class HuggingFaceTEIReranker implements Reranker {
|
||||
name = "huggingface-tei";
|
||||
|
||||
static defaultOptions = {
|
||||
apiBase: "http://localhost:8080",
|
||||
truncate: true,
|
||||
truncation_direction: "Right"
|
||||
};
|
||||
|
||||
constructor(
|
||||
private readonly params: {
|
||||
apiBase?: string;
|
||||
truncate?: boolean;
|
||||
truncation_direction?: string;
|
||||
},
|
||||
) {}
|
||||
|
||||
async rerank(query: string, chunks: Chunk[]): Promise<number[]> {
|
||||
let apiBase = this.params.apiBase ?? HuggingFaceTEIReranker.defaultOptions.apiBase;
|
||||
if (!apiBase.endsWith("/")) {
|
||||
apiBase += "/";
|
||||
}
|
||||
|
||||
const resp = await fetch(new URL("rerank", apiBase), {
|
||||
method: "POST",
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
query: query,
|
||||
return_text: false,
|
||||
raw_scores: false,
|
||||
texts: chunks.map((chunk) => chunk.content),
|
||||
truncation_direction: this.params.truncation_direction ?? HuggingFaceTEIReranker.defaultOptions.truncation_direction,
|
||||
truncate: this.params.truncate ?? HuggingFaceTEIReranker.defaultOptions.truncate
|
||||
}),
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
throw new Error(await resp.text());
|
||||
}
|
||||
|
||||
const data = (await resp.json()) as any;
|
||||
// Resort into original order and extract scores
|
||||
const results = data.sort((a: any, b: any) => a.index - b.index);
|
||||
return results.map((result: any) => result.score);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import { DiffLine } from "../index.js";
|
||||
import { DiffLine, DiffLineType } from "../index.js";
|
||||
import { LineStream, matchLine } from "./util.js";
|
||||
|
||||
/**
|
||||
* https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/
|
||||
* Invariants:
|
||||
* - new + same = newLines.length
|
||||
* - old + same = oldLines.length
|
||||
* - old + same = oldLinesCopy.length
|
||||
* ^ (above two guarantee that all lines get represented)
|
||||
* - Lines are always output in order, at least among old and new separately
|
||||
*/
|
||||
|
|
@ -13,15 +13,17 @@ export async function* streamDiff(
|
|||
oldLines: string[],
|
||||
newLines: LineStream,
|
||||
): AsyncGenerator<DiffLine> {
|
||||
const oldLinesCopy = [...oldLines];
|
||||
|
||||
// If one indentation mistake is made, others are likely. So we are more permissive about matching
|
||||
let seenIndentationMistake = false;
|
||||
|
||||
let newLineResult = await newLines.next();
|
||||
|
||||
while (oldLines.length > 0 && !newLineResult.done) {
|
||||
while (oldLinesCopy.length > 0 && !newLineResult.done) {
|
||||
const { matchIndex, isPerfectMatch, newLine } = matchLine(
|
||||
newLineResult.value,
|
||||
oldLines,
|
||||
oldLinesCopy,
|
||||
seenIndentationMistake,
|
||||
);
|
||||
|
||||
|
|
@ -29,7 +31,7 @@ export async function* streamDiff(
|
|||
seenIndentationMistake = true;
|
||||
}
|
||||
|
||||
let type: DiffLine["type"];
|
||||
let type: DiffLineType;
|
||||
|
||||
let isLineRemoval = false;
|
||||
const isNewLine = matchIndex === -1;
|
||||
|
|
@ -39,7 +41,7 @@ export async function* streamDiff(
|
|||
} else {
|
||||
// Insert all deleted lines before match
|
||||
for (let i = 0; i < matchIndex; i++) {
|
||||
yield { type: "old", line: oldLines.shift()! };
|
||||
yield { type: "old", line: oldLinesCopy.shift()! };
|
||||
}
|
||||
|
||||
type = isPerfectMatch ? "same" : "old";
|
||||
|
|
@ -51,13 +53,13 @@ export async function* streamDiff(
|
|||
break;
|
||||
|
||||
case "same":
|
||||
yield { type, line: oldLines.shift()! };
|
||||
yield { type, line: oldLinesCopy.shift()! };
|
||||
break;
|
||||
|
||||
case "old":
|
||||
yield { type, line: oldLines.shift()! };
|
||||
yield { type, line: oldLinesCopy.shift()! };
|
||||
|
||||
if (oldLines[0] !== newLine) {
|
||||
if (oldLinesCopy[0] !== newLine) {
|
||||
yield { type: "new", line: newLine };
|
||||
} else {
|
||||
isLineRemoval = true;
|
||||
|
|
@ -75,13 +77,13 @@ export async function* streamDiff(
|
|||
}
|
||||
|
||||
// Once at the edge, only one choice
|
||||
if (newLineResult.done && oldLines.length > 0) {
|
||||
for (const oldLine of oldLines) {
|
||||
if (newLineResult.done && oldLinesCopy.length > 0) {
|
||||
for (const oldLine of oldLinesCopy) {
|
||||
yield { type: "old", line: oldLine };
|
||||
}
|
||||
}
|
||||
|
||||
if (!newLineResult.done && oldLines.length === 0) {
|
||||
if (!newLineResult.done && oldLinesCopy.length === 0) {
|
||||
yield { type: "new", line: newLineResult.value };
|
||||
for await (const newLine of newLines) {
|
||||
yield { type: "new", line: newLine };
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ function linesMatch(lineA: string, lineB: string, linesBetween = 0): boolean {
|
|||
}
|
||||
|
||||
/**
|
||||
* Used to find a match for a new line in an array of old lines.
|
||||
*
|
||||
* Return the index of the first match and whether it is a perfect match
|
||||
* Also return a version of the line with correct indentation if needs fixing
|
||||
*/
|
||||
|
|
|
|||
7
core/index.d.ts
vendored
7
core/index.d.ts
vendored
|
|
@ -374,8 +374,10 @@ export type CustomLLM = RequireAtLeastOne<
|
|||
|
||||
// IDE
|
||||
|
||||
export type DiffLineType = "new" | "old" | "same";
|
||||
|
||||
export interface DiffLine {
|
||||
type: "new" | "old" | "same";
|
||||
type: DiffLineType;
|
||||
line: string;
|
||||
}
|
||||
|
||||
|
|
@ -596,6 +598,7 @@ export type ModelName =
|
|||
| "gpt-3.5-turbo-0613"
|
||||
| "gpt-4-32k"
|
||||
| "gpt-4o"
|
||||
| "gpt-4o-mini"
|
||||
| "gpt-4-turbo"
|
||||
| "gpt-4-turbo-preview"
|
||||
| "gpt-4-vision-preview"
|
||||
|
|
@ -756,7 +759,7 @@ export interface EmbeddingsProvider {
|
|||
embed(chunks: string[]): Promise<number[][]>;
|
||||
}
|
||||
|
||||
export type RerankerName = "cohere" | "voyage" | "llm" | "free-trial";
|
||||
export type RerankerName = "cohere" | "voyage" | "llm" | "free-trial" | "huggingface-tei";
|
||||
|
||||
export interface RerankerDescription {
|
||||
name: RerankerName;
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ export class DocsService {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!reIndex && await this.has(startUrl.toString())) {
|
||||
if (!reIndex && (await this.has(startUrl.toString()))) {
|
||||
yield {
|
||||
progress: 1,
|
||||
desc: "Already indexed",
|
||||
|
|
@ -275,11 +275,13 @@ export class DocsService {
|
|||
|
||||
try {
|
||||
const subpathEmbeddings = await embeddingsProvider.embed(
|
||||
chunkArticle(article, embeddingsProvider.maxChunkSize).map((chunk) => {
|
||||
chunks.push(chunk);
|
||||
chunkArticle(article, embeddingsProvider.maxChunkSize).map(
|
||||
(chunk) => {
|
||||
chunks.push(chunk);
|
||||
|
||||
return chunk.content;
|
||||
}),
|
||||
return chunk.content;
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
embeddings.push(...subpathEmbeddings);
|
||||
|
|
@ -296,6 +298,12 @@ export class DocsService {
|
|||
status: "indexing",
|
||||
};
|
||||
|
||||
// Clear old index if re-indexing.
|
||||
if (reIndex) {
|
||||
console.log("Deleting old embeddings");
|
||||
await this.delete(startUrl.toString());
|
||||
}
|
||||
|
||||
await this.add(siteIndexingConfig.title, startUrl, chunks, embeddings);
|
||||
this.docsIndexingQueue.delete(startUrl.toString());
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ export const DEFAULT_IGNORE_FILETYPES = [
|
|||
".gitkeep",
|
||||
".continueignore",
|
||||
"config.json",
|
||||
".csv",
|
||||
// "*.prompt", // can be incredibly confusing for the LLM to have another set of instructions injected into the prompt
|
||||
];
|
||||
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { EventEmitter } from "events";
|
||||
import { Minimatch } from "minimatch";
|
||||
import path from "node:path";
|
||||
import { FileType, IDE } from "..";
|
||||
import { DEFAULT_IGNORE_DIRS, DEFAULT_IGNORE_FILETYPES } from "./ignore";
|
||||
import { FileType, IDE } from "../index.js";
|
||||
import { DEFAULT_IGNORE_DIRS, DEFAULT_IGNORE_FILETYPES } from "./ignore.js";
|
||||
|
||||
export interface WalkerOptions {
|
||||
isSymbolicLink?: boolean;
|
||||
|
|
@ -34,10 +34,7 @@ class Walker extends EventEmitter {
|
|||
sawError: boolean;
|
||||
exact: boolean | undefined;
|
||||
onlyDirs: boolean | undefined;
|
||||
constructor(
|
||||
opts: WalkerOptions = {},
|
||||
protected readonly ide: IDE,
|
||||
) {
|
||||
constructor(opts: WalkerOptions = {}, protected readonly ide: IDE) {
|
||||
super(opts as any);
|
||||
this.isSymbolicLink = opts.isSymbolicLink || false;
|
||||
this.path = opts.path || process.cwd();
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
|
|||
"llava",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4-vision",
|
||||
"claude-3",
|
||||
"gemini-ultra",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = {
|
|||
"gpt-4-32k": GPT_4_CTX_LEN,
|
||||
"gpt-4-turbo-preview": GPT_4_CTX_LEN,
|
||||
"gpt-4o": GPT_4_CTX_LEN,
|
||||
"gpt-4o-mini": GPT_4_CTX_LEN,
|
||||
"gpt-4-vision": GPT_4_CTX_LEN,
|
||||
"gpt-4-0125-preview": GPT_4_CTX_LEN,
|
||||
"gpt-4-1106-preview": GPT_4_CTX_LEN,
|
||||
|
|
|
|||
8
core/llm/llms/Azure.ts
Normal file
8
core/llm/llms/Azure.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { ModelProvider } from "../../index.js";
|
||||
import OpenAI from "./OpenAI.js";
|
||||
|
||||
class Azure extends OpenAI {
|
||||
static providerName: ModelProvider = "azure";
|
||||
}
|
||||
|
||||
export default Azure;
|
||||
|
|
@ -36,6 +36,7 @@ const CHAT_ONLY_MODELS = [
|
|||
"gpt-4-vision",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4o-mini",
|
||||
];
|
||||
|
||||
class OpenAI extends BaseLLM {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import LlamaCpp from "./LlamaCpp.js";
|
|||
import Llamafile from "./Llamafile.js";
|
||||
import Mistral from "./Mistral.js";
|
||||
import Msty from "./Msty.js";
|
||||
import Azure from "./Azure.js";
|
||||
import Ollama from "./Ollama.js";
|
||||
import OpenAI from "./OpenAI.js";
|
||||
import Replicate from "./Replicate.js";
|
||||
|
|
@ -124,6 +125,7 @@ const LLMs = [
|
|||
Cloudflare,
|
||||
Deepseek,
|
||||
Msty,
|
||||
Azure,
|
||||
];
|
||||
|
||||
export async function llmFromDescription(
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class ContinueProxy extends OpenAI {
|
|||
static defaultOptions: Partial<LLMOptions> = {
|
||||
apiBase:
|
||||
"https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/model-proxy/v1",
|
||||
useLegacyCompletionsEndpoint: false,
|
||||
};
|
||||
|
||||
supportsFim(): boolean {
|
||||
|
|
|
|||
10
core/package-lock.json
generated
10
core/package-lock.json
generated
|
|
@ -74,6 +74,7 @@
|
|||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
"onnxruntime-common": "1.14.0",
|
||||
"onnxruntime-web": "1.14.0",
|
||||
"ts-jest": "^29.1.1"
|
||||
|
|
@ -11218,6 +11219,15 @@
|
|||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"node_modules/myers-diff": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/myers-diff/-/myers-diff-2.1.0.tgz",
|
||||
"integrity": "sha512-6s/caiGUb5vNH9kq5HPw9t9OzAq6hTJ5V5N5Damd/npcp+stLg2LxQIcgJa9o51qbfTVgfth6/yVCoJvZY85BQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mysql2": {
|
||||
"version": "3.9.7",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.9.7.tgz",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
"onnxruntime-common": "1.14.0",
|
||||
"onnxruntime-web": "1.14.0",
|
||||
"ts-jest": "^29.1.1"
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ export type ToIdeFromWebviewOrCoreProtocol = {
|
|||
{ silent: boolean },
|
||||
ControlPlaneSessionInfo | undefined,
|
||||
];
|
||||
logoutOfControlPlane: [undefined, void];
|
||||
pathSep: [undefined, string];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
import { streamDiff } from "../diff/streamDiff.js";
|
||||
import { DiffLine } from "../index.js";
|
||||
import { DiffLine, DiffLineType } from "../index.js";
|
||||
// @ts-ignore no typings available
|
||||
import { changed, diff as myersDiff } from "myers-diff";
|
||||
|
||||
// "modification" is an extra type used to represent an "old" + "new" diff line
|
||||
type MyersDiffTypes = Extract<DiffLineType, "new" | "old"> | "modification";
|
||||
|
||||
async function* generateLines(lines: string[]): AsyncGenerator<string> {
|
||||
for (const line of lines) {
|
||||
|
|
@ -7,158 +12,169 @@ async function* generateLines(lines: string[]): AsyncGenerator<string> {
|
|||
}
|
||||
}
|
||||
|
||||
const collectDiff = async (
|
||||
async function collectDiffs(
|
||||
oldLines: string[],
|
||||
newLines: string[],
|
||||
): Promise<DiffLine[]> => {
|
||||
const result: DiffLine[] = [];
|
||||
): Promise<{ streamDiffs: DiffLine[]; myersDiffs: any }> {
|
||||
const streamDiffs: DiffLine[] = [];
|
||||
|
||||
for await (const diffLine of streamDiff(oldLines, generateLines(newLines))) {
|
||||
result.push(diffLine);
|
||||
streamDiffs.push(diffLine);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
const myersDiffs = myersDiff(oldLines.join("\n"), newLines.join("\n"));
|
||||
|
||||
// We use a longer `console.log()` string here to not get
|
||||
return { streamDiffs, myersDiffs };
|
||||
}
|
||||
|
||||
function getMyersDiffType(diff: any): MyersDiffTypes | undefined {
|
||||
if (changed(diff.rhs) && !changed(diff.lhs)) {
|
||||
return "new";
|
||||
}
|
||||
|
||||
if (!changed(diff.rhs) && changed(diff.lhs)) {
|
||||
return "old";
|
||||
}
|
||||
|
||||
if (changed(diff.rhs) && changed(diff.lhs)) {
|
||||
return "modification";
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// We use a longer `)` string here to not get
|
||||
// caught by the fuzzy matcher
|
||||
describe("streamDiff()", () => {
|
||||
describe("streamDiff(", () => {
|
||||
test("no changes", async () => {
|
||||
const oldLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const newLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const oldLines = ["first item", "second arg", "third param"];
|
||||
const newLines = ["first item", "second arg", "third param"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "same", line: "console.log(second)" },
|
||||
{ type: "same", line: "console.log(third)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "same", line: "second arg" },
|
||||
{ type: "same", line: "third param" },
|
||||
]);
|
||||
|
||||
expect(myersDiffs).toEqual([]);
|
||||
});
|
||||
|
||||
test("add new line", async () => {
|
||||
const oldLines = ["console.log(first)", "console.log(second)"];
|
||||
const newLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const oldLines = ["first item", "second arg"];
|
||||
const newLines = ["first item", "second arg", "third param"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "same", line: "console.log(second)" },
|
||||
{ type: "new", line: "console.log(third)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "same", line: "second arg" },
|
||||
{ type: "new", line: "third param" },
|
||||
]);
|
||||
|
||||
expect(myersDiffs.length).toEqual(1);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("new");
|
||||
});
|
||||
|
||||
test("remove line", async () => {
|
||||
const oldLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const newLines = ["console.log(first)", "console.log(third)"];
|
||||
const oldLines = ["first item", "second arg", "third param"];
|
||||
const newLines = ["first item", "third param"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "old", line: "console.log(second)" },
|
||||
{ type: "same", line: "console.log(third)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "old", line: "second arg" },
|
||||
{ type: "same", line: "third param" },
|
||||
]);
|
||||
|
||||
expect(myersDiffs.length).toEqual(1);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("old");
|
||||
});
|
||||
|
||||
test("modify line", async () => {
|
||||
const oldLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const newLines = [
|
||||
"console.log(first)",
|
||||
"console.log(modified second)",
|
||||
"console.log(third)",
|
||||
];
|
||||
const oldLines = ["first item", "second arg", "third param"];
|
||||
const newLines = ["first item", "modified second arg", "third param"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "old", line: "console.log(second)" },
|
||||
{ type: "new", line: "console.log(modified second)" },
|
||||
{ type: "same", line: "console.log(third)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "old", line: "second arg" },
|
||||
{ type: "new", line: "modified second arg" },
|
||||
{ type: "same", line: "third param" },
|
||||
]);
|
||||
|
||||
expect(myersDiffs.length).toEqual(1);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("modification");
|
||||
});
|
||||
|
||||
test("add multiple lines", async () => {
|
||||
const oldLines = ["console.log(first)", "fourth"];
|
||||
const newLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
"fourth",
|
||||
];
|
||||
const oldLines = ["first item", "fourth val"];
|
||||
const newLines = ["first item", "second arg", "third param", "fourth val"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "new", line: "console.log(second)" },
|
||||
{ type: "new", line: "console.log(third)" },
|
||||
{ type: "same", line: "fourth" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "new", line: "second arg" },
|
||||
{ type: "new", line: "third param" },
|
||||
{ type: "same", line: "fourth val" },
|
||||
]);
|
||||
|
||||
// Multi-line addition
|
||||
expect(myersDiffs[0].rhs.add).toEqual(2);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("new");
|
||||
});
|
||||
|
||||
test("remove multiple lines", async () => {
|
||||
const oldLines = [
|
||||
"console.log(first)",
|
||||
"console.log(second)",
|
||||
"console.log(third)",
|
||||
"fourth",
|
||||
];
|
||||
const newLines = ["console.log(first)", "fourth"];
|
||||
const oldLines = ["first item", "second arg", "third param", "fourth val"];
|
||||
const newLines = ["first item", "fourth val"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "same", line: "console.log(first)" },
|
||||
{ type: "old", line: "console.log(second)" },
|
||||
{ type: "old", line: "console.log(third)" },
|
||||
{ type: "same", line: "fourth" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "same", line: "first item" },
|
||||
{ type: "old", line: "second arg" },
|
||||
{ type: "old", line: "third param" },
|
||||
{ type: "same", line: "fourth val" },
|
||||
]);
|
||||
|
||||
// Multi-line deletion
|
||||
expect(myersDiffs[0].lhs.del).toEqual(2);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("old");
|
||||
});
|
||||
|
||||
test("empty old lines", async () => {
|
||||
const oldLines: string[] = [];
|
||||
const newLines = ["console.log(first)", "console.log(second)"];
|
||||
const newLines = ["first item", "second arg"];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "new", line: "console.log(first)" },
|
||||
{ type: "new", line: "console.log(second)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "new", line: "first item" },
|
||||
{ type: "new", line: "second arg" },
|
||||
]);
|
||||
|
||||
// Multi-line addition
|
||||
expect(myersDiffs[0].rhs.add).toEqual(2);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("new");
|
||||
});
|
||||
|
||||
test("empty new lines", async () => {
|
||||
const oldLines = ["console.log(first)", "console.log(second)"];
|
||||
const oldLines = ["first item", "second arg"];
|
||||
const newLines: string[] = [];
|
||||
|
||||
const diff = await collectDiff(oldLines, newLines);
|
||||
const { streamDiffs, myersDiffs } = await collectDiffs(oldLines, newLines);
|
||||
|
||||
expect(diff).toEqual([
|
||||
{ type: "old", line: "console.log(first)" },
|
||||
{ type: "old", line: "console.log(second)" },
|
||||
expect(streamDiffs).toEqual([
|
||||
{ type: "old", line: "first item" },
|
||||
{ type: "old", line: "second arg" },
|
||||
]);
|
||||
|
||||
// Multi-line deletion
|
||||
expect(myersDiffs[0].lhs.del).toEqual(2);
|
||||
expect(getMyersDiffType(myersDiffs[0])).toBe("old");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import path from "path";
|
||||
import { walkDir, WalkerOptions } from "../indexing/walkDir";
|
||||
import FileSystemIde from "../util/filesystem";
|
||||
import { walkDir, WalkerOptions } from "../indexing/walkDir.js";
|
||||
import FileSystemIde from "../util/filesystem.js";
|
||||
import {
|
||||
addToTestDir,
|
||||
setUpTestDir,
|
||||
tearDownTestDir,
|
||||
TEST_DIR,
|
||||
} from "./testUtils/testDir";
|
||||
} from "./testUtils/testDir.js";
|
||||
|
||||
const ide = new FileSystemIde(TEST_DIR);
|
||||
|
||||
async function walkTestDir(
|
||||
|
|
@ -273,4 +274,30 @@ describe("walkDir", () => {
|
|||
);
|
||||
expect(results.some((file) => file.includes(".tmLanguage"))).toBe(false);
|
||||
});
|
||||
|
||||
test("should perform the same number of dir reads as 1 + the number of dirs that contain files", async () => {
|
||||
const files = [
|
||||
"a.txt",
|
||||
"b.py",
|
||||
"c.ts",
|
||||
"d/",
|
||||
"d/e.txt",
|
||||
"d/f.py",
|
||||
"d/g/",
|
||||
"d/g/h.ts",
|
||||
"d/g/i/",
|
||||
"d/g/i/j.ts",
|
||||
];
|
||||
|
||||
const numDirs = files.filter((file) => !file.includes(".")).length;
|
||||
const numDirsPlusTopLevelRead = numDirs + 1;
|
||||
|
||||
addToTestDir(files);
|
||||
|
||||
const mockListDir = jest.spyOn(ide, "listDir");
|
||||
|
||||
await walkTestDir();
|
||||
|
||||
expect(mockListDir).toHaveBeenCalledTimes(numDirsPlusTopLevelRead);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ class FileSystemIde implements IDE {
|
|||
dirent.isDirectory()
|
||||
? (2 as FileType.Directory)
|
||||
: dirent.isSymbolicLink()
|
||||
? (64 as FileType.SymbolicLink)
|
||||
: (1 as FileType.File),
|
||||
? (64 as FileType.SymbolicLink)
|
||||
: (1 as FileType.File),
|
||||
]);
|
||||
return Promise.resolve(all);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ export function modifyConfig(config: Config): Config {
|
|||
|
||||
The reranker plays a crucial role in refining the results retrieved from your codebase. It processes the initial set of results obtained through embeddings-based retrieval, improving their relevance and accuracy for your queries.
|
||||
|
||||
Continue offers several reranking options: `cohere`, `voyage`, `llm`, and `free-trial`, which can be configured in `config.json`.
|
||||
Continue offers several reranking options: `cohere`, `voyage`, `llm`, `hugginface-tei`, and `free-trial`, which can be configured in `config.json`.
|
||||
|
||||
### Voyage AI
|
||||
|
||||
|
|
@ -282,6 +282,23 @@ If you only have access to a single LLM, then you can use it as a reranker. This
|
|||
|
||||
The `"modelTitle"` field must match one of the models in your "models" array in config.json.
|
||||
|
||||
### Text Embeddings Inference
|
||||
|
||||
[Hugging Face Text Embeddings Inference](https://huggingface.co/docs/text-embeddings-inference/en/index) enables you to host your own [reranker endpoint](https://huggingface.github.io/text-embeddings-inference/#/Text%20Embeddings%20Inference/rerank). You can configure your reranker as follows:
|
||||
|
||||
```json title="~/.continue/config.json"
|
||||
{
|
||||
"reranker": {
|
||||
"name": "huggingface-tei",
|
||||
"params": {
|
||||
"apiBase": "http://localhost:8080",
|
||||
"truncate": true,
|
||||
"truncation_direction": "Right"
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
### Free Trial (Voyage AI)
|
||||
|
||||
Continue offers a free trial of Voyage AI's reranking model.
|
||||
|
|
|
|||
49
docs/static/schemas/config.json
vendored
49
docs/static/schemas/config.json
vendored
|
|
@ -481,6 +481,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -581,6 +582,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1095,6 +1097,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1952,7 +1955,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial"]
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial", "huggingface-tei"]
|
||||
},
|
||||
"params": {
|
||||
"type": "object"
|
||||
|
|
@ -2042,6 +2045,50 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["huggingface-tei"]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiBase": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:8080"
|
||||
},
|
||||
"truncate": {
|
||||
"type": "boolean",
|
||||
"description": "Wether to truncate long sequences to the maximum allowed context length.",
|
||||
"default": false
|
||||
},
|
||||
"truncation_direction": {
|
||||
"enum": ["Right","Left"],
|
||||
"markdownDescription": "Wether to truncate sequences from the `left` or `right`.",
|
||||
"default": "Right"
|
||||
}
|
||||
},
|
||||
"required": ["apiBase"]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"truncate": {
|
||||
"const": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": ["truncation_direction"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
1
eval/repos/amplified-dev
Submodule
1
eval/repos/amplified-dev
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 4cf94d7023f5063f912d376027194fbd67670ba5
|
||||
1
eval/repos/continue
Submodule
1
eval/repos/continue
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2eafdff54b1a77c6d403fa26a64c6793d7a4dfb9
|
||||
1
eval/repos/the-x
Submodule
1
eval/repos/the-x
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 9218fea4483ffcbbdf1471c83f65c01f3c25f554
|
||||
1
eval/repos/trayracer
Submodule
1
eval/repos/trayracer
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2f0e7fbe962312a1b8bef8a29ed1ac4111ab11c4
|
||||
|
|
@ -481,6 +481,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -581,6 +582,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1095,6 +1097,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1952,7 +1955,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial"]
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial", "huggingface-tei"]
|
||||
},
|
||||
"params": {
|
||||
"type": "object"
|
||||
|
|
@ -2042,6 +2045,50 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["huggingface-tei"]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiBase": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:8080"
|
||||
},
|
||||
"truncate": {
|
||||
"type": "boolean",
|
||||
"description": "Wether to truncate long sequences to the maximum allowed context length.",
|
||||
"default": false
|
||||
},
|
||||
"truncation_direction": {
|
||||
"enum": ["Right","Left"],
|
||||
"markdownDescription": "Wether to truncate sequences from the `left` or `right`.",
|
||||
"default": "Right"
|
||||
}
|
||||
},
|
||||
"required": ["apiBase"]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"truncate": {
|
||||
"const": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": ["truncation_direction"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -481,6 +481,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -581,6 +582,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1095,6 +1097,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1952,7 +1955,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial"]
|
||||
"enum": ["cohere", "voyage", "llm", "free-trial", "huggingface-tei"]
|
||||
},
|
||||
"params": {
|
||||
"type": "object"
|
||||
|
|
@ -2042,6 +2045,50 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["huggingface-tei"]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiBase": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:8080"
|
||||
},
|
||||
"truncate": {
|
||||
"type": "boolean",
|
||||
"description": "Wether to truncate long sequences to the maximum allowed context length.",
|
||||
"default": false
|
||||
},
|
||||
"truncation_direction": {
|
||||
"enum": ["Right","Left"],
|
||||
"markdownDescription": "Wether to truncate sequences from the `left` or `right`.",
|
||||
"default": "Right"
|
||||
}
|
||||
},
|
||||
"required": ["apiBase"]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"truncate": {
|
||||
"const": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": ["truncation_direction"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -516,6 +516,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -628,6 +629,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -1222,6 +1224,7 @@
|
|||
"gpt-3.5-turbo",
|
||||
"gpt-3.5-turbo-16k",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo-0613",
|
||||
"gpt-4-32k",
|
||||
|
|
@ -2183,7 +2186,8 @@
|
|||
"cohere",
|
||||
"voyage",
|
||||
"llm",
|
||||
"free-trial"
|
||||
"free-trial",
|
||||
"huggingface-tei"
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
|
|
@ -2297,6 +2301,61 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": [
|
||||
"huggingface-tei"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"params": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiBase": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:8080"
|
||||
},
|
||||
"truncate": {
|
||||
"type": "boolean",
|
||||
"description": "Wether to truncate long sequences to the maximum allowed context length.",
|
||||
"default": false
|
||||
},
|
||||
"truncation_direction": {
|
||||
"enum": [
|
||||
"Right",
|
||||
"Left"
|
||||
],
|
||||
"markdownDescription": "Wether to truncate sequences from the `left` or `right`.",
|
||||
"default": "Right"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"apiBase"
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"truncate": {
|
||||
"const": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"truncation_direction"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
5
extensions/vscode/package-lock.json
generated
5
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.184",
|
||||
"version": "0.9.185",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.184",
|
||||
"version": "0.9.185",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
@ -160,6 +160,7 @@
|
|||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
"onnxruntime-common": "1.14.0",
|
||||
"onnxruntime-web": "1.14.0",
|
||||
"ts-jest": "^29.1.1"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"version": "0.9.184",
|
||||
"version": "0.9.185",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -230,6 +230,12 @@
|
|||
"title": "Fix Grammar / Spelling",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.codebaseForceReIndex",
|
||||
"category": "Continue",
|
||||
"title": "Codebase Force Re-Index",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.docsIndex",
|
||||
"category": "Continue",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { getTsConfigPath, getContinueRcPath, migrate } from "core/util/paths";
|
||||
import { getContinueRcPath, getTsConfigPath, migrate } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import path from "node:path";
|
||||
import * as vscode from "vscode";
|
||||
import { VsCodeExtension } from "../extension/VsCodeExtension";
|
||||
import registerQuickFixProvider from "../lang-server/codeActions";
|
||||
import { WorkOsAuthProvider } from "../stubs/WorkOsAuthProvider";
|
||||
import { getExtensionVersion } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { VsCodeContinueApi } from "./api";
|
||||
|
|
@ -19,11 +18,6 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
registerQuickFixProvider();
|
||||
setupInlineTips(context);
|
||||
|
||||
// Register auth provider
|
||||
const workOsAuthProvider = new WorkOsAuthProvider(context);
|
||||
await workOsAuthProvider.initialize();
|
||||
context.subscriptions.push(workOsAuthProvider);
|
||||
|
||||
const vscodeExtension = new VsCodeExtension(context);
|
||||
|
||||
migrate("showWelcome_1", () => {
|
||||
|
|
@ -62,4 +56,4 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
extension: vscodeExtension,
|
||||
}
|
||||
: continuePublicApi;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { ContextMenuConfig, IDE } from "core";
|
|||
import { CompletionProvider } from "core/autocomplete/completionProvider";
|
||||
import { ConfigHandler } from "core/config/ConfigHandler";
|
||||
import { ContinueServerClient } from "core/continueServer/stubs/client";
|
||||
import { Core } from "core/core";
|
||||
import { GlobalContext } from "core/util/GlobalContext";
|
||||
import { getConfigJsonPath, getDevDataFilePath } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
|
|
@ -25,7 +26,6 @@ import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
|||
import { QuickEdit, QuickEditShowParams } from "./quickEdit/QuickEditQuickPick";
|
||||
import { Battery } from "./util/battery";
|
||||
import type { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
import { Core } from "core/core";
|
||||
|
||||
let fullScreenPanel: vscode.WebviewPanel | undefined;
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ const commandsMap: (
|
|||
continueServerClientPromise,
|
||||
battery,
|
||||
quickEdit,
|
||||
core
|
||||
core,
|
||||
) => {
|
||||
/**
|
||||
* Streams an inline edit to the vertical diff manager.
|
||||
|
|
@ -288,11 +288,14 @@ const commandsMap: (
|
|||
"continue.toggleAuxiliaryBar": () => {
|
||||
vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
|
||||
},
|
||||
"continue.codebaseForceReIndex": async () => {
|
||||
core.invoke("index/forceReIndex", undefined);
|
||||
},
|
||||
"continue.docsIndex": async () => {
|
||||
core.invoke("context/indexDocs", {reIndex: false});
|
||||
core.invoke("context/indexDocs", { reIndex: false });
|
||||
},
|
||||
"continue.docsReIndex": async () => {
|
||||
core.invoke("context/indexDocs", {reIndex: true});
|
||||
core.invoke("context/indexDocs", { reIndex: true });
|
||||
},
|
||||
"continue.focusContinueInput": async () => {
|
||||
const fullScreenTab = getFullScreenTab();
|
||||
|
|
@ -573,12 +576,18 @@ const commandsMap: (
|
|||
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const quickPick = vscode.window.createQuickPick();
|
||||
const selected = new GlobalContext().get("selectedTabAutocompleteModel");
|
||||
const autocompleteModelTitles = ((
|
||||
await configHandler.loadConfig()
|
||||
).tabAutocompleteModels
|
||||
?.map((model) => model.title)
|
||||
.filter((t) => t !== undefined) || []) as string[];
|
||||
const autocompleteModels =
|
||||
(await configHandler.loadConfig())?.tabAutocompleteModels ?? [];
|
||||
const autocompleteModelTitles = autocompleteModels
|
||||
.map((model) => model.title)
|
||||
.filter((t) => t !== undefined) as string[];
|
||||
let selected = new GlobalContext().get("selectedTabAutocompleteModel");
|
||||
if (
|
||||
!selected ||
|
||||
!autocompleteModelTitles.some((title) => title === selected)
|
||||
) {
|
||||
selected = autocompleteModelTitles[0];
|
||||
}
|
||||
|
||||
// Toggle between Disabled, Paused, and Enabled
|
||||
const pauseOnBattery =
|
||||
|
|
@ -593,8 +602,8 @@ const commandsMap: (
|
|||
currentStatus === StatusBarStatus.Paused
|
||||
? StatusBarStatus.Enabled
|
||||
: currentStatus === StatusBarStatus.Disabled
|
||||
? StatusBarStatus.Paused
|
||||
: StatusBarStatus.Disabled;
|
||||
? StatusBarStatus.Paused
|
||||
: StatusBarStatus.Disabled;
|
||||
} else {
|
||||
// Toggle between Disabled and Enabled
|
||||
targetStatus =
|
||||
|
|
@ -691,7 +700,7 @@ export function registerAllCommands(
|
|||
continueServerClientPromise,
|
||||
battery,
|
||||
quickEdit,
|
||||
core
|
||||
core,
|
||||
),
|
||||
)) {
|
||||
context.subscriptions.push(
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import { v4 as uuidv4 } from "uuid";
|
|||
import * as vscode from "vscode";
|
||||
import { ContinueCompletionProvider } from "../autocomplete/completionProvider";
|
||||
import {
|
||||
StatusBarStatus,
|
||||
monitorBatteryChanges,
|
||||
setupStatusBar,
|
||||
StatusBarStatus,
|
||||
} from "../autocomplete/statusBar";
|
||||
import { registerAllCommands } from "../commands";
|
||||
import { ContinueGUIWebviewViewProvider } from "../ContinueGUIWebviewViewProvider";
|
||||
|
|
@ -22,7 +22,10 @@ import { VsCodeIde } from "../ideProtocol";
|
|||
import { registerAllCodeLensProviders } from "../lang-server/codeLens";
|
||||
import { QuickEdit } from "../quickEdit/QuickEditQuickPick";
|
||||
import { setupRemoteConfigSync } from "../stubs/activation";
|
||||
import { getControlPlaneSessionInfo } from "../stubs/WorkOsAuthProvider";
|
||||
import {
|
||||
getControlPlaneSessionInfo,
|
||||
WorkOsAuthProvider,
|
||||
} from "../stubs/WorkOsAuthProvider";
|
||||
import { Battery } from "../util/battery";
|
||||
import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import type { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
|
@ -42,8 +45,14 @@ export class VsCodeExtension {
|
|||
webviewProtocolPromise: Promise<VsCodeWebviewProtocol>;
|
||||
private core: Core;
|
||||
private battery: Battery;
|
||||
private workOsAuthProvider: WorkOsAuthProvider;
|
||||
|
||||
constructor(context: vscode.ExtensionContext) {
|
||||
// Register auth provider
|
||||
this.workOsAuthProvider = new WorkOsAuthProvider(context);
|
||||
this.workOsAuthProvider.initialize();
|
||||
context.subscriptions.push(this.workOsAuthProvider);
|
||||
|
||||
let resolveWebviewProtocol: any = undefined;
|
||||
this.webviewProtocolPromise = new Promise<VsCodeWebviewProtocol>(
|
||||
(resolve) => {
|
||||
|
|
@ -99,6 +108,7 @@ export class VsCodeExtension {
|
|||
this.ide,
|
||||
verticalDiffManagerPromise,
|
||||
configHandlerPromise,
|
||||
this.workOsAuthProvider,
|
||||
);
|
||||
|
||||
this.core = new Core(inProcessMessenger, this.ide, async (log: string) => {
|
||||
|
|
@ -142,7 +152,7 @@ export class VsCodeExtension {
|
|||
this.configHandler.onConfigUpdate((newConfig) => {
|
||||
this.sidebar.webviewProtocol?.request("configUpdate", undefined);
|
||||
|
||||
this.tabAutocompleteModel.clearLlm.bind(this.tabAutocompleteModel);
|
||||
this.tabAutocompleteModel.clearLlm();
|
||||
|
||||
registerAllCodeLensProviders(
|
||||
context,
|
||||
|
|
@ -196,7 +206,7 @@ export class VsCodeExtension {
|
|||
this.core.continueServerClientPromise,
|
||||
this.battery,
|
||||
quickEdit,
|
||||
this.core
|
||||
this.core,
|
||||
);
|
||||
|
||||
registerDebugTracker(this.sidebar.webviewProtocol, this.ide);
|
||||
|
|
@ -256,6 +266,9 @@ export class VsCodeExtension {
|
|||
webviewProtocol.request("didChangeControlPlaneSessionInfo", {
|
||||
sessionInfo,
|
||||
});
|
||||
|
||||
// To make sure continue-proxy models and anything else requiring it get updated access token
|
||||
this.configHandler.reloadConfig();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@ import * as path from "node:path";
|
|||
import * as vscode from "vscode";
|
||||
import { VerticalPerLineDiffManager } from "../diff/verticalPerLine/manager";
|
||||
import { VsCodeIde } from "../ideProtocol";
|
||||
import { getControlPlaneSessionInfo } from "../stubs/WorkOsAuthProvider";
|
||||
import {
|
||||
getControlPlaneSessionInfo,
|
||||
WorkOsAuthProvider,
|
||||
} from "../stubs/WorkOsAuthProvider";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
|
|
@ -71,6 +74,7 @@ export class VsCodeMessenger {
|
|||
private readonly ide: VsCodeIde,
|
||||
private readonly verticalDiffManagerPromise: Promise<VerticalPerLineDiffManager>,
|
||||
private readonly configHandlerPromise: Promise<ConfigHandler>,
|
||||
private readonly workOsAuthProvider: WorkOsAuthProvider,
|
||||
) {
|
||||
/** WEBVIEW ONLY LISTENERS **/
|
||||
this.onWebview("showFile", (msg) => {
|
||||
|
|
@ -294,5 +298,11 @@ export class VsCodeMessenger {
|
|||
this.onWebviewOrCore("getControlPlaneSessionInfo", async (msg) => {
|
||||
return getControlPlaneSessionInfo(msg.data.silent);
|
||||
});
|
||||
this.onWebviewOrCore("logoutOfControlPlane", async (msg) => {
|
||||
const sessions = await this.workOsAuthProvider.getSessions();
|
||||
await Promise.all(
|
||||
sessions.map((session) => workOsAuthProvider.removeSession(session.id)),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,20 +91,10 @@ export class QuickEdit {
|
|||
private readonly ide: IDE,
|
||||
private readonly context: vscode.ExtensionContext,
|
||||
) {
|
||||
this.initializeQuickEditState();
|
||||
this.initializeFileSearchState();
|
||||
}
|
||||
|
||||
private async initializeQuickEditState() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const existingHandler = this.verticalDiffManager.getHandlerForFile(
|
||||
editor.document.uri.fsPath ?? "",
|
||||
);
|
||||
|
||||
private async initializeFileSearchState() {
|
||||
const workspaceDirs = await this.ide.getWorkspaceDirs();
|
||||
|
||||
const results = await Promise.all(
|
||||
|
|
@ -119,6 +109,13 @@ export class QuickEdit {
|
|||
}));
|
||||
|
||||
this.miniSearch.addAll(filenames);
|
||||
}
|
||||
|
||||
private setActiveEditorAndPrevInput(editor: vscode.TextEditor) {
|
||||
const existingHandler = this.verticalDiffManager.getHandlerForFile(
|
||||
editor.document.uri.fsPath ?? "",
|
||||
);
|
||||
|
||||
this.editorWhenOpened = editor;
|
||||
this.previousInput = existingHandler?.input;
|
||||
}
|
||||
|
|
@ -152,11 +149,7 @@ export class QuickEdit {
|
|||
* // "Edit myFile.ts", "Edit myFile.ts:5-10", "Edit myFile.ts:15"
|
||||
*/
|
||||
_getQuickPickTitle = () => {
|
||||
const uri = this.editorWhenOpened.document.uri;
|
||||
|
||||
if (!uri) {
|
||||
return "Edit";
|
||||
}
|
||||
const { uri } = this.editorWhenOpened.document;
|
||||
|
||||
const fileName = vscode.workspace.asRelativePath(uri, true);
|
||||
|
||||
|
|
@ -210,6 +203,7 @@ export class QuickEdit {
|
|||
|
||||
async _getInitialQuickPickVal(): Promise<string | undefined> {
|
||||
const modelTitle = await this._getCurModelTitle();
|
||||
const { uri } = this.editorWhenOpened.document;
|
||||
|
||||
const initialItems: vscode.QuickPickItem[] = [
|
||||
{
|
||||
|
|
@ -241,9 +235,7 @@ export class QuickEdit {
|
|||
* as soon as the user types the search character
|
||||
*/
|
||||
const currentFileItem: vscode.QuickPickItem = {
|
||||
label: vscode.workspace.asRelativePath(
|
||||
this.editorWhenOpened.document.uri,
|
||||
),
|
||||
label: vscode.workspace.asRelativePath(uri),
|
||||
description: "Current file",
|
||||
alwaysShow: true,
|
||||
};
|
||||
|
|
@ -380,6 +372,20 @@ export class QuickEdit {
|
|||
// Clean up state from previous quick picks, e.g. if a user pressed `esc`
|
||||
this.clear();
|
||||
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
||||
// We only allow users to interact with a quick edit if there is an open editor
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set state that is unique to each quick pick instance
|
||||
this.setActiveEditorAndPrevInput(editor);
|
||||
|
||||
if (!this.editorWhenOpened) {
|
||||
return;
|
||||
}
|
||||
|
||||
const config = await this.configHandler.loadConfig();
|
||||
|
||||
if (!!args?.initialPrompt) {
|
||||
|
|
|
|||
1
gui/package-lock.json
generated
1
gui/package-lock.json
generated
|
|
@ -153,6 +153,7 @@
|
|||
"eslint": "^8",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"jest": "^29.7.0",
|
||||
"myers-diff": "^2.1.0",
|
||||
"onnxruntime-common": "1.14.0",
|
||||
"onnxruntime-web": "1.14.0",
|
||||
"ts-jest": "^29.1.1"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,17 @@ const FOOTER_HEIGHT = "1.8em";
|
|||
const LayoutTopDiv = styled(CustomScrollbarDiv)`
|
||||
height: 100%;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: rgba(136, 136, 136, 0.3);
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
`;
|
||||
|
||||
const BottomMessageDiv = styled.div<{ displayOnBottom: boolean }>`
|
||||
|
|
@ -66,7 +77,8 @@ const Footer = styled.footer`
|
|||
height: ${FOOTER_HEIGHT};
|
||||
background-color: transparent;
|
||||
backdrop-filter: blur(12px);
|
||||
|
||||
border-top: 1px solid rgba(136, 136, 136, 0.3);
|
||||
border-bottom: 1px solid rgba(136, 136, 136, 0.3);
|
||||
overflow: hidden;
|
||||
`;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
import { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { Fragment, useContext, useEffect, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useSelector } from "react-redux";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
defaultBorderRadius,
|
||||
|
|
@ -101,9 +101,6 @@ function ListBoxOption({
|
|||
showDelete?: boolean;
|
||||
selected: boolean;
|
||||
}) {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const [hovered, setHovered] = useState(false);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
import styled, { css, keyframes } from "styled-components";
|
||||
|
||||
const DEFAULT_DIAMETER = 6;
|
||||
|
||||
const blink = keyframes`
|
||||
0%, 100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.25;
|
||||
}
|
||||
`;
|
||||
|
||||
const blinkAnimation = css`
|
||||
animation: ${blink} 3s infinite;
|
||||
`;
|
||||
|
||||
const BlinkingDot = styled.div<{
|
||||
color: string;
|
||||
diameter?: number;
|
||||
shouldBlink?: boolean;
|
||||
}>`
|
||||
background-color: ${(props) => props.color};
|
||||
box-shadow: 0px 0px 2px 1px ${(props) => props.color};
|
||||
width: ${(props) => props.diameter ?? DEFAULT_DIAMETER}px;
|
||||
height: ${(props) => props.diameter ?? DEFAULT_DIAMETER}px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.75);
|
||||
margin: 0 2px;
|
||||
${(props) => (props.shouldBlink ?? false) && blinkAnimation};
|
||||
`;
|
||||
|
||||
export default BlinkingDot;
|
||||
|
|
@ -27,7 +27,7 @@ const StatusDot = styled.div<{
|
|||
height: ${(props) => props.diameter ?? DEFAULT_DIAMETER}px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.75);
|
||||
margin: 0 2px;
|
||||
margin: 0 4px 0 8px;
|
||||
${(props) => (props.shouldBlink ?? false) && blinkAnimation};
|
||||
`;
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
⏎ Enter
|
||||
</EnterButton>
|
||||
</span>
|
||||
<span className="flex flex-wrap-reverse items-center whitespace-nowrap">
|
||||
<span className="flex flex-wrap-reverse gap-1 items-center whitespace-nowrap">
|
||||
<ModelSelect />
|
||||
<span
|
||||
style={{
|
||||
|
|
@ -171,7 +171,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
defaultModel.title,
|
||||
) && (
|
||||
<span
|
||||
className="ml-1.5 mt-0.5"
|
||||
className="ml-1 mt-0.5"
|
||||
onMouseLeave={() => setFileSelectHovered(false)}
|
||||
onMouseEnter={() => setFileSelectHovered(true)}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import ConfirmationDialog from "../dialogs/ConfirmationDialog";
|
|||
const StyledListboxButton = styled(Listbox.Button)`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
gap: 2px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: ${() => `${getFontSize() - 4}px`};
|
||||
font-size: ${() => `${getFontSize() - 3}px`};
|
||||
background: transparent;
|
||||
color: ${() => lightGray};
|
||||
&:focus {
|
||||
|
|
@ -212,11 +212,14 @@ function ModelSelect() {
|
|||
}}
|
||||
>
|
||||
<div className="relative">
|
||||
<StyledListboxButton className="h-[18px] overflow-hidden">
|
||||
<StyledListboxButton
|
||||
className="h-[18px] overflow-hidden"
|
||||
style={{ padding: 0 }}
|
||||
>
|
||||
<div>{modelSelectTitle(defaultModel) || "Select model"}</div>
|
||||
<div className="pointer-events-none flex items-center">
|
||||
<ChevronDownIcon
|
||||
className="h-2.5 w-2.5 text-gray-400"
|
||||
className="h-2.5 w-2.5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -60,10 +60,11 @@ export function useAuth(): {
|
|||
dispatch(
|
||||
setDialogMessage(
|
||||
<ConfirmationDialog
|
||||
hideCancelButton={true}
|
||||
confirmText="Ok"
|
||||
text={"Click the user icon in the bottom left of VS Code to log out."}
|
||||
onConfirm={() => {}}
|
||||
confirmText="Yes, log out"
|
||||
text={"Are you sure you want to log out of Continue?"}
|
||||
onConfirm={() => {
|
||||
ideMessenger.request("logoutOfControlPlane", undefined);
|
||||
}}
|
||||
/>,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -484,6 +484,21 @@ export const models: { [key: string]: ModelPackage } = {
|
|||
icon: "openai.png",
|
||||
isOpenSource: false,
|
||||
},
|
||||
gpt4omini: {
|
||||
title: "GPT-4o Mini",
|
||||
description:
|
||||
"A model at less than half the price of gpt-3.5-turbo, but near gpt-4 in capabilities.",
|
||||
params: {
|
||||
model: "gpt-4o-mini",
|
||||
contextLength: 128_000,
|
||||
title: "GPT-4o mini",
|
||||
systemMessage:
|
||||
"You are an expert software developer. You give helpful and concise responses.",
|
||||
},
|
||||
providerOptions: ["openai"],
|
||||
icon: "openai.png",
|
||||
isOpenSource: false,
|
||||
},
|
||||
gpt35turbo: {
|
||||
title: "GPT-3.5-Turbo",
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ export const providers: Partial<Record<ModelProvider, ProviderInfo>> = {
|
|||
tags: [ModelProviderTags.RequiresApiKey],
|
||||
packages: [
|
||||
models.gpt4o,
|
||||
models.gpt4omini,
|
||||
models.gpt4turbo,
|
||||
models.gpt35turbo,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -108,9 +108,9 @@ const StepsDiv = styled.div`
|
|||
const NewSessionButton = styled.div`
|
||||
width: fit-content;
|
||||
margin-right: auto;
|
||||
margin-left: 8px;
|
||||
margin-top: 4px;
|
||||
|
||||
margin-left: 6px;
|
||||
margin-top: 2px;
|
||||
margin-bottom: 8px;
|
||||
font-size: ${getFontSize() - 2}px;
|
||||
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
|
|
|||
|
|
@ -12,46 +12,7 @@ import {
|
|||
import KeyboardShortcutsDialog from "../components/dialogs/KeyboardShortcuts";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useNavigationListener } from "../hooks/useNavigationListener";
|
||||
|
||||
const ResourcesDiv = styled.div`
|
||||
margin: 4px;
|
||||
border-top: 0.5px solid ${lightGray};
|
||||
border-bottom: 0.5px solid ${lightGray};
|
||||
`;
|
||||
|
||||
const IconDiv = styled.div<{ backgroundColor?: string }>`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
|
||||
padding: 12px;
|
||||
|
||||
& > a {
|
||||
color: ${vscForeground};
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: ${(props) => props.backgroundColor || lightGray};
|
||||
}
|
||||
`;
|
||||
|
||||
const TutorialButton = styled(Button)`
|
||||
padding: 2px 4px;
|
||||
margin-left: auto;
|
||||
margin-right: 12px;
|
||||
background-color: transparent;
|
||||
color: ${vscForeground};
|
||||
border: 1px solid ${lightGray};
|
||||
&:hover {
|
||||
background-color: ${lightGray};
|
||||
}
|
||||
`;
|
||||
import { SecondaryButton } from "../components";
|
||||
|
||||
function HelpPage() {
|
||||
useNavigationListener();
|
||||
|
|
@ -74,93 +35,117 @@ function HelpPage() {
|
|||
className="inline-block ml-4 cursor-pointer"
|
||||
/>
|
||||
<h3 className="text-lg font-bold m-2 inline-block">Help Center</h3>
|
||||
<TutorialButton
|
||||
onClick={() => {
|
||||
ideMessenger.post("showTutorial", undefined);
|
||||
navigate("/onboarding");
|
||||
}}
|
||||
>
|
||||
Open tutorial
|
||||
</TutorialButton>
|
||||
</div>
|
||||
|
||||
<h3
|
||||
className="my-0 py-3 mx-auto text-center cursor-pointer"
|
||||
onClick={() => {
|
||||
navigate("/stats");
|
||||
}}
|
||||
>
|
||||
View My Usage
|
||||
</h3>
|
||||
<Hr className="my-0" />
|
||||
<h3 className="my-3 mx-auto text-center">Resources</h3>
|
||||
<ResourcesDiv className="border">
|
||||
<IconDiv backgroundColor="rgb(234, 51, 35)">
|
||||
<div className="p-6 flex flex-col gap-6">
|
||||
<div className="grid grid-cols-3 gap-4 items-center">
|
||||
<div className="col-span-2">
|
||||
<h3 className="my-0">Documentation</h3>
|
||||
<p>
|
||||
Visit the documentation site to learn how to configure and use
|
||||
Continue.
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="https://youtu.be/3Ocrc-WX4iQ?si=eDLYtkc6CXQoHsEc"
|
||||
className="col-span-1 "
|
||||
href="https://docs.continue.dev/"
|
||||
target="_blank"
|
||||
>
|
||||
<svg
|
||||
width="42px"
|
||||
height="42px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-5.2 -4.5 60 60"
|
||||
fill={vscForeground}
|
||||
>
|
||||
<path d="M 44.898438 14.5 C 44.5 12.300781 42.601563 10.699219 40.398438 10.199219 C 37.101563 9.5 31 9 24.398438 9 C 17.800781 9 11.601563 9.5 8.300781 10.199219 C 6.101563 10.699219 4.199219 12.199219 3.800781 14.5 C 3.398438 17 3 20.5 3 25 C 3 29.5 3.398438 33 3.898438 35.5 C 4.300781 37.699219 6.199219 39.300781 8.398438 39.800781 C 11.898438 40.5 17.898438 41 24.5 41 C 31.101563 41 37.101563 40.5 40.601563 39.800781 C 42.800781 39.300781 44.699219 37.800781 45.101563 35.5 C 45.5 33 46 29.398438 46.101563 25 C 45.898438 20.5 45.398438 17 44.898438 14.5 Z M 19 32 L 19 18 L 31.199219 25 Z"></path>
|
||||
</svg>
|
||||
Demo Video
|
||||
<SecondaryButton className="w-full">View docs</SecondaryButton>
|
||||
</a>
|
||||
</IconDiv>
|
||||
<IconDiv backgroundColor={"#1bbe84a8"}>
|
||||
<a
|
||||
href="https://docs.continue.dev/how-to-use-continue"
|
||||
target="_blank"
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-3 gap-4 items-center">
|
||||
<div className="col-span-2">
|
||||
<h3 className="my-0">Tutorial</h3>
|
||||
<p>
|
||||
Open the tutorial to get a quick walkthrough of the most commonly
|
||||
used features in Continue.
|
||||
</p>
|
||||
</div>
|
||||
<SecondaryButton
|
||||
className="col-span-1 w-full"
|
||||
onClick={() => {
|
||||
ideMessenger.post("showTutorial", undefined);
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
width="42px"
|
||||
height="42px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-2.2 -2 28 28"
|
||||
fill={vscForeground}
|
||||
>
|
||||
<path d="M11.25 4.533A9.707 9.707 0 006 3a9.735 9.735 0 00-3.25.555.75.75 0 00-.5.707v14.25a.75.75 0 001 .707A8.237 8.237 0 016 18.75c1.995 0 3.823.707 5.25 1.886V4.533zM12.75 20.636A8.214 8.214 0 0118 18.75c.966 0 1.89.166 2.75.47a.75.75 0 001-.708V4.262a.75.75 0 00-.5-.707A9.735 9.735 0 0018 3a9.707 9.707 0 00-5.25 1.533v16.103z" />
|
||||
</svg>
|
||||
Documentation
|
||||
</a>
|
||||
</IconDiv>
|
||||
<IconDiv backgroundColor="rgb(88, 98, 227)">
|
||||
<a href="https://discord.gg/vapESyrFmJ" target="_blank">
|
||||
<svg
|
||||
width="42px"
|
||||
height="42px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-5 -5.5 60 60"
|
||||
fill={vscForeground}
|
||||
>
|
||||
<path d="M 41.625 10.769531 C 37.644531 7.566406 31.347656 7.023438 31.078125 7.003906 C 30.660156 6.96875 30.261719 7.203125 30.089844 7.589844 C 30.074219 7.613281 29.9375 7.929688 29.785156 8.421875 C 32.417969 8.867188 35.652344 9.761719 38.578125 11.578125 C 39.046875 11.867188 39.191406 12.484375 38.902344 12.953125 C 38.710938 13.261719 38.386719 13.429688 38.050781 13.429688 C 37.871094 13.429688 37.6875 13.378906 37.523438 13.277344 C 32.492188 10.15625 26.210938 10 25 10 C 23.789063 10 17.503906 10.15625 12.476563 13.277344 C 12.007813 13.570313 11.390625 13.425781 11.101563 12.957031 C 10.808594 12.484375 10.953125 11.871094 11.421875 11.578125 C 14.347656 9.765625 17.582031 8.867188 20.214844 8.425781 C 20.0625 7.929688 19.925781 7.617188 19.914063 7.589844 C 19.738281 7.203125 19.34375 6.960938 18.921875 7.003906 C 18.652344 7.023438 12.355469 7.566406 8.320313 10.8125 C 6.214844 12.761719 2 24.152344 2 34 C 2 34.175781 2.046875 34.34375 2.132813 34.496094 C 5.039063 39.605469 12.972656 40.941406 14.78125 41 C 14.789063 41 14.800781 41 14.8125 41 C 15.132813 41 15.433594 40.847656 15.621094 40.589844 L 17.449219 38.074219 C 12.515625 36.800781 9.996094 34.636719 9.851563 34.507813 C 9.4375 34.144531 9.398438 33.511719 9.765625 33.097656 C 10.128906 32.683594 10.761719 32.644531 11.175781 33.007813 C 11.234375 33.0625 15.875 37 25 37 C 34.140625 37 38.78125 33.046875 38.828125 33.007813 C 39.242188 32.648438 39.871094 32.683594 40.238281 33.101563 C 40.601563 33.515625 40.5625 34.144531 40.148438 34.507813 C 40.003906 34.636719 37.484375 36.800781 32.550781 38.074219 L 34.378906 40.589844 C 34.566406 40.847656 34.867188 41 35.1875 41 C 35.199219 41 35.210938 41 35.21875 41 C 37.027344 40.941406 44.960938 39.605469 47.867188 34.496094 C 47.953125 34.34375 48 34.175781 48 34 C 48 24.152344 43.785156 12.761719 41.625 10.769531 Z M 18.5 30 C 16.566406 30 15 28.210938 15 26 C 15 23.789063 16.566406 22 18.5 22 C 20.433594 22 22 23.789063 22 26 C 22 28.210938 20.433594 30 18.5 30 Z M 31.5 30 C 29.566406 30 28 28.210938 28 26 C 28 23.789063 29.566406 22 31.5 22 C 33.433594 22 35 23.789063 35 26 C 35 28.210938 33.433594 30 31.5 30 Z"></path>
|
||||
</svg>
|
||||
Continue Discord
|
||||
</a>
|
||||
</IconDiv>
|
||||
<IconDiv>
|
||||
Open tutorial
|
||||
</SecondaryButton>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-3 gap-4 items-center">
|
||||
<div className="col-span-2">
|
||||
<h3 className="my-0">Token usage stats</h3>
|
||||
<p>
|
||||
See how many tokens you're using each day and how they're
|
||||
distributed across your models.
|
||||
</p>
|
||||
</div>
|
||||
<SecondaryButton
|
||||
className="col-span-1"
|
||||
onClick={() => {
|
||||
navigate("/stats");
|
||||
}}
|
||||
>
|
||||
View token usage
|
||||
</SecondaryButton>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-3 gap-4 items-center">
|
||||
<div className="col-span-2">
|
||||
<h3 className="my-0">Have an issue?</h3>
|
||||
<p>Let us know on GitHub and we'll do our best to resolve it.</p>
|
||||
</div>
|
||||
<a
|
||||
href="https://github.com/continuedev/continue/issues/new/choose"
|
||||
target="_blank"
|
||||
className="no-underline"
|
||||
>
|
||||
<svg
|
||||
width="42px"
|
||||
height="42px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-1.2 -1.2 32 32"
|
||||
fill={vscForeground}
|
||||
>
|
||||
<path d="M15,3C8.373,3,3,8.373,3,15c0,5.623,3.872,10.328,9.092,11.63C12.036,26.468,12,26.28,12,26.047v-2.051 c-0.487,0-1.303,0-1.508,0c-0.821,0-1.551-0.353-1.905-1.009c-0.393-0.729-0.461-1.844-1.435-2.526 c-0.289-0.227-0.069-0.486,0.264-0.451c0.615,0.174,1.125,0.596,1.605,1.222c0.478,0.627,0.703,0.769,1.596,0.769 c0.433,0,1.081-0.025,1.691-0.121c0.328-0.833,0.895-1.6,1.588-1.962c-3.996-0.411-5.903-2.399-5.903-5.098 c0-1.162,0.495-2.286,1.336-3.233C9.053,10.647,8.706,8.73,9.435,8c1.798,0,2.885,1.166,3.146,1.481C13.477,9.174,14.461,9,15.495,9 c1.036,0,2.024,0.174,2.922,0.483C18.675,9.17,19.763,8,21.565,8c0.732,0.731,0.381,2.656,0.102,3.594 c0.836,0.945,1.328,2.066,1.328,3.226c0,2.697-1.904,4.684-5.894,5.097C18.199,20.49,19,22.1,19,23.313v2.734 c0,0.104-0.023,0.179-0.035,0.268C23.641,24.676,27,20.236,27,15C27,8.373,21.627,3,15,3z"></path>
|
||||
</svg>
|
||||
GitHub Issues
|
||||
<SecondaryButton className="grid grid-flow-col items-center gap-2">
|
||||
<svg
|
||||
viewBox="0 0 98 96"
|
||||
height={24}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"
|
||||
fill={vscForeground}
|
||||
/>
|
||||
</svg>
|
||||
Create a GitHub issue
|
||||
</SecondaryButton>
|
||||
</a>
|
||||
</IconDiv>
|
||||
</ResourcesDiv>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-3 gap-4 items-center w-full">
|
||||
<div className="col-span-2">
|
||||
<h3 className="my-0">Join the community!</h3>
|
||||
<p>
|
||||
Join us on Discord to stay up-to-date on the latest developments
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="https://discord.gg/vapESyrFmJ"
|
||||
target="_blank"
|
||||
className="no-underline"
|
||||
>
|
||||
<SecondaryButton className="grid grid-flow-col items-center gap-2 w-full">
|
||||
<svg
|
||||
width="42px"
|
||||
height="42px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-5 -5.5 60 60"
|
||||
fill={vscForeground}
|
||||
>
|
||||
<path d="M 41.625 10.769531 C 37.644531 7.566406 31.347656 7.023438 31.078125 7.003906 C 30.660156 6.96875 30.261719 7.203125 30.089844 7.589844 C 30.074219 7.613281 29.9375 7.929688 29.785156 8.421875 C 32.417969 8.867188 35.652344 9.761719 38.578125 11.578125 C 39.046875 11.867188 39.191406 12.484375 38.902344 12.953125 C 38.710938 13.261719 38.386719 13.429688 38.050781 13.429688 C 37.871094 13.429688 37.6875 13.378906 37.523438 13.277344 C 32.492188 10.15625 26.210938 10 25 10 C 23.789063 10 17.503906 10.15625 12.476563 13.277344 C 12.007813 13.570313 11.390625 13.425781 11.101563 12.957031 C 10.808594 12.484375 10.953125 11.871094 11.421875 11.578125 C 14.347656 9.765625 17.582031 8.867188 20.214844 8.425781 C 20.0625 7.929688 19.925781 7.617188 19.914063 7.589844 C 19.738281 7.203125 19.34375 6.960938 18.921875 7.003906 C 18.652344 7.023438 12.355469 7.566406 8.320313 10.8125 C 6.214844 12.761719 2 24.152344 2 34 C 2 34.175781 2.046875 34.34375 2.132813 34.496094 C 5.039063 39.605469 12.972656 40.941406 14.78125 41 C 14.789063 41 14.800781 41 14.8125 41 C 15.132813 41 15.433594 40.847656 15.621094 40.589844 L 17.449219 38.074219 C 12.515625 36.800781 9.996094 34.636719 9.851563 34.507813 C 9.4375 34.144531 9.398438 33.511719 9.765625 33.097656 C 10.128906 32.683594 10.761719 32.644531 11.175781 33.007813 C 11.234375 33.0625 15.875 37 25 37 C 34.140625 37 38.78125 33.046875 38.828125 33.007813 C 39.242188 32.648438 39.871094 32.683594 40.238281 33.101563 C 40.601563 33.515625 40.5625 34.144531 40.148438 34.507813 C 40.003906 34.636719 37.484375 36.800781 32.550781 38.074219 L 34.378906 40.589844 C 34.566406 40.847656 34.867188 41 35.1875 41 C 35.199219 41 35.210938 41 35.21875 41 C 37.027344 40.941406 44.960938 39.605469 47.867188 34.496094 C 47.953125 34.34375 48 34.175781 48 34 C 48 24.152344 43.785156 12.761719 41.625 10.769531 Z M 18.5 30 C 16.566406 30 15 28.210938 15 26 C 15 23.789063 16.566406 22 18.5 22 C 20.433594 22 22 23.789063 22 26 C 22 28.210938 20.433594 30 18.5 30 Z M 31.5 30 C 29.566406 30 28 28.210938 28 26 C 28 23.789063 29.566406 22 31.5 22 C 33.433594 22 35 23.789063 35 26 C 35 28.210938 33.433594 30 31.5 30 Z"></path>
|
||||
</svg>
|
||||
Continue Discord
|
||||
</SecondaryButton>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<KeyboardShortcutsDialog />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ function Stats() {
|
|||
<ArrowLeftIcon
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
onClick={() => navigate("/")}
|
||||
onClick={() => navigate(-1)}
|
||||
className="inline-block ml-4 cursor-pointer"
|
||||
/>
|
||||
<h3 className="text-lg font-bold m-2 inline-block">My Usage</h3>
|
||||
|
|
|
|||
|
|
@ -44,26 +44,31 @@ export const OpenAiLlms: LlmInfo[] = [
|
|||
{
|
||||
model: "gpt-4-turbo-preview",
|
||||
displayName: "GPT-4 Turbo Preview",
|
||||
contextLength: 4096,
|
||||
contextLength: 128_000,
|
||||
},
|
||||
{
|
||||
model: "gpt-4o",
|
||||
displayName: "GPT-4o",
|
||||
contextLength: 4096,
|
||||
contextLength: 128_000,
|
||||
},
|
||||
{
|
||||
model: "gpt-4o-mini",
|
||||
displayName: "GPT-4o Mini",
|
||||
contextLength: 128_000,
|
||||
},
|
||||
{
|
||||
model: "gpt-4-vision",
|
||||
displayName: "GPT-4 Vision",
|
||||
contextLength: 4096,
|
||||
contextLength: 128_000,
|
||||
},
|
||||
{
|
||||
model: "gpt-4-0125-preview",
|
||||
displayName: "GPT-4 (0125 Preview)",
|
||||
contextLength: 4096,
|
||||
contextLength: 128_000,
|
||||
},
|
||||
{
|
||||
model: "gpt-4-1106-preview",
|
||||
displayName: "GPT-4 (1106 Preview)",
|
||||
contextLength: 4096,
|
||||
contextLength: 128_000,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue