diff --git a/core/context/providers/RepoMapContextProvider.ts b/core/context/providers/RepoMapContextProvider.ts index 0805d341e..deabfe590 100644 --- a/core/context/providers/RepoMapContextProvider.ts +++ b/core/context/providers/RepoMapContextProvider.ts @@ -41,7 +41,7 @@ class RepoMapContextProvider extends BaseContextProvider { // Doesn't ALWAYS depend on indexing, so not setting dependsOnIndexing = true, just checking for it includeSignatures: extras.config.disableIndexing ? false - : (this.options?.includeSignatures ?? false), + : (this.options?.includeSignatures ?? true), }), }, ]; diff --git a/core/llm/index.ts b/core/llm/index.ts index 4c38dd4db..5ecfa33ff 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -25,6 +25,7 @@ import { logDevData } from "../util/devdata.js"; import { DevDataSqliteDb } from "../util/devdataSqlite.js"; import mergeJson from "../util/merge.js"; import { renderChatMessage } from "../util/messageContent.js"; +import { isOllamaInstalled } from "../util/ollamaHelper.js"; import { Telemetry } from "../util/posthog.js"; import { withExponentialBackoff } from "../util/withExponentialBackoff.js"; @@ -55,7 +56,6 @@ import { toCompleteBody, toFimBody, } from "./openaiTypeConverters.js"; -import { isOllamaInstalled } from "../util/ollamaHelper.js"; export abstract class BaseLLM implements ILLM { static providerName: string; @@ -417,10 +417,9 @@ export abstract class BaseLLM implements ILLM { e.code === "ECONNREFUSED" && e.message.includes("http://127.0.0.1:11434") ) { - const message = (await isOllamaInstalled()) ? - "Unable to connect to local Ollama instance. Ollama may not be running." : - "Unable to connect to local Ollama instance. Ollama may not be installed or may not running." - ; + const message = (await isOllamaInstalled()) + ? "Unable to connect to local Ollama instance. Ollama may not be running." + : "Unable to connect to local Ollama instance. Ollama may not be installed or may not running."; throw new Error(message); } } @@ -695,13 +694,28 @@ export abstract class BaseLLM implements ILLM { return body; } + private _modifyCompletionOptions( + completionOptions: CompletionOptions, + ): CompletionOptions { + // As of 01/14/25 streaming is currently not available with o1 + // See these threads: + // - https://github.com/continuedev/continue/issues/3698 + // - https://community.openai.com/t/streaming-support-for-o1-o1-2024-12-17-resulting-in-400-unsupported-value/1085043 + if (completionOptions.model === "o1") { + completionOptions.stream = false; + } + + return completionOptions; + } + async *streamChat( _messages: ChatMessage[], signal: AbortSignal, options: LLMFullCompletionOptions = {}, ): AsyncGenerator { - const { completionOptions, log, raw } = - this._parseCompletionOptions(options); + let { completionOptions, log } = this._parseCompletionOptions(options); + + completionOptions = this._modifyCompletionOptions(completionOptions); const messages = this._compileChatMessages(completionOptions, _messages); diff --git a/docs/docs/customize/context-providers.md b/docs/docs/customize/context-providers.md index 23d8c2253..d49b38c93 100644 --- a/docs/docs/customize/context-providers.md +++ b/docs/docs/customize/context-providers.md @@ -261,9 +261,9 @@ Uses the top _n_ levels (defaulting to 3) of the call stack for that thread. ### `@Repository Map` -Reference the outline of your codebase. +Reference the outline of your codebase. By default, signatures are included along with file in the repo map. -`includeSignatures` params can be used to include signatures for all files in the repo. Use with caution as will increase context size significantly. `includeSignatures` will not work if indexing is disabled. +`includeSignatures` params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled. ```json title="config.json" { @@ -271,7 +271,7 @@ Reference the outline of your codebase. { "name": "repo-map", "params": { - "includeSignatures": false + "includeSignatures": false // default true } } ] diff --git a/docs/docs/customize/model-providers/top-level/ollama.md b/docs/docs/customize/model-providers/top-level/ollama.md index d2a4749c0..611c3dad8 100644 --- a/docs/docs/customize/model-providers/top-level/ollama.md +++ b/docs/docs/customize/model-providers/top-level/ollama.md @@ -64,7 +64,7 @@ To configure a remote instance of Ollama, add the `"apiBase"` property to your m { "title": "Llama3.1 8B", "provider": "ollama", - "model": "llama3.1:8b" + "model": "llama3.1:8b", "apiBase": "http://:11434" } ] diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt index b2650b8f4..343778332 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt @@ -297,13 +297,12 @@ class AutocompleteService(private val project: Project) { } private fun isInjectedFile(editor: Editor): Boolean { - return ApplicationManager.getApplication().executeOnPooledThread { - ApplicationManager.getApplication().runReadAction { - val psiFile = - PsiDocumentManager.getInstance(project).getPsiFile(editor.document) ?: return@runReadAction false - return@runReadAction psiFile.isInjectedText() - } - }.get() + val psiFile = runReadAction { PsiDocumentManager.getInstance(project).getPsiFile(editor.document) } + if (psiFile == null) { + return false + } + val response = runReadAction { psiFile.isInjectedText() } + return response } fun hideCompletions(editor: Editor) { diff --git a/gui/src/components/mainInput/MentionList.tsx b/gui/src/components/mainInput/MentionList.tsx index aae963779..815a12f00 100644 --- a/gui/src/components/mainInput/MentionList.tsx +++ b/gui/src/components/mainInput/MentionList.tsx @@ -81,6 +81,7 @@ const ICONS_FOR_DROPDOWN: { [key: string]: any } = { google: GoogleIcon, "gitlab-mr": GitlabIcon, http: GlobeAltIcon, + trash: TrashIcon, }; export function getIconFromDropdownItem( @@ -451,7 +452,10 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { /> )} {item.subActions?.map((subAction) => { - const Icon = ICONS_FOR_DROPDOWN[subAction.icon]; + const Icon = getIconFromDropdownItem( + subAction.icon, + "action", + ); return ( { diff --git a/gui/src/hooks/useSetup.ts b/gui/src/hooks/useSetup.ts index f78f9ddfb..57b4479af 100644 --- a/gui/src/hooks/useSetup.ts +++ b/gui/src/hooks/useSetup.ts @@ -65,7 +65,6 @@ function useSetup() { if (result.status === "error") { return; } - console.log("Config loaded", result.content); await handleConfigUpdate(initial, result.content); }, [ideMessenger, handleConfigUpdate],