Merge branch 'main' into nate/platform

This commit is contained in:
Nate 2025-01-15 21:01:31 -08:00
commit bfa2d65328
7 changed files with 37 additions and 21 deletions

View file

@ -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),
}),
},
];

View file

@ -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<ChatMessage, PromptLog> {
const { completionOptions, log, raw } =
this._parseCompletionOptions(options);
let { completionOptions, log } = this._parseCompletionOptions(options);
completionOptions = this._modifyCompletionOptions(completionOptions);
const messages = this._compileChatMessages(completionOptions, _messages);

View file

@ -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
}
}
]

View file

@ -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://<my endpoint>:11434"
}
]

View file

@ -297,13 +297,12 @@ class AutocompleteService(private val project: Project) {
}
private fun isInjectedFile(editor: Editor): Boolean {
return ApplicationManager.getApplication().executeOnPooledThread<Boolean> {
ApplicationManager.getApplication().runReadAction<Boolean> {
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) {

View file

@ -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 (
<HeaderButtonWithToolTip
onClick={(e) => {

View file

@ -65,7 +65,6 @@ function useSetup() {
if (result.status === "error") {
return;
}
console.log("Config loaded", result.content);
await handleConfigUpdate(initial, result.content);
},
[ideMessenger, handleConfigUpdate],