Merge pull request #4846 from continuedev/nate/llm-info-fix
llm-info fix
This commit is contained in:
commit
de7fab4dc9
9 changed files with 33 additions and 20 deletions
|
|
@ -177,7 +177,11 @@ export abstract class BaseLLM implements ILLM {
|
|||
|
||||
this.model = options.model;
|
||||
// Use @continuedev/llm-info package to autodetect certain parameters
|
||||
const llmInfo = findLlmInfo(this.model);
|
||||
const modelSearchString =
|
||||
this.providerName === "continue-proxy"
|
||||
? this.model?.split("/").pop() || this.model
|
||||
: this.model;
|
||||
const llmInfo = findLlmInfo(modelSearchString);
|
||||
|
||||
const templateType =
|
||||
options.template ?? autodetectTemplateType(options.model);
|
||||
|
|
@ -195,11 +199,11 @@ export abstract class BaseLLM implements ILLM {
|
|||
options.completionOptions?.maxTokens ??
|
||||
(llmInfo?.maxCompletionTokens
|
||||
? Math.min(
|
||||
llmInfo.maxCompletionTokens,
|
||||
// Even if the model has a large maxTokens, we don't want to use that every time,
|
||||
// because it takes away from the context length
|
||||
this.contextLength / 4,
|
||||
)
|
||||
llmInfo.maxCompletionTokens,
|
||||
// Even if the model has a large maxTokens, we don't want to use that every time,
|
||||
// because it takes away from the context length
|
||||
this.contextLength / 4,
|
||||
)
|
||||
: DEFAULT_MAX_TOKENS),
|
||||
};
|
||||
this.requestOptions = options.requestOptions;
|
||||
|
|
@ -840,7 +844,6 @@ export abstract class BaseLLM implements ILLM {
|
|||
signal,
|
||||
completionOptions,
|
||||
)) {
|
||||
|
||||
if (chunk.role === "assistant") {
|
||||
completion += chunk.content;
|
||||
yield chunk;
|
||||
|
|
@ -948,7 +951,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
);
|
||||
}
|
||||
|
||||
protected async * _streamComplete(
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
signal: AbortSignal,
|
||||
options: CompletionOptions,
|
||||
|
|
@ -956,7 +959,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
protected async * _streamChat(
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
signal: AbortSignal,
|
||||
options: CompletionOptions,
|
||||
|
|
|
|||
8
core/package-lock.json
generated
8
core/package-lock.json
generated
|
|
@ -15,7 +15,7 @@
|
|||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.67",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/openai-adapters": "^1.0.18",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
@ -2996,9 +2996,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/llm-info": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/llm-info/-/llm-info-1.0.7.tgz",
|
||||
"integrity": "sha512-MyYmP4tbTzOnlT6hItC9tFkVZpYkaAg45AUXqdXzEfZhz8ZWpaiN8jZ789KLVmq+NKqhMUbKAHIZUUY1d39eRw=="
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/llm-info/-/llm-info-1.0.8.tgz",
|
||||
"integrity": "sha512-/htL7p4li3zQSwn9bXkI23WRpZNklWTPzRSSG3Fd5gvYW8cizjhlf7OzeDdKxBfi1S0lpqMm0VwHlx3KjMKLpw=="
|
||||
},
|
||||
"node_modules/@continuedev/openai-adapters": {
|
||||
"version": "1.0.18",
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.67",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/openai-adapters": "^1.0.18",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension
|
|||
pluginName=continue-intellij-extension
|
||||
pluginRepositoryUrl=https://github.com/continuedev/continue
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion=1.0.7
|
||||
pluginVersion=1.0.8
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild=223
|
||||
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
|
||||
|
|
|
|||
2
extensions/vscode/package-lock.json
generated
2
extensions/vscode/package-lock.json
generated
|
|
@ -108,7 +108,7 @@
|
|||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.67",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/openai-adapters": "^1.0.18",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "1.1.16",
|
||||
"version": "1.1.17",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
|
|||
2
gui/package-lock.json
generated
2
gui/package-lock.json
generated
|
|
@ -113,7 +113,7 @@
|
|||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.67",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/openai-adapters": "^1.0.18",
|
||||
"@modelcontextprotocol/sdk": "^1.5.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@continuedev/llm-info",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,17 @@ export const Anthropic: ModelProvider = {
|
|||
maxCompletionTokens: 8192,
|
||||
description:
|
||||
"Most intelligent model with the highest level of intelligence and capability.",
|
||||
regex: /claude-3\.5-sonnet/i,
|
||||
regex: /claude-3[.-]5-sonnet.*/i,
|
||||
recommendedFor: ["chat"],
|
||||
},
|
||||
{
|
||||
model: "claude-3-7-sonnet-latest",
|
||||
displayName: "Claude 3.7 Sonnet",
|
||||
contextLength: 200000,
|
||||
maxCompletionTokens: 8192,
|
||||
description:
|
||||
"Most intelligent model with the highest level of intelligence and capability.",
|
||||
regex: /claude-3[.-]7-sonnet.*/i,
|
||||
recommendedFor: ["chat"],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue