Merge branch 'main' into package_task

This commit is contained in:
Nate 2025-02-15 23:07:04 -08:00
commit d1d779a80f
46 changed files with 1449 additions and 931 deletions

View file

@ -4,23 +4,10 @@ on:
pull_request:
branches:
- main
paths:
- "extensions/intellij/**"
- "extensions/vscode/**"
- "core/**"
- "gui/**"
- ".github/workflows/**"
- "docs/**"
push:
branches:
- main
paths:
- "extensions/intellij/**"
- "extensions/vscode/**"
- "core/**"
- "gui/**"
- ".github/workflows/**"
jobs:
install-root:

49
.vscode/tasks.json vendored
View file

@ -206,6 +206,55 @@
"command": "node",
"args": ["${workspaceFolder}/scripts/uninstall.js"],
"problemMatcher": []
},
{
"label": "refresh-dependencies:core",
"type": "shell",
"command": "npm",
"args": ["install"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/core"
},
"presentation": {
"close": true
}
},
{
"label": "refresh-dependencies:vscode",
"type": "shell",
"command": "npm",
"args": ["install"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/extensions/vscode"
},
"presentation": {
"close": true
}
},
{
"label": "refresh-dependencies:gui",
"type": "shell",
"command": "npm",
"args": ["install"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/gui"
},
"presentation": {
"close": true
}
},
{
"label": "refresh-dependencies:all",
"dependsOn": [
"refresh-dependencies:core",
"refresh-dependencies:gui",
"refresh-dependencies:vscode"
],
"type": "shell",
"problemMatcher": []
}
]
}

View file

@ -138,7 +138,7 @@ export class ConfigHandler {
}
}
private async loadPlatformProfiles() {
async loadPlatformProfiles() {
// Get the profiles and create their lifecycle managers
this.controlPlaneClient
.listAssistants(this.selectedOrgId)
@ -229,6 +229,22 @@ export class ConfigHandler {
return false;
}
private async reloadHubAssistants() {
const newFullSlugsList =
await this.controlPlaneClient.listAssistantFullSlugs(this.selectedOrgId);
if (newFullSlugsList) {
const shouldReload = this.fullSlugsListsDiffer(
newFullSlugsList,
this.lastFullSlugsList,
);
if (shouldReload) {
await this.loadPlatformProfiles();
}
this.lastFullSlugsList = newFullSlugsList;
}
}
private async fetchControlPlaneProfiles() {
if (await useHub(this.ideSettingsPromise)) {
clearInterval(this.platformProfilesRefreshInterval);
@ -236,23 +252,10 @@ export class ConfigHandler {
// Every 5 seconds we ask the platform whether there are any assistant updates in the last 5 seconds
// If so, we do the full (more expensive) reload
this.platformProfilesRefreshInterval = setInterval(async () => {
const newFullSlugsList =
await this.controlPlaneClient.listAssistantFullSlugs(
this.selectedOrgId,
);
if (newFullSlugsList) {
const shouldReload = this.fullSlugsListsDiffer(
newFullSlugsList,
this.lastFullSlugsList,
);
if (shouldReload) {
await this.loadPlatformProfiles();
}
this.lastFullSlugsList = newFullSlugsList;
}
}, PlatformProfileLoader.RELOAD_INTERVAL);
this.platformProfilesRefreshInterval = setInterval(
this.reloadHubAssistants.bind(this),
PlatformProfileLoader.RELOAD_INTERVAL,
);
} else {
this.controlPlaneClient
.listWorkspaces()

View file

@ -12,6 +12,8 @@ import {
import { GlobalContext } from "../util/GlobalContext";
import { editConfigJson } from "../util/paths";
import { ConfigHandler } from "./ConfigHandler";
function stringify(obj: any, indentation?: number): string {
return JSON.stringify(
obj,
@ -22,16 +24,24 @@ function stringify(obj: any, indentation?: number): string {
);
}
export function addContextProvider(provider: ContextProviderWithParams) {
export function addContextProvider(provider: ContextProviderWithParams, configHandler?: ConfigHandler) {
let isAdded = false;
editConfigJson((config) => {
if (!config.contextProviders) {
config.contextProviders = [provider];
} else {
config.contextProviders = [];
}
if (!config.contextProviders.some((p) => p.name === provider.name)) {
config.contextProviders.push(provider);
isAdded = true;
}
return config;
});
if (isAdded && configHandler) {
void configHandler.reloadConfig();
}
}
export function addModel(

View file

@ -301,7 +301,7 @@ export class Core {
});
on("config/addContextProvider", async (msg) => {
addContextProvider(msg.data);
addContextProvider(msg.data, this.configHandler);
});
on("config/updateSharedConfig", async (msg) => {
@ -936,6 +936,7 @@ export class Core {
on("didChangeSelectedOrg", (msg) => {
void this.configHandler.setSelectedOrgId(msg.data.id);
void this.configHandler.reloadConfig();
void this.configHandler.loadPlatformProfiles();
});
on("didChangeControlPlaneSessionInfo", async (msg) => {

1
core/index.d.ts vendored
View file

@ -908,6 +908,7 @@ export interface BaseCompletionOptions {
export interface ModelCapability {
uploadImage?: boolean;
tools?: boolean;
}
export interface ModelDescription {

View file

@ -26,6 +26,8 @@ import {
} from "../../util/paths";
import { Telemetry } from "../../util/posthog";
import { ConfigResult } from "@continuedev/config-yaml";
import { GlobalContext } from "../../util/GlobalContext";
import {
ArticleWithChunks,
htmlPageToArticleWithChunks,
@ -40,8 +42,6 @@ import {
SiteIndexingResults,
} from "./preIndexed";
import preIndexedDocs from "./preIndexedDocs";
import { ConfigResult } from "@continuedev/config-yaml";
import { GlobalContext } from "../../util/GlobalContext";
// Purposefully lowercase because lancedb converts
export interface LanceDbDocsRow {
@ -157,7 +157,8 @@ export default class DocsService {
const currentStatus = this.statuses.get(doc.startUrl);
if (currentStatus) {
return currentStatus;
this.handleStatusUpdate(currentStatus);
return;
}
const sharedStatus = {
@ -211,11 +212,7 @@ export default class DocsService {
if (isAborted) {
return true;
}
// // Handle indexing disabled change mid-indexing
// if (this.config.disableIndexing) {
// this.abort(startUrl);
// return true;
// }
// Handle embeddings provider change mid-indexing
if (this.config.embeddingsProvider.embeddingId !== startedWithEmbedder) {
this.abort(startUrl);
@ -277,10 +274,6 @@ export default class DocsService {
const oldConfig = this.config;
this.config = newConfig; // IMPORTANT - need to set up top, other methods below use this without passing it in
// if (this.config.disableIndexing) {
// return;
// }
// No point in indexing if no docs context provider
const hasDocsContextProvider = this.hasDocsContextProvider();
if (!hasDocsContextProvider) {
@ -368,25 +361,25 @@ export default class DocsService {
siteIndexingConfig: SiteIndexingConfig,
forceReindex: boolean = false,
): Promise<void> {
// if (this.config.disableIndexing) {
// console.warn("Attempting to add/index docs when indexing is disabled");
// return;
// }
const { startUrl, useLocalCrawling, maxDepth } = siteIndexingConfig;
// First, if indexing is already in process, don't attempt
// This queue is necessary because indexAndAdd is invoked circularly by config edits
// TODO shouldn't really be a gap between adding and checking in queue but probably fine
if (this.docsIndexingQueue.has(startUrl)) {
return;
}
const { isPreindexed, provider } =
await this.getEmbeddingsProvider(startUrl);
if (isPreindexed) {
console.warn("Attempted to indexAndAdd pre-indexed doc");
return;
}
// Queue - indexAndAdd is invoked circularly by config edits. This prevents duplicate runs
if (this.docsIndexingQueue.has(startUrl)) {
return;
}
const startedWithEmbedder = provider.embeddingId;
// Check if doc has been successfully indexed with the given embedder
// Note at this point we know it's not a pre-indexed doc
const indexExists = await this.hasMetadata(startUrl);
// Build status update - most of it is fixed values
@ -404,22 +397,6 @@ export default class DocsService {
url: siteIndexingConfig.startUrl,
};
// Clear current indexes if reIndexing
if (indexExists) {
if (forceReindex) {
await this.deleteIndexes(startUrl);
} else {
this.handleStatusUpdate({
...fixedStatus,
progress: 1,
description: "Complete",
status: "complete",
debugInfo: "Already indexed",
});
return;
}
}
// If not force-reindexing and has failed with same config, don't reattempt
if (!forceReindex) {
const globalContext = new GlobalContext();
@ -441,6 +418,27 @@ export default class DocsService {
}
}
if (indexExists && !forceReindex) {
this.handleStatusUpdate({
...fixedStatus,
progress: 1,
description: "Complete",
status: "complete",
debugInfo: "Already indexed",
});
return;
}
// Do a test run on the embedder
// This particular failure will not mark as a failed config in global context
// Since SiteIndexingConfig is likely to be valid
try {
await provider.embed(["continue-test-run"]);
} catch (e) {
console.error("Failed to test embeddings connection", e);
return;
}
const markFailedInGlobalContext = () => {
const globalContext = new GlobalContext();
const failedDocs = globalContext.get("failedDocs") ?? [];
@ -463,6 +461,11 @@ export default class DocsService {
try {
this.docsIndexingQueue.add(startUrl);
// Clear current indexes if reIndexing
if (indexExists && forceReindex) {
await this.deleteIndexes(startUrl);
}
this.addToConfig(siteIndexingConfig);
this.handleStatusUpdate({
@ -564,9 +567,10 @@ export default class DocsService {
});
try {
const subpathEmbeddings = await provider.embed(
article.chunks.map((c) => c.content),
);
const subpathEmbeddings =
article.chunks.length > 0
? await provider.embed(article.chunks.map((c) => c.content))
: [];
chunks.push(...article.chunks);
embeddings.push(...subpathEmbeddings);
const toWait = 100 * this.docsIndexingQueue.size + 50;
@ -592,7 +596,6 @@ export default class DocsService {
});
void this.ide.showToast("info", `Failed to index ${startUrl}`);
this.docsIndexingQueue.delete(startUrl);
markFailedInGlobalContext();
return;
}
@ -635,11 +638,6 @@ export default class DocsService {
favicon,
});
this.docsIndexingQueue.delete(startUrl);
if (this.shouldCancel(startUrl, startedWithEmbedder)) {
return;
}
this.handleStatusUpdate({
...fixedStatus,
description: "Complete",
@ -655,7 +653,11 @@ export default class DocsService {
removeFromFailedGlobalContext();
} catch (e) {
let description = `Error getting docs from: ${siteIndexingConfig.startUrl}`;
console.error(
`Error indexing docs at: ${siteIndexingConfig.startUrl}`,
e,
);
let description = `Error indexing docs at: ${siteIndexingConfig.startUrl}`;
if (e instanceof Error) {
if (
e.message.includes("github.com") &&
@ -664,7 +666,6 @@ export default class DocsService {
description = "Github rate limit exceeded"; // This text is used verbatim elsewhere
}
}
console.error("Error indexing docs", e);
this.handleStatusUpdate({
...fixedStatus,
description,
@ -916,7 +917,7 @@ export default class DocsService {
// Anything found in old config, new config, AND sqlite that doesn't match should be reindexed
// TODO if only favicon and title change, only update, don't embed
// Otherwise anything found in new config that isn't in sqlite should be added/indexed
const newDocs: SiteIndexingConfig[] = [];
const addedDocs: SiteIndexingConfig[] = [];
const changedDocs: SiteIndexingConfig[] = [];
for (const doc of newConfigDocs) {
const currentIndexedDoc = currentStartUrls.includes(doc.startUrl);
@ -953,14 +954,14 @@ export default class DocsService {
}
}
} else {
newDocs.push(doc);
addedDocs.push(doc);
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
}
}
await Promise.allSettled([
...changedDocs.map((doc) => this.indexAndAdd(doc, true)),
...newDocs.map((doc) => this.indexAndAdd(doc)),
...addedDocs.map((doc) => this.indexAndAdd(doc)),
]);
for (const doc of deletedDocs) {

View file

@ -1,4 +1,9 @@
import { ChatMessage, ModelCapability, TemplateType } from "../index.js";
import {
ChatMessage,
ModelCapability,
ModelDescription,
TemplateType,
} from "../index.js";
import {
anthropicTemplateMessages,
@ -52,6 +57,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [
"sambanova",
"vertexai",
"watsonx",
"nebius",
];
const PROVIDER_SUPPORTS_IMAGES: string[] = [
@ -68,6 +74,7 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [
"vertexai",
"azure",
"scaleway",
"nebius",
];
const MODEL_SUPPORTS_IMAGES: string[] = [
@ -87,12 +94,15 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
"llama3.2",
];
function modelSupportsTools(modelName: string, provider: string) {
const providerSupport = PROVIDER_TOOL_SUPPORT[provider];
function modelSupportsTools(modelDescription: ModelDescription) {
if (modelDescription.capabilities?.tools !== undefined) {
return modelDescription.capabilities.tools;
}
const providerSupport = PROVIDER_TOOL_SUPPORT[modelDescription.provider];
if (!providerSupport) {
return false;
}
return providerSupport(modelName) ?? false;
return providerSupport(modelDescription.model) ?? false;
}
function modelSupportsImages(

View file

@ -1,4 +1,9 @@
import { ChatHistoryItem, ChatMessage, MessagePart } from "../";
import {
ChatHistoryItem,
ChatMessage,
MessagePart,
ModelDescription,
} from "../";
import { normalizeToMessageParts } from "../util/messageContent";
import { modelSupportsTools } from "./autodetect";
@ -67,15 +72,18 @@ const TOOL_USE_RULES = `When using tools, follow the following guidelines:
- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.`;
function constructSystemPrompt(
model: string,
provider: string,
modelDescription: ModelDescription,
useTools: boolean,
): string | null {
let systemMessage = "";
if (CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => model.includes(family))) {
if (
CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) =>
modelDescription.model.includes(family),
)
) {
systemMessage = SYSTEM_MESSAGE;
}
if (useTools && modelSupportsTools(model, provider)) {
if (useTools && modelSupportsTools(modelDescription)) {
if (systemMessage) {
systemMessage += "\n\n";
}
@ -89,8 +97,7 @@ const CANCELED_TOOL_CALL_MESSAGE =
export function constructMessages(
history: ChatHistoryItem[],
model: string,
provider: string,
modelDescription: ModelDescription,
useTools: boolean,
): ChatMessage[] {
const filteredHistory = history.filter(
@ -98,7 +105,7 @@ export function constructMessages(
);
const msgs: ChatMessage[] = [];
const systemMessage = constructSystemPrompt(model, provider, useTools);
const systemMessage = constructSystemPrompt(modelDescription, useTools);
if (systemMessage) {
msgs.push({
role: "system",

View file

@ -1,4 +1,3 @@
import { r } from "tar";
import {
AssistantChatMessage,
ChatMessage,
@ -7,6 +6,7 @@ import {
MessagePart,
ToolCallDelta,
} from "../../index.js";
import { findLast } from "../../util/findLast.js";
import { renderChatMessage } from "../../util/messageContent.js";
import { BaseLLM } from "../index.js";
import { streamResponse } from "../stream.js";
@ -17,7 +17,6 @@ import {
GeminiGenerationConfig,
GeminiToolFunctionDeclaration,
} from "./gemini-types.js";
import { findLast } from "../../util/findLast.js";
class Gemini extends BaseLLM {
static providerName = "gemini";
@ -253,7 +252,7 @@ class Gemini extends BaseLLM {
}
// Helper function to recursively clean JSON Schema objects
const cleanJsonSchema = (schema: any): any => {
if (!schema || typeof schema !== 'object') return schema;
if (!schema || typeof schema !== "object") return schema;
if (Array.isArray(schema)) {
return schema.map(cleanJsonSchema);
@ -273,7 +272,7 @@ class Gemini extends BaseLLM {
...acc,
[key]: cleanJsonSchema(value),
}),
{}
{},
);
}
@ -349,8 +348,8 @@ class Gemini extends BaseLLM {
// Process all parts first to maintain order
const processedParts: Array<{
type: 'content' | 'tool' | 'toolCall',
data: any
type: "content" | "tool" | "toolCall";
data: any;
}> = [];
for (const part of content.parts) {
@ -366,7 +365,7 @@ class Gemini extends BaseLLM {
} else if ("functionCall" in part) {
// Queue function call
processedParts.push({
type: 'toolCall',
type: "toolCall",
data: {
type: "function",
id: "", // Not supported by gemini
@ -377,17 +376,17 @@ class Gemini extends BaseLLM {
? part.functionCall.args
: JSON.stringify(part.functionCall.args),
},
}
},
});
} else if ("functionResponse" in part) {
// Queue function response
processedParts.push({
type: 'tool',
type: "tool",
data: {
role: "tool",
content: part.functionResponse.response.output as string,
toolCallId: part.functionResponse.name,
}
},
});
} else {
console.warn("Unsupported gemini part type received", part);
@ -404,13 +403,13 @@ class Gemini extends BaseLLM {
// Then process tool calls and responses in order
for (const part of processedParts) {
if (part.type === 'toolCall') {
if (part.type === "toolCall") {
yield {
role: "assistant",
content: "",
toolCalls: [part.data],
};
} else if (part.type === 'tool') {
} else if (part.type === "tool") {
yield part.data;
}
}

View file

@ -10,6 +10,10 @@ class Nebius extends OpenAI {
};
private static MODEL_IDS: { [name: string]: string } = {
"deepseek/deepseek_v3": "deepseek-ai/DeepSeek-V3",
"deepseek/deepseek-r1": "deepseek-ai/DeepSeek-R1",
"qwen2.5-coder-32b": "Qwen/Qwen2.5-Coder-32B-Instruct-fast",
"Qwen/QwQ-32B-Preview": "Qwen/QwQ-32B-Preview",
"llama3.1-70b-nemotron": "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF-fast",
"llama3.1-8b": "meta-llama/Meta-Llama-3.1-70B-Instruct-fast",
"llama3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-fast",

View file

@ -2,6 +2,11 @@ export const PROVIDER_TOOL_SUPPORT: Record<
string,
(model: string) => boolean | undefined
> = {
"continue-proxy": (model) => {
return ["claude-3-5", "claude-3.5", "gpt-4", "o3", "gemini"].some((part) =>
model.toLowerCase().startsWith(part),
);
},
anthropic: (model) => {
if (
["claude-3-5", "claude-3.5"].some((part) =>
@ -13,7 +18,10 @@ export const PROVIDER_TOOL_SUPPORT: Record<
},
openai: (model) => {
// https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
if (model.toLowerCase().startsWith("gpt-4") || model.toLowerCase().startsWith("o3")) {
if (
model.toLowerCase().startsWith("gpt-4") ||
model.toLowerCase().startsWith("o3")
) {
return true;
}
},

264
core/package-lock.json generated
View file

@ -93,7 +93,7 @@
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
"cross-env": "^7.0.3",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"eslint": "^8",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
@ -3077,26 +3077,10 @@
"zod": "^3.23.8"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
"integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz",
"integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
"cpu": [
"arm"
],
@ -3106,13 +3090,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz",
"integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
"cpu": [
"arm64"
],
@ -3122,13 +3106,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz",
"integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
"cpu": [
"x64"
],
@ -3138,13 +3122,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz",
"integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
"cpu": [
"arm64"
],
@ -3154,13 +3138,13 @@
"darwin"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz",
"integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
"cpu": [
"x64"
],
@ -3170,13 +3154,13 @@
"darwin"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz",
"integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
"cpu": [
"arm64"
],
@ -3186,13 +3170,13 @@
"freebsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz",
"integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
"cpu": [
"x64"
],
@ -3202,13 +3186,13 @@
"freebsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz",
"integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
"cpu": [
"arm"
],
@ -3218,13 +3202,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz",
"integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
"cpu": [
"arm64"
],
@ -3234,13 +3218,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz",
"integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
"cpu": [
"ia32"
],
@ -3250,13 +3234,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz",
"integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
"cpu": [
"loong64"
],
@ -3266,13 +3250,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz",
"integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
"cpu": [
"mips64el"
],
@ -3282,13 +3266,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz",
"integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
"cpu": [
"ppc64"
],
@ -3298,13 +3282,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz",
"integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
"cpu": [
"riscv64"
],
@ -3314,13 +3298,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz",
"integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
"cpu": [
"s390x"
],
@ -3330,13 +3314,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz",
"integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
"cpu": [
"x64"
],
@ -3346,13 +3330,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz",
"integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
"cpu": [
"x64"
],
@ -3362,29 +3346,13 @@
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz",
"integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz",
"integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
"cpu": [
"x64"
],
@ -3394,13 +3362,13 @@
"openbsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz",
"integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
"cpu": [
"x64"
],
@ -3410,13 +3378,13 @@
"sunos"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz",
"integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
"cpu": [
"arm64"
],
@ -3426,13 +3394,13 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz",
"integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
"cpu": [
"ia32"
],
@ -3442,13 +3410,13 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz",
"integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
"cpu": [
"x64"
],
@ -3458,7 +3426,7 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@eslint-community/eslint-utils": {
@ -7931,42 +7899,40 @@
}
},
"node_modules/esbuild": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz",
"integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.24.0",
"@esbuild/android-arm": "0.24.0",
"@esbuild/android-arm64": "0.24.0",
"@esbuild/android-x64": "0.24.0",
"@esbuild/darwin-arm64": "0.24.0",
"@esbuild/darwin-x64": "0.24.0",
"@esbuild/freebsd-arm64": "0.24.0",
"@esbuild/freebsd-x64": "0.24.0",
"@esbuild/linux-arm": "0.24.0",
"@esbuild/linux-arm64": "0.24.0",
"@esbuild/linux-ia32": "0.24.0",
"@esbuild/linux-loong64": "0.24.0",
"@esbuild/linux-mips64el": "0.24.0",
"@esbuild/linux-ppc64": "0.24.0",
"@esbuild/linux-riscv64": "0.24.0",
"@esbuild/linux-s390x": "0.24.0",
"@esbuild/linux-x64": "0.24.0",
"@esbuild/netbsd-x64": "0.24.0",
"@esbuild/openbsd-arm64": "0.24.0",
"@esbuild/openbsd-x64": "0.24.0",
"@esbuild/sunos-x64": "0.24.0",
"@esbuild/win32-arm64": "0.24.0",
"@esbuild/win32-ia32": "0.24.0",
"@esbuild/win32-x64": "0.24.0"
"@esbuild/android-arm": "0.17.19",
"@esbuild/android-arm64": "0.17.19",
"@esbuild/android-x64": "0.17.19",
"@esbuild/darwin-arm64": "0.17.19",
"@esbuild/darwin-x64": "0.17.19",
"@esbuild/freebsd-arm64": "0.17.19",
"@esbuild/freebsd-x64": "0.17.19",
"@esbuild/linux-arm": "0.17.19",
"@esbuild/linux-arm64": "0.17.19",
"@esbuild/linux-ia32": "0.17.19",
"@esbuild/linux-loong64": "0.17.19",
"@esbuild/linux-mips64el": "0.17.19",
"@esbuild/linux-ppc64": "0.17.19",
"@esbuild/linux-riscv64": "0.17.19",
"@esbuild/linux-s390x": "0.17.19",
"@esbuild/linux-x64": "0.17.19",
"@esbuild/netbsd-x64": "0.17.19",
"@esbuild/openbsd-x64": "0.17.19",
"@esbuild/sunos-x64": "0.17.19",
"@esbuild/win32-arm64": "0.17.19",
"@esbuild/win32-ia32": "0.17.19",
"@esbuild/win32-x64": "0.17.19"
}
},
"node_modules/escalade": {

View file

@ -32,7 +32,7 @@
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
"cross-env": "^7.0.3",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"eslint": "^8",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",

View file

@ -32,6 +32,7 @@ Each model has specific configuration options tailored to its provider and funct
- `engine`: Engine for Azure OpenAI requests.
- `capabilities`: Override auto-detected capabilities:
- `uploadImage`: Boolean indicating if the model supports image uploads.
- `tools`: Boolean indicating if the model supports tool use.
_(AWS Only)_

View file

@ -121,6 +121,7 @@ class MessageTypes {
"indexing/setPaused",
"docs/getSuggestedDocs",
"docs/initStatuses",
"docs/getDetails",
//
"completeOnboarding",
"addAutocompleteModel",

View file

@ -11,7 +11,6 @@ bin
assets
gui/**
!gui/onigasm.wasm
.devcontainer
.github

View file

@ -440,6 +440,10 @@
"uploadImage": {
"type": "boolean",
"description": "Indicates whether the model can upload images."
},
"tools": {
"type": "boolean",
"description": "Indicates whether the model can use tools"
}
}
}

View file

@ -22,7 +22,7 @@
"dbinfoz": "^0.14.0",
"diff": "^7.0.0",
"downshift": "^7.6.0",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"express": "^4.18.2",
"fkill": "^8.1.0",
"follow-redirects": "^1.15.4",
@ -79,7 +79,7 @@
"@vscode/vsce": "^2.22.0",
"cargo-cp-artifact": "^0.1",
"chai": "^4.5.0",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"esbuild-visualizer": "^0.6.0",
"eslint": "^8.28.0",
"glob": "^8.0.3",
@ -186,7 +186,7 @@
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
"cross-env": "^7.0.3",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"eslint": "^8",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
@ -758,26 +758,10 @@
"node": ">=12.13.0"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
"integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz",
"integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
"cpu": [
"arm"
],
@ -787,13 +771,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz",
"integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
"cpu": [
"arm64"
],
@ -803,13 +787,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz",
"integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
"cpu": [
"x64"
],
@ -819,13 +803,13 @@
"android"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz",
"integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
"cpu": [
"arm64"
],
@ -835,13 +819,13 @@
"darwin"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz",
"integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
"cpu": [
"x64"
],
@ -851,13 +835,13 @@
"darwin"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz",
"integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
"cpu": [
"arm64"
],
@ -867,13 +851,13 @@
"freebsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz",
"integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
"cpu": [
"x64"
],
@ -883,13 +867,13 @@
"freebsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz",
"integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
"cpu": [
"arm"
],
@ -899,13 +883,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz",
"integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
"cpu": [
"arm64"
],
@ -915,13 +899,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz",
"integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
"cpu": [
"ia32"
],
@ -931,13 +915,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz",
"integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
"cpu": [
"loong64"
],
@ -947,13 +931,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz",
"integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
"cpu": [
"mips64el"
],
@ -963,13 +947,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz",
"integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
"cpu": [
"ppc64"
],
@ -979,13 +963,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz",
"integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
"cpu": [
"riscv64"
],
@ -995,13 +979,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz",
"integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
"cpu": [
"s390x"
],
@ -1011,13 +995,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz",
"integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
"cpu": [
"x64"
],
@ -1027,13 +1011,13 @@
"linux"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz",
"integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
"cpu": [
"x64"
],
@ -1043,29 +1027,13 @@
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz",
"integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz",
"integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
"cpu": [
"x64"
],
@ -1075,13 +1043,13 @@
"openbsd"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz",
"integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
"cpu": [
"x64"
],
@ -1091,13 +1059,13 @@
"sunos"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz",
"integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
"cpu": [
"arm64"
],
@ -1107,13 +1075,13 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz",
"integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
"cpu": [
"ia32"
],
@ -1123,13 +1091,13 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz",
"integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
"cpu": [
"x64"
],
@ -1139,7 +1107,7 @@
"win32"
],
"engines": {
"node": ">=18"
"node": ">=12"
}
},
"node_modules/@eslint-community/eslint-utils": {
@ -5352,42 +5320,40 @@
}
},
"node_modules/esbuild": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz",
"integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.24.0",
"@esbuild/android-arm": "0.24.0",
"@esbuild/android-arm64": "0.24.0",
"@esbuild/android-x64": "0.24.0",
"@esbuild/darwin-arm64": "0.24.0",
"@esbuild/darwin-x64": "0.24.0",
"@esbuild/freebsd-arm64": "0.24.0",
"@esbuild/freebsd-x64": "0.24.0",
"@esbuild/linux-arm": "0.24.0",
"@esbuild/linux-arm64": "0.24.0",
"@esbuild/linux-ia32": "0.24.0",
"@esbuild/linux-loong64": "0.24.0",
"@esbuild/linux-mips64el": "0.24.0",
"@esbuild/linux-ppc64": "0.24.0",
"@esbuild/linux-riscv64": "0.24.0",
"@esbuild/linux-s390x": "0.24.0",
"@esbuild/linux-x64": "0.24.0",
"@esbuild/netbsd-x64": "0.24.0",
"@esbuild/openbsd-arm64": "0.24.0",
"@esbuild/openbsd-x64": "0.24.0",
"@esbuild/sunos-x64": "0.24.0",
"@esbuild/win32-arm64": "0.24.0",
"@esbuild/win32-ia32": "0.24.0",
"@esbuild/win32-x64": "0.24.0"
"@esbuild/android-arm": "0.17.19",
"@esbuild/android-arm64": "0.17.19",
"@esbuild/android-x64": "0.17.19",
"@esbuild/darwin-arm64": "0.17.19",
"@esbuild/darwin-x64": "0.17.19",
"@esbuild/freebsd-arm64": "0.17.19",
"@esbuild/freebsd-x64": "0.17.19",
"@esbuild/linux-arm": "0.17.19",
"@esbuild/linux-arm64": "0.17.19",
"@esbuild/linux-ia32": "0.17.19",
"@esbuild/linux-loong64": "0.17.19",
"@esbuild/linux-mips64el": "0.17.19",
"@esbuild/linux-ppc64": "0.17.19",
"@esbuild/linux-riscv64": "0.17.19",
"@esbuild/linux-s390x": "0.17.19",
"@esbuild/linux-x64": "0.17.19",
"@esbuild/netbsd-x64": "0.17.19",
"@esbuild/openbsd-x64": "0.17.19",
"@esbuild/sunos-x64": "0.17.19",
"@esbuild/win32-arm64": "0.17.19",
"@esbuild/win32-ia32": "0.17.19",
"@esbuild/win32-x64": "0.17.19"
}
},
"node_modules/esbuild-visualizer": {

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "0.9.266",
"version": "0.9.268",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
@ -632,7 +632,7 @@
"@vscode/vsce": "^2.22.0",
"cargo-cp-artifact": "^0.1",
"chai": "^4.5.0",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"esbuild-visualizer": "^0.6.0",
"eslint": "^8.28.0",
"glob": "^8.0.3",
@ -659,7 +659,7 @@
"dbinfoz": "^0.14.0",
"diff": "^7.0.0",
"downshift": "^7.6.0",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"express": "^4.18.2",
"fkill": "^8.1.0",
"follow-redirects": "^1.15.4",

View file

@ -120,12 +120,6 @@ const isMacTarget = target?.startsWith("darwin");
fs.copyFileSync("tmp_index.html", indexHtmlPath);
fs.unlinkSync("tmp_index.html");
// Copy over other misc. files
fs.copyFileSync(
"../extensions/vscode/gui/onigasm.wasm",
path.join(intellijExtensionWebviewPath, "onigasm.wasm"),
);
console.log("[info] Copied gui build to JetBrains extension");
// Then copy over the dist folder to the VSCode extension //
@ -387,7 +381,7 @@ const isMacTarget = target?.startsWith("darwin");
// Download esbuild from npm in tmp and copy over
console.log("npm installing esbuild binary");
await installNodeModuleInTempDirAndCopyToCurrent(
"esbuild@0.24.0",
"esbuild@0.17.19",
"@esbuild",
);
}

View file

@ -18,8 +18,10 @@ function copyConfigSchema() {
enum: ["merge", "overwrite"],
default: "merge",
title: "Merge behavior",
markdownDescription: "If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json.",
"x-intellij-html-description": "<p>If set to <code>merge</code>, <code>.continuerc.json</code> will be applied on top of <code>config.json</code> (arrays and objects are merged). If set to <code>overwrite</code>, then every top-level property of <code>.continuerc.json</code> will overwrite that property from <code>config.json</code>.</p>"
markdownDescription:
"If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json.",
"x-intellij-html-description":
"<p>If set to <code>merge</code>, <code>.continuerc.json</code> will be applied on top of <code>config.json</code> (arrays and objects are merged). If set to <code>overwrite</code>, then every top-level property of <code>.continuerc.json</code> will overwrite that property from <code>config.json</code>.</p>",
};
fs.writeFileSync("continue_rc_schema.json", JSON.stringify(schema, null, 2));
@ -123,12 +125,6 @@ async function buildGui(isGhAction) {
fs.copyFileSync("tmp_index.html", indexHtmlPath);
fs.unlinkSync("tmp_index.html");
// Copy over other misc. files
fs.copyFileSync(
"../extensions/vscode/gui/onigasm.wasm",
path.join(intellijExtensionWebviewPath, "onigasm.wasm"),
);
console.log("[info] Copied gui build to JetBrains extension");
// Then copy over the dist folder to the VSCode extension //
@ -539,5 +535,5 @@ module.exports = {
downloadSqliteBinary,
downloadRipgrepBinary,
copyTokenizers,
copyScripts
copyScripts,
};

24
gui/package-lock.json generated
View file

@ -32,7 +32,6 @@
"lodash": "^4.17.21",
"minisearch": "^7.0.2",
"mustache": "^4.2.0",
"onigasm": "^2.2.5",
"posthog-js": "^1.130.1",
"prismjs": "^1.29.0",
"react": "^18.2.0",
@ -188,7 +187,7 @@
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
"cross-env": "^7.0.3",
"esbuild": "0.24.0",
"esbuild": "0.17.19",
"eslint": "^8",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
@ -8835,27 +8834,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/onigasm": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz",
"integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==",
"dependencies": {
"lru-cache": "^5.1.1"
}
},
"node_modules/onigasm/node_modules/lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
"dependencies": {
"yallist": "^3.0.2"
}
},
"node_modules/onigasm/node_modules/yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
},
"node_modules/optionator": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",

View file

@ -40,7 +40,6 @@
"lodash": "^4.17.21",
"minisearch": "^7.0.2",
"mustache": "^4.2.0",
"onigasm": "^2.2.5",
"posthog-js": "^1.130.1",
"prismjs": "^1.29.0",
"react": "^18.2.0",

View file

@ -1,15 +1,15 @@
import { useDispatch } from "react-redux";
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
import { useAppSelector } from "../../redux/hooks";
import { useEffect } from "react";
import { selectUsePlatform } from "../../redux/selectors";
import { PlatformOnboardingCard } from "../OnboardingCard/platform/PlatformOnboardingCard";
import { useDispatch } from "react-redux";
import { useAppSelector } from "../../redux/hooks";
import { selectUseHub } from "../../redux/selectors";
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
import { OnboardingCard } from "../OnboardingCard";
import { PlatformOnboardingCard } from "../OnboardingCard/platform/PlatformOnboardingCard";
function FreeTrialOverDialog() {
const dispatch = useDispatch();
const history = useAppSelector((store) => store.session.history);
const usePlatform = useAppSelector(selectUsePlatform);
const usePlatform = useAppSelector(selectUseHub);
useEffect(() => {
if (history.length === 0) {

View file

@ -91,7 +91,6 @@ function DocsIndexingStatus({ docConfig }: IndexingStatusViewerProps) {
return (
<div className="mt-2 flex w-full flex-col">
{/* {`${status.type} - ${status.id} - ${status.status} - ${status.progress} - ${status.description} - ${status.icon}`} */}
<div
className={`flex flex-row items-center justify-between gap-2 text-sm`}
>

View file

@ -7,11 +7,15 @@ import { useAppSelector } from "../../redux/hooks";
import { useContext, useMemo } from "react";
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { IndexingStatus } from "core";
function DocsIndexingStatuses() {
const dispatch = useDispatch();
const config = useAppSelector((store) => store.config.config);
const ideMessenger = useContext(IdeMessengerContext);
const indexingStatuses = useAppSelector(
(store) => store.indexing.indexing.statuses,
);
const hasDocsProvider = useMemo(() => {
return !!config.contextProviders?.some(
@ -19,15 +23,31 @@ function DocsIndexingStatuses() {
);
}, [config]);
const configDocs = useMemo(() => {
return config.docs ?? [];
}, [config]);
// TODO - this might significantly impact performance during indexing
const sortedConfigDocs = useMemo(() => {
const sorter = (status: IndexingStatus["status"]) => {
// TODO - further sorting?
if (status === "indexing" || status === "paused") return 0;
if (status === "failed") return 1;
if (status === "aborted" || status === "pending") return 2;
return 3;
};
const docs = [...(config.docs ?? [])];
docs.sort((a, b) =>
sorter(indexingStatuses[b.startUrl]?.status ?? "pending") >
sorter(indexingStatuses[a.startUrl]?.status ?? "pending")
? -1
: 1,
);
return docs;
}, [config, indexingStatuses]);
return (
<div className="flex flex-col gap-1">
<div className="flex flex-row items-center justify-between">
<h3 className="mb-0 mt-0 text-xl">@docs indexes</h3>
{configDocs.length ? (
{sortedConfigDocs.length ? (
<SecondaryButton
className="!my-0 flex h-7 flex-col items-center justify-center"
onClick={() => {
@ -41,7 +61,7 @@ function DocsIndexingStatuses() {
</div>
<span className="text-xs text-stone-500">
{hasDocsProvider ? (
configDocs.length ? (
sortedConfigDocs.length ? (
"Manage your documentation sources"
) : (
"No docs yet"
@ -72,7 +92,7 @@ function DocsIndexingStatuses() {
</span>
<div className="flex max-h-[170px] flex-col gap-1 overflow-y-auto overflow-x-hidden pr-2">
<div>
{configDocs.length === 0 && (
{sortedConfigDocs.length === 0 && (
<SecondaryButton
className="flex h-7 flex-col items-center justify-center"
onClick={() => {
@ -84,7 +104,7 @@ function DocsIndexingStatuses() {
</SecondaryButton>
)}
</div>
{configDocs.map((doc) => {
{sortedConfigDocs.map((doc) => {
return <DocsIndexingStatus key={doc.startUrl} docConfig={doc} />;
})}
</div>

View file

@ -93,7 +93,7 @@ function InputToolbar(props: InputToolbarProps) {
const isEnterDisabled = props.disabled || isEditModeAndNoCodeToEdit;
const toolsSupported =
defaultModel &&
modelSupportsTools(defaultModel.model, defaultModel.provider) &&
modelSupportsTools(defaultModel) &&
!props.toolbarOptions?.hideTools;
const supportsImages =

View file

@ -1,23 +1,21 @@
import { Popover } from "@headlessui/react";
import { ChevronDownIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react";
import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline";
import { useContext, useEffect, useRef } from "react";
import { useAuth } from "../../../context/Auth";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { useAppDispatch } from "../../../redux/hooks";
import {
getFontSize,
isLocalProfile,
isMetaEquivalentKeyPressed,
} from "../../../util";
import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition";
import { AssistantSelectOptions } from "./AssistantSelectOptions";
import AssistantIcon from "./AssistantIcon";
import { getProfileDisplayText } from "./utils";
import { cycleProfile } from "../../../redux/thunks/profileAndOrg";
import { getFontSize, isMetaEquivalentKeyPressed } from "../../../util";
import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition";
import AssistantIcon from "./AssistantIcon";
import { AssistantSelectOptions } from "./AssistantSelectOptions";
import { getProfileDisplayText } from "./utils";
export default function AssistantSelect() {
const dispatch = useAppDispatch();
const buttonRef = useRef<HTMLButtonElement>(null);
const { selectedProfile } = useAuth();
const { selectedProfile, selectedOrganization } = useAuth();
const ideMessenger = useContext(IdeMessengerContext);
useEffect(() => {
let lastToggleTime = 0;
@ -45,7 +43,20 @@ export default function AssistantSelect() {
}, []);
if (!selectedProfile) {
return null;
return (
<div
onClick={() => {
ideMessenger.request("controlPlane/openUrl", {
path: "/new?type=assistant",
orgSlug: selectedOrganization?.slug,
});
}}
className="text-lightgray hover:bg mb-1 mr-3 flex cursor-pointer items-center gap-1"
style={{ fontSize: `${getFontSize() - 2}px` }}
>
<PlusIcon className="h-4 w-4" /> Create your first assistant
</div>
);
}
return (

View file

@ -59,7 +59,7 @@ export const models: { [key: string]: ModelPackage } = {
},
},
],
providerOptions: ["novita"],
providerOptions: ["novita", "nebius"],
isOpenSource: true,
},
deepseekR1Chat: {
@ -84,7 +84,7 @@ export const models: { [key: string]: ModelPackage } = {
},
},
],
providerOptions: ["novita"],
providerOptions: ["novita", "nebius"],
isOpenSource: true,
},
llama318BChat: {
@ -499,7 +499,7 @@ export const models: { [key: string]: ModelPackage } = {
contextLength: 8192,
},
icon: "meta.png",
providerOptions: ["groq", "scaleway"],
providerOptions: ["groq", "scaleway", "nebius"],
isOpenSource: false,
},
llama3170bChat: {
@ -512,7 +512,7 @@ export const models: { [key: string]: ModelPackage } = {
contextLength: 8192,
},
icon: "meta.png",
providerOptions: ["groq", "scaleway"],
providerOptions: ["groq", "scaleway", "nebius"],
isOpenSource: false,
},
llama31405bChat: {
@ -525,7 +525,7 @@ export const models: { [key: string]: ModelPackage } = {
contextLength: 8192,
},
icon: "meta.png",
providerOptions: ["groq"],
providerOptions: ["groq", "nebius"],
isOpenSource: false,
},
llama3170bNemotron: {
@ -551,7 +551,7 @@ export const models: { [key: string]: ModelPackage } = {
contextLength: 8192,
},
icon: "meta.png",
providerOptions: ["ollama", "groq", "llama.cpp", "sambanova"],
providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "nebius"],
isOpenSource: false,
},
llama323bChat: {
@ -1371,10 +1371,10 @@ export const models: { [key: string]: ModelPackage } = {
params: {
title: "Qwen 2.5 Coder 32b",
model: "qwen2.5-coder-32b",
contextLength: 128_000,
contextLength: 32_000,
},
icon: "qwen.png",
providerOptions: ["scaleway"],
providerOptions: ["scaleway", "nebius"],
isOpenSource: true,
},
grokBeta: {

View file

@ -867,6 +867,10 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo
icon: "nebius.png",
tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource],
packages: [
models.deepseekR1Chat,
models.deepseekV3Chat,
models.QwenQwQ_32b_preview,
models.Qwen25Coder_32b,
models.llama318bChat,
models.llama3170bChat,
models.llama31405bChat,

View file

@ -42,7 +42,7 @@ import { IdeMessengerContext } from "../../context/IdeMessenger";
import { useTutorialCard } from "../../hooks/useTutorialCard";
import { useWebviewListener } from "../../hooks/useWebviewListener";
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
import { selectUsePlatform } from "../../redux/selectors";
import { selectUseHub } from "../../redux/selectors";
import { selectCurrentToolCall } from "../../redux/selectors/selectCurrentToolCall";
import { selectDefaultModel } from "../../redux/slices/configSlice";
import { submitEdit } from "../../redux/slices/editModeState";
@ -222,7 +222,7 @@ export function Chat() {
selectIsSingleRangeEditOrInsertion,
);
const lastSessionId = useAppSelector((state) => state.session.lastSessionId);
const usePlatform = useAppSelector(selectUsePlatform);
const useHub = useAppSelector(selectUseHub);
useEffect(() => {
// Cmd + Backspace to delete current step
@ -365,7 +365,7 @@ export function Chat() {
useAutoScroll(stepsDivRef, history);
const showPageHeader = isInEditMode || usePlatform;
const showPageHeader = isInEditMode || useHub;
return (
<>
@ -382,7 +382,7 @@ export function Chat() {
}
: undefined
}
rightContent={usePlatform && <AssistantSelect />}
rightContent={useHub && <AssistantSelect />}
/>
)}
@ -567,7 +567,7 @@ export function Chat() {
<>
{onboardingCard.show && (
<div className="mx-2 mt-10">
{usePlatform ? (
{useHub ? (
<PlatformOnboardingCard isDialog={false} />
) : (
<OnboardingCard isDialog={false} />

View file

@ -43,7 +43,7 @@ export const selectUseActiveFile = createSelector(
(defaultContext) => defaultContext?.includes("activeFile" as any),
);
export const selectUsePlatform = createSelector(
export const selectUseHub = createSelector(
[(state: RootState) => state.config.config.usePlatform],
(usePlatform) => usePlatform,
);

View file

@ -27,8 +27,7 @@ export const streamNormalInput = createAsyncThunk<
throw new Error("Default model not defined");
}
const includeTools =
useTools && modelSupportsTools(defaultModel.model, defaultModel.provider);
const includeTools = useTools && modelSupportsTools(defaultModel);
// Send request
const gen = extra.ideMessenger.llmStreamChat(

View file

@ -122,8 +122,7 @@ export const streamResponseThunk = createAsyncThunk<
const updatedHistory = getState().session.history;
const messages = constructMessages(
[...updatedHistory],
defaultModel.model,
defaultModel.provider,
defaultModel,
useTools,
);

View file

@ -63,8 +63,7 @@ export const streamResponseAfterToolCall = createAsyncThunk<
const updatedHistory = getState().session.history;
const messages = constructMessages(
[...updatedHistory],
defaultModel.model,
defaultModel.provider,
defaultModel,
useTools,
);
const output = await dispatch(streamNormalInput(messages));

View file

@ -5,6 +5,7 @@ export default {
transform: {
"\\.[jt]sx?$": ["ts-jest", { useESM: true }],
},
testMatch: ["<rootDir>/src/**/*.test.{js,jsx,ts,tsx}"],
moduleNameMapper: {
"(.+)\\.js": "$1",

View file

@ -1,23 +1,26 @@
{
"name": "@continuedev/openai-adapters",
"version": "1.0.9",
"version": "1.0.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@continuedev/openai-adapters",
"version": "1.0.9",
"version": "1.0.12",
"license": "Apache-2.0",
"dependencies": {
"@azure/openai": "^1.0.0-beta.12",
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.31",
"@continuedev/fetch": "^1.0.3",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^4.76.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/follow-redirects": "^1.14.4",
"@types/json-schema": "^7.0.15",
"cross-env": "^7.0.3",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2"
@ -701,13 +704,23 @@
"peer": true
},
"node_modules/@continuedev/config-types": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.5.tgz",
"integrity": "sha512-Uv3JWKmpgSo9cMhZb2hWoJgR2ezuAn3CenEziWT/5d7mddPLzvuuHgFX6aDjLVVMojS1ul0rpfAd2LGxEb6nDQ==",
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
"dependencies": {
"zod": "^3.23.8"
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.0.31",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.31.tgz",
"integrity": "sha512-HNj+z7UTTARgsJTI0A1buM09fS4HoWVnn6Hbl6kJ2tZmOOm1OgogbcKP68AzHb4fy5H18MWnKS7XuseZpHFzHQ==",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",
"zod": "^3.23.8"
}
},
"node_modules/@continuedev/fetch": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.3.tgz",
@ -1248,6 +1261,12 @@
"@types/istanbul-lib-report": "*"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
"node_modules/@types/node": {
"version": "18.19.39",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz",
@ -3296,6 +3315,11 @@
"dev": true,
"peer": true
},
"node_modules/json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
},
"node_modules/json5": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
@ -4455,6 +4479,17 @@
"dev": true,
"peer": true
},
"node_modules/yaml": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz",
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/yargs": {
"version": "17.7.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/openai-adapters",
"version": "1.0.12",
"version": "1.0.14",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -14,13 +14,16 @@
"dependencies": {
"@azure/openai": "^1.0.0-beta.12",
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.31",
"@continuedev/fetch": "^1.0.3",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^4.76.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/follow-redirects": "^1.14.4",
"@types/json-schema": "^7.0.15",
"cross-env": "^7.0.3",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2"

View file

@ -11,7 +11,7 @@ import {
} from "openai/resources/index";
import { ChatCompletionCreateParams } from "openai/src/resources/index.js";
import { AnthropicConfig } from "../types.js";
import { customFetch } from "../util.js";
import { chatChunk, chatChunkFromDelta, customFetch } from "../util.js";
import {
BaseLlmApi,
CreateRerankResponse,
@ -36,6 +36,7 @@ export class AnthropicApi implements BaseLlmApi {
} else if (typeof oaiBody.stop === "string" && oaiBody.stop.trim() !== "") {
stop = [oaiBody.stop];
}
const anthropicBody = {
messages: this._convertMessages(
oaiBody.messages.filter((msg) => msg.role !== "system"),
@ -47,6 +48,20 @@ export class AnthropicApi implements BaseLlmApi {
model: oaiBody.model,
stop_sequences: stop,
stream: oaiBody.stream,
tools: oaiBody.tools?.map((tool) => ({
name: tool.function.name,
description: tool.function.description,
input_schema: tool.function.parameters,
})),
tool_choice: oaiBody.tool_choice
? {
type: "tool",
name:
typeof oaiBody.tool_choice === "string"
? oaiBody.tool_choice
: oaiBody.tool_choice?.function.name,
}
: undefined,
};
return anthropicBody;
@ -150,26 +165,55 @@ export class AnthropicApi implements BaseLlmApi {
},
);
let lastToolUseId: string | undefined;
let lastToolUseName: string | undefined;
for await (const value of streamSse(response as any)) {
if (value.delta?.text) {
yield {
id: value.id,
object: "chat.completion.chunk",
model: body.model,
created: Date.now(),
choices: [
{
index: 0,
logprobs: undefined,
finish_reason: null,
delta: {
role: "assistant",
// https://docs.anthropic.com/en/api/messages-streaming#event-types
switch (value.type) {
case "content_block_start":
if (value.content_block.type === "tool_use") {
lastToolUseId = value.content_block.id;
lastToolUseName = value.content_block.name;
}
break;
case "content_block_delta":
// https://docs.anthropic.com/en/api/messages-streaming#delta-types
switch (value.delta.type) {
case "text_delta":
yield chatChunk({
content: value.delta.text,
},
},
],
usage: undefined,
};
model: body.model,
});
break;
case "input_json_delta":
if (!lastToolUseId || !lastToolUseName) {
throw new Error("No tool use found");
}
yield chatChunkFromDelta({
model: body.model,
delta: {
tool_calls: [
{
id: lastToolUseId,
type: "function",
index: 0,
function: {
name: lastToolUseName,
arguments: value.delta.partial_json,
},
},
],
},
});
break;
}
break;
case "content_block_stop":
lastToolUseId = undefined;
lastToolUseName = undefined;
break;
default:
break;
}
}
}

View file

@ -15,7 +15,13 @@ import {
} from "openai/resources/index";
import { GeminiConfig } from "../types.js";
import { customFetch, embedding } from "../util.js";
import {
chatChunk,
chatChunkFromDelta,
customFetch,
embedding,
} from "../util.js";
import { GeminiToolFunctionDeclaration } from "../util/gemini-types.js";
import {
BaseLlmApi,
CreateRerankResponse,
@ -101,7 +107,7 @@ export class GeminiApi implements BaseLlmApi {
.filter((c) => c !== null);
const sysMsg = oaiBody.messages.find((msg) => msg.role === "system");
const finalBody = {
const finalBody: any = {
generationConfig,
contents,
// if this.systemMessage is defined, reformat it for Gemini API
@ -110,6 +116,90 @@ export class GeminiApi implements BaseLlmApi {
systemInstruction: { parts: [{ text: sysMsg.content }] },
}),
};
if (!isV1API) {
// Convert and add tools if present
if (oaiBody.tools?.length) {
// Choosing to map all tools to the functionDeclarations of one tool
// Rather than map each tool to its own tool + functionDeclaration
// Same difference
const functions: GeminiToolFunctionDeclaration[] = [];
oaiBody.tools.forEach((tool) => {
if (tool.function.description && tool.function.name) {
const fn: GeminiToolFunctionDeclaration = {
description: tool.function.description,
name: tool.function.name,
};
if (
tool.function.parameters &&
"type" in tool.function.parameters
// && typeof tool.function.parameters.type === "string"
) {
if (tool.function.parameters.type === "object") {
// Gemini can't take an empty object
// So if empty object param is present just don't add parameters
if (
JSON.stringify(tool.function.parameters.properties) === "{}"
) {
functions.push(fn);
return;
}
}
// Helper function to recursively clean JSON Schema objects
const cleanJsonSchema = (schema: any): any => {
if (!schema || typeof schema !== "object") return schema;
if (Array.isArray(schema)) {
return schema.map(cleanJsonSchema);
}
const {
$schema,
additionalProperties,
default: defaultValue,
...rest
} = schema;
// Recursively clean nested properties
if (rest.properties) {
rest.properties = Object.entries(rest.properties).reduce(
(acc, [key, value]) => ({
...acc,
[key]: cleanJsonSchema(value),
}),
{},
);
}
// Clean items in arrays
if (rest.items) {
rest.items = cleanJsonSchema(rest.items);
}
return rest;
};
// Clean the parameters and convert type to uppercase
const cleanedParams = cleanJsonSchema(tool.function.parameters);
fn.parameters = {
...cleanedParams,
type: (tool.function.parameters as any)?.type?.toUpperCase(),
};
}
functions.push(fn);
}
});
if (functions.length) {
finalBody.tools = [
{
functionDeclarations: functions,
},
];
}
}
}
return finalBody;
}
@ -190,28 +280,35 @@ export class GeminiApi implements BaseLlmApi {
if (data.error) {
throw new Error(data.error.message);
}
// Check for existence of each level before accessing the final 'text' property
if (data?.candidates?.[0]?.content?.parts?.[0]?.text) {
yield {
id: "",
object: "chat.completion.chunk",
model: body.model,
created: Date.now(),
choices: [
{
index: 0,
logprobs: undefined,
finish_reason: null,
const content = data?.candidates?.[0]?.content;
if (content) {
for (const part of content.parts) {
if ("text" in part) {
yield chatChunk({
content: part.text,
model: body.model,
});
} else if ("functionCall" in part) {
yield chatChunkFromDelta({
model: body.model,
delta: {
role: "assistant",
content: data.candidates[0].content.parts[0].text,
tool_calls: [
{
index: 0,
id: "", // Not supported by Gemini
type: "function",
function: {
name: part.functionCall.name,
arguments: JSON.stringify(part.functionCall.args),
},
},
],
},
},
],
usage: undefined,
};
});
}
}
} else {
// Handle the case where the expected data structure is not found
console.warn("Unexpected response format:", data);
}
}

View file

@ -0,0 +1,110 @@
import { ModelConfig } from "@continuedev/config-yaml";
import * as dotenv from "dotenv";
import { getLlmApi, testChat, testCompletion, testEmbed } from "./util.js";
dotenv.config();
function testConfig(config: ModelConfig) {
const model = config.model;
const api = getLlmApi({
provider: config.provider as any,
apiKey: config.apiKey,
apiBase: config.apiBase,
});
if (false) {
testCompletion(api, model);
}
if (
["chat", "summarize", "edit", "apply"].some((role) =>
config.roles?.includes(role as any),
)
) {
testChat(api, model);
}
if (config.roles?.includes("embed")) {
testEmbed(api, model);
}
if (config.roles?.includes("embed")) {
testEmbed(api, model);
}
}
const TESTS: Omit<ModelConfig, "name">[] = [
{
provider: "openai",
model: "gpt-4o",
apiKey: process.env.OPENAI_API_KEY!,
roles: ["chat"],
},
{
provider: "anthropic",
model: "claude-3-5-haiku-latest",
apiKey: process.env.ANTHROPIC_API_KEY!,
roles: ["chat"],
},
{
provider: "gemini",
model: "gemini-1.5-flash-latest",
apiKey: process.env.GEMINI_API_KEY!,
roles: ["chat"],
},
{
provider: "mistral",
model: "codestral-latest",
apiKey: process.env.MISTRAL_API_KEY!,
apiBase: "https://api.mistral.ai/v1",
roles: ["autocomplete"],
},
{
provider: "deepseek",
model: "deepseek-coder",
apiKey: process.env.DEEPSEEK_API_KEY!,
roles: ["autocomplete"],
},
{
provider: "openai",
model: "text-embedding-3-small",
apiKey: process.env.OPENAI_API_KEY!,
roles: ["embed"],
},
{
provider: "voyage",
model: "voyage-code-3",
apiKey: process.env.VOYAGE_API_KEY!,
roles: ["embed"],
},
// {
// provider: "cohere",
// model: "embed-english-v3.0",
// apiKey: process.env.COHERE_API_KEY!,
// roles: ["embed"],
// },
// {
// provider: "gemini",
// model: "models/text-embedding-004",
// apiKey: process.env.GEMINI_API_KEY!,
// roles: ["embed"],
// },
{
provider: "voyage",
model: "rerank-lite-1",
apiKey: process.env.VOYAGE_API_KEY!,
roles: ["rerank"],
},
// {
// provider: "cohere",
// model: "rerank-english-v3.0",
// apiKey: process.env.COHERE_API_KEY!,
// roles: ["rerank"],
// },
];
TESTS.forEach((config) => {
describe(`${config.provider}/${config.model}`, () => {
testConfig({ name: config.model, ...config });
});
});

View file

@ -0,0 +1,301 @@
import { BaseLlmApi, constructLlmApi } from "../index.js";
import { LLMConfig } from "../types.js";
export function getLlmApi(config: LLMConfig) {
const api = constructLlmApi(config);
if (!api) {
throw new Error("Failed to construct LLM");
}
return api;
}
export function testEmbed(api: BaseLlmApi, model: string) {
test("should successfully embed", async () => {
const response = await api.embed({
model,
input: ["This is a test", "Hello world!"],
});
expect(response.model).toBe(model);
expect(response.object).toBe("list");
expect(response.data.length).toEqual(2);
response.data.forEach((val, index) => {
expect(val.index).toBe(index);
expect(val.object).toBe("embedding");
expect(val.embedding.some((v) => typeof v !== "number")).toBe(false);
});
});
}
export function testRerank(api: BaseLlmApi, model: string) {
test("should successfully rerank", async () => {
const response = await api.rerank({
model: model,
query: "What is the capital of spain?",
documents: [
"The capital of spain is Madrid",
"The largest breed of dog is the Great Dane",
],
});
expect(response.model).toBe(model);
expect(response.object).toBe("list");
expect(response.data.length).toEqual(2);
response.data.forEach((val, index) => {
expect(val.index).toBe(index);
expect(typeof val.relevance_score).toBe("number");
});
expect(response.data[0].relevance_score).toBeGreaterThan(
response.data[1].relevance_score,
);
});
}
export function testFim(api: BaseLlmApi, model: string) {
test("should successfully fim", async () => {
const response = api.fimStream(
{
model: model,
prompt: "This is a ",
suffix: " .",
stream: true,
},
new AbortController().signal,
);
let completion = "";
for await (const result of response) {
expect(result.choices.length).toBeGreaterThan(0);
expect(typeof result.choices[0].delta.content).toBe("string");
completion += result.choices[0].delta.content;
}
expect(completion.length).toBeGreaterThan(0);
});
}
export function testChat(api: BaseLlmApi, model: string) {
test("should successfully stream chat", async () => {
const stream = api.chatCompletionStream(
{
model,
messages: [{ role: "user", content: "Hello! Who are you?" }],
stream: true,
},
new AbortController().signal,
);
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully stream multi-part chat with empty text", async () => {
const stream = api.chatCompletionStream(
{
model,
messages: [
{
role: "user",
content: [
{
type: "text",
text: "Hello! Who are you?",
},
{
// @ts-ignore
type: "text",
text: "",
},
],
},
],
stream: true,
},
new AbortController().signal,
);
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test.skip("should successfully stream multi-part chat with image", async () => {
const stream = api.chatCompletionStream(
{
model,
messages: [
{
role: "user",
content: [
{
type: "text",
text: "Hello! Who are you?",
},
{
// @ts-ignore
type: "image_url",
image_url: {
url: "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png",
detail: "low",
},
},
],
},
],
stream: true,
},
new AbortController().signal,
);
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully non-stream chat", async () => {
const response = await api.chatCompletionNonStream(
{
model,
messages: [{ role: "user", content: "Hello! Who are you?" }],
stream: false,
},
new AbortController().signal,
);
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].message.content;
expect(typeof completion).toBe("string");
expect(completion?.length).toBeGreaterThan(0);
});
test("should acknowledge system message in chat", async () => {
const response = await api.chatCompletionNonStream(
{
model,
messages: [
{
role: "system",
content:
"Regardless of what is asked of you, your answer should start with 'RESPONSE: '.",
},
{ role: "user", content: "Who are you?" },
],
stream: false,
},
new AbortController().signal,
);
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].message.content;
expect(typeof completion).toBe("string");
expect(completion?.length).toBeGreaterThan(0);
expect(completion?.startsWith("RESPONSE: ")).toBe(true);
});
test("Tool Call works", async () => {
let args = "";
let isFirstChunk = true;
for await (const chunk of api.chatCompletionStream(
{
messages: [
{
role: "user",
content:
"Hi, my name is Nate. Please call the say_hello function to respond to me.",
},
],
tools: [
{
function: {
name: "say_hello",
description: "Say Hello",
parameters: {
type: "object",
properties: {
name: {
type: "string",
description: "The name of the person to greet",
},
},
},
},
type: "function",
},
],
tool_choice: {
type: "function",
function: {
name: "say_hello",
},
},
stream: true,
model,
},
new AbortController().signal,
)) {
const toolCall = chunk.choices[0].delta.tool_calls?.[0];
if (!toolCall) {
continue;
}
args += toolCall.function?.arguments ?? "";
expect(chunk.choices[0].delta.tool_calls).toHaveLength(1);
if (isFirstChunk) {
isFirstChunk = false;
expect(toolCall.id).toBeDefined();
expect(toolCall.function!.name).toBe("say_hello");
}
}
const parsedArgs = JSON.parse(args);
expect(parsedArgs.name).toBe("Nate");
});
}
export function testCompletion(api: BaseLlmApi, model: string) {
test("should successfully stream complete", async () => {
const stream = api.completionStream(
{
model: model,
prompt: "Hello! Who are you?",
stream: true,
},
new AbortController().signal,
);
let completion = "";
for await (const result of stream) {
completion += result.choices[0].text ?? "";
expect(typeof result.choices[0].text).toBe("string");
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully non-stream complete", async () => {
const response = await api.completionNonStream(
{
model,
prompt: "Hello! Who are you?",
stream: false,
},
new AbortController().signal,
);
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].text;
expect(typeof completion).toBe("string");
expect(completion.length).toBeGreaterThan(0);
});
}

View file

@ -37,6 +37,30 @@ export function chatChunk(options: {
};
}
export function chatChunkFromDelta(options: {
delta: ChatCompletionChunk.Choice["delta"];
model: string;
finish_reason?: ChatCompletionChunk.Choice["finish_reason"];
id?: string | null;
usage?: CompletionUsage;
}): ChatCompletionChunk {
return {
choices: [
{
delta: options.delta,
finish_reason: options.finish_reason ?? "stop",
index: 0,
logprobs: null,
},
],
usage: options.usage,
created: Date.now(),
id: options.id ?? "",
model: options.model,
object: "chat.completion.chunk",
};
}
export function chatCompletion(options: {
content: string | null | undefined;
model: string;

View file

@ -0,0 +1,268 @@
import { JSONSchema7Object } from "json-schema";
// https://ai.google.dev/api/generate-content
export interface GeminiGenerationConfig {
stopSequences?: string[];
responseMimeType?: string;
candidateCount?: number;
maxOutputTokens?: number;
temperature?: number;
topP?: number;
topK?: number;
presencePenalty?: number;
frequencyPenalty?: number;
responseLogprobs?: boolean;
logprobs?: number;
// responseSchema?: object; // https://ai.google.dev/api/caching#Schema
}
export interface GeminiFunctionSchema {
type:
| "TYPE_UNSPECIFIED"
| "STRING"
| "NUMBER"
| "INTEGER"
| "BOOLEAN"
| "ARRAY"
| "OBJECT";
format?: string;
description?: string;
nullable?: boolean;
enum?: string[];
maxItems?: string;
minItems?: string;
properties?: Record<string, GeminiFunctionSchema>;
required?: string[];
items?: GeminiFunctionSchema;
}
export type GeminiChatContentPart =
| {
text: string;
}
| {
inlineData: {
mimeType: string;
data: string;
};
}
| {
functionCall: {
name: string;
args: JSONSchema7Object;
};
}
| {
functionResponse: {
name: string;
response: JSONSchema7Object;
};
}
| {
fileData: {
fileUri: string;
mimeType: string; // See possible values here: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#filedata
};
}
| {
executableCode: {
language: "PYTHON" | "LANGUAGE_UNSPECIFIED";
code: string;
};
}
| {
codeExecutionResult: {
outcome:
| "OUTCOME_UNSPECIFIED"
| "OUTCOME_OK"
| "OUTCOME_FAILED"
| "OUTCOME_DEADLINE_EXCEEDED";
output: string;
};
};
export interface GeminiChatContent {
role?: "user" | "model";
parts: GeminiChatContentPart[];
}
export interface GeminiToolFunctionDeclaration {
name: string;
description: string;
parameters?: GeminiFunctionSchema;
}
export interface GeminiTool {
functionDeclarations?: GeminiToolFunctionDeclaration[];
googleSearchRetrieval?: {
dynamicRetrievalConfig: {
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
dynamicThreshold?: number;
};
};
codeExecution?: {};
}
export interface GeminiToolConfig {
functionCallingConfig?: {
mode?: "NONE" | "ANY" | "AUTO";
allowedFunctionNames?: string[];
};
}
// https://ai.google.dev/api/generate-content#request-body
export interface GeminiChatRequestBody {
contents: GeminiChatContent[];
tools?: GeminiTool[];
toolConfig?: GeminiToolConfig;
systemInstruction?: GeminiChatContent;
generationConfig?: GeminiGenerationConfig;
// cachedContent?: string;
}
export interface GeminiChatResponseSuccess {
candidates: Candidate[];
promptFeedback: PromptFeedback;
usageMetadata: UsageMetadata;
}
export interface GeminiChatResponseError {
error: {
message: string;
};
}
export type GeminiChatResponse =
| GeminiChatResponseError
| GeminiChatResponseSuccess;
interface PromptFeedback {
blockReason?: BlockReason;
safetyRatings: SafetyRating[];
}
enum BlockReason {
BLOCK_REASON_UNSPECIFIED = "BLOCK_REASON_UNSPECIFIED",
SAFETY = "SAFETY",
OTHER = "OTHER",
BLOCKLIST = "BLOCKLIST",
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
}
interface SafetyRating {
harmCategory: HarmCategory;
harmProbability: HarmProbability;
blocked: boolean;
}
enum HarmCategory {
HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED",
HARM_CATEGORY_DEROGATORY = "HARM_CATEGORY_DEROGATORY",
HARM_CATEGORY_TOXICITY = "HARM_CATEGORY_TOXICITY",
HARM_CATEGORY_VIOLENCE = "HARM_CATEGORY_VIOLENCE",
HARM_CATEGORY_SEXUAL = "HARM_CATEGORY_SEXUAL",
HARM_CATEGORY_MEDICAL = "HARM_CATEGORY_MEDICAL",
HARM_CATEGORY_DANGEROUS = "HARM_CATEGORY_DANGEROUS",
HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY",
}
enum HarmProbability {
HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED",
NEGLIGIBLE = "NEGLIGIBLE",
LOW = "LOW",
MEDIUM = "MEDIUM",
HIGH = "HIGH",
}
interface UsageMetadata {
promptTokenCount: number;
cachedContentTokenCount: number;
candidatesTokenCount: number;
totalTokenCount: number;
}
interface Candidate {
content: GeminiChatContent;
finishReason: FinishReason;
safetyRatings: SafetyRating[];
tokenCount: number;
groundingAttribution?: GroundingAttribution;
groundingMetadata?: GroundingMetadata;
avgLogprobs?: number;
logprobs?: LogprobsResult;
index: number;
}
enum FinishReason {
FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED",
STOP = "STOP",
MAX_TOKENS = "MAX_TOKENS",
SAFETY = "SAFETY",
RECITATION = "RECITATION",
LANGUAGE = "LANGUAGE",
OTHER = "OTHER",
BLOCKLIST = "BLOCKLIST",
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
SPII = "SPII",
MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
}
interface GroundingAttribution {
attributionSourceId: AttributionSourceId;
groundingSourceContent: string;
}
interface AttributionSourceId {
groundingPassage?: GroundingPassageId;
semanticRetrieverChunk?: SemanticRetrieverChunk;
}
interface GroundingPassageId {
passageId: string;
partIndex: number;
}
interface SemanticRetrieverChunk {
source: string;
chunk: string;
}
interface GroundingMetadata {
groundingSupport?: GroundingSupport[];
webSearchQueries?: string[];
searchEntryPoint?: SearchEntryPoint;
retrievalMetadata?: RetrievalMetadata;
}
interface SearchEntryPoint {
renderedContent?: string;
sdkBlob?: string;
}
interface RetrievalMetadata {
googleSearchDynamicRetrievalScore?: number;
}
interface GroundingSupport {
groundingChunkIndices: number[];
confidenceScores: number[];
segment: Segment;
}
interface Segment {
partIndex: number;
startIndex: number;
endIndex: number;
text: string;
}
interface LogprobsResult {
topCandidates: TopCandidates[];
chosenCandidates: Candidate[];
}
interface TopCandidates {
candidates: Candidate[];
}

View file

@ -1,380 +0,0 @@
import * as dotenv from "dotenv";
import { constructLlmApi, LlmApiConfig } from "../src/index.js";
dotenv.config();
function testEmbed(config: LlmApiConfig) {
test("should successfully embed", async () => {
const api = constructLlmApi(config);
const response = await api.embed({
model: config.model,
input: ["This is a test", "Hello world!"],
});
expect(response.model).toBe(config.model);
expect(response.object).toBe("list");
expect(response.data.length).toEqual(2);
response.data.forEach((val, index) => {
expect(val.index).toBe(index);
expect(val.object).toBe("embedding");
expect(val.embedding.some((v) => typeof v !== "number")).toBe(false);
});
});
}
function testRerank(config: LlmApiConfig) {
test("should successfully rerank", async () => {
const api = constructLlmApi(config);
const response = await api.rerank({
model: config.model,
query: "What is the capital of spain?",
documents: [
"The capital of spain is Madrid",
"The largest breed of dog is the Great Dane",
],
});
expect(response.model).toBe(config.model);
expect(response.object).toBe("list");
expect(response.data.length).toEqual(2);
response.data.forEach((val, index) => {
expect(val.index).toBe(index);
expect(typeof val.relevance_score).toBe("number");
});
expect(response.data[0].relevance_score).toBeGreaterThan(
response.data[1].relevance_score,
);
});
}
function testFim(config: LlmApiConfig) {
test("should successfully fim", async () => {
const api = constructLlmApi(config);
const response = api.fimStream({
model: config.model,
prompt: "This is a ",
suffix: " .",
stream: true,
});
let completion = "";
for await (const result of response) {
expect(result.choices.length).toBeGreaterThan(0);
expect(typeof result.choices[0].delta.content).toBe("string");
completion += result.choices[0].delta.content;
}
expect(completion.length).toBeGreaterThan(0);
});
}
function testConfig(config: LlmApiConfig, chatOnly: boolean = false) {
const api = constructLlmApi(config);
if (!chatOnly) {
test("should successfully stream complete", async () => {
const stream = api.completionStream({
model: config.model,
prompt: "Hello! Who are you?",
stream: true,
});
let completion = "";
for await (const result of stream) {
completion += result.choices[0].text ?? "";
expect(typeof result.choices[0].text).toBe("string");
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully non-stream complete", async () => {
const response = await api.completionNonStream({
model: config.model,
prompt: "Hello! Who are you?",
stream: false,
});
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].text;
expect(typeof completion).toBe("string");
expect(completion.length).toBeGreaterThan(0);
});
}
test("should successfully stream chat", async () => {
const stream = api.chatCompletionStream({
model: config.model,
messages: [{ role: "user", content: "Hello! Who are you?" }],
stream: true,
});
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully stream multi-part chat with empty text", async () => {
const stream = api.chatCompletionStream({
model: config.model,
messages: [
{
role: "user",
content: [
{
type: "text",
text: "Hello! Who are you?",
},
{
// @ts-ignore
type: "text",
text: "",
},
],
},
],
stream: true,
});
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test.skip("should successfully stream multi-part chat with image", async () => {
const stream = api.chatCompletionStream({
model: config.model,
messages: [
{
role: "user",
content: [
{
type: "text",
text: "Hello! Who are you?",
},
{
// @ts-ignore
type: "image_url",
imageUrl: {
url: "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png",
detail: "low",
},
},
],
},
],
stream: true,
});
let completion = "";
for await (const result of stream) {
completion += result.choices[0].delta.content ?? "";
expect(result.choices.length).toBeGreaterThan(0);
}
expect(completion.length).toBeGreaterThan(0);
});
test("should successfully non-stream chat", async () => {
const response = await api.chatCompletionNonStream({
model: config.model,
messages: [{ role: "user", content: "Hello! Who are you?" }],
stream: false,
});
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].message.content;
expect(typeof completion).toBe("string");
expect(completion?.length).toBeGreaterThan(0);
});
test("should acknowledge system message in chat", async () => {
const response = await api.chatCompletionNonStream({
model: config.model,
messages: [
{
role: "system",
content:
"Regardless of what is asked of you, your answer should start with 'RESPONSE: '.",
},
{ role: "user", content: "Who are you?" },
],
stream: false,
});
expect(response.choices.length).toBeGreaterThan(0);
const completion = response.choices[0].message.content;
expect(typeof completion).toBe("string");
expect(completion?.length).toBeGreaterThan(0);
expect(completion?.startsWith("RESPONSE: ")).toBe(true);
});
}
const COMPLETION_TESTS: ({ chatOnly?: boolean } & LlmApiConfig)[] = [
{
provider: "openai",
model: "gpt-4o-mini",
apiKey: process.env.OPENAI_API_KEY!,
chatOnly: true,
},
{
provider: "anthropic",
model: "claude-3-haiku-20240307",
apiKey: process.env.ANTHROPIC_API_KEY!,
chatOnly: true,
},
{
provider: "gemini",
model: "gemini-1.5-flash-latest",
apiKey: process.env.GEMINI_API_KEY!,
chatOnly: true,
},
{
provider: "cohere",
model: "command-r",
apiKey: process.env.COHERE_API_KEY!,
chatOnly: true,
},
{
provider: "fireworks",
model: "accounts/fireworks/models/llama-v3p1-8b-instruct",
apiKey: process.env.FIREWORKS_API_KEY!,
chatOnly: true,
},
{
provider: "groq",
model: "llama3-8b-8192",
apiKey: process.env.GROQ_API_KEY!,
chatOnly: true,
},
{
provider: "deepinfra",
model: "meta-llama/Meta-Llama-3.1-8B-Instruct",
apiKey: process.env.DEEP_INFRA_API_KEY!,
chatOnly: true,
},
{
provider: "together",
model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
apiKey: process.env.TOGETHER_API_KEY!,
chatOnly: true,
},
{
provider: "novita",
model: "meta-llama/llama-3.1-8b-instruct",
apiKey: process.env.NOVITA_API_KEY!,
chatOnly: true,
},
{
provider: "sambanova",
model: "Meta-Llama-3.1-8B-Instruct",
apiKey: process.env.SAMBANOVA_API_KEY!,
chatOnly: true,
},
{
provider: "nebius",
model: "llama3.1-8b",
apiKey: process.env.NEBIUS_API_KEY!,
chatOnly: true,
},
{
provider: "scaleway",
model: "llama3.1-8b",
apiKey: process.env.SCALEWAY_API_KEY!,
chatOnly: true,
},
];
const FIM_TESTS: LlmApiConfig[] = [
{
provider: "openai",
model: "codestral-latest",
apiKey: process.env.MISTRAL_API_KEY!,
apiBase: "https://api.mistral.ai/v1",
},
{
provider: "deepseek",
model: "deepseek-coder",
apiKey: process.env.DEEPSEEK_API_KEY!,
},
];
const EMBEDDINGS_TESTS: LlmApiConfig[] = [
{
provider: "openai",
model: "text-embedding-3-small",
apiKey: process.env.OPENAI_API_KEY!,
},
{
provider: "openai",
model: "voyage-code-3",
apiKey: process.env.VOYAGE_API_KEY!,
apiBase: "https://api.voyageai.com/v1/",
},
{
provider: "cohere",
model: "embed-english-v3.0",
apiKey: process.env.COHERE_API_KEY!,
},
{
provider: "gemini",
model: "models/text-embedding-004",
apiKey: process.env.GEMINI_API_KEY!,
},
{
provider: "nebius",
model: "BAAI/bge-en-icl",
apiKey: process.env.NEBIUS_API_KEY!,
},
{
provider: "scaleway",
model: "bge-multilingual-gemma2",
apiKey: process.env.SCALEWAY_API_KEY!,
},
];
const RERANK_TESTS: LlmApiConfig[] = [
{
provider: "openai",
model: "rerank-lite-1",
apiKey: process.env.VOYAGE_API_KEY!,
apiBase: "https://api.voyageai.com/v1/",
},
{
provider: "cohere",
model: "rerank-english-v3.0",
apiKey: process.env.COHERE_API_KEY!,
},
{
provider: "jina",
model: "jina-reranker-v2-base-multilingual",
apiKey: process.env.JINA_API_KEY!,
},
];
describe("should successfully call all adapters", () => {
COMPLETION_TESTS.forEach((config) => {
const { chatOnly, ...rest } = config;
testConfig(rest, chatOnly);
});
EMBEDDINGS_TESTS.forEach((config) => {
testEmbed(config);
});
RERANK_TESTS.forEach((config) => {
testRerank(config);
});
FIM_TESTS.forEach((config) => {
testFim(config);
});
});