First draft for an API to add models from other VSCode extensions. #827
+224
−37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proof of concept draft for feature request #803
Exports functions "addExtensionModel" and "removeExtensionModel" through the VSCode extension API.
addExtensionModel
accepts aCustomLLM
object, as well as callbacks to the third-party extension to be notified when the model is added and removed.Added field
extensionModels
toContinueConfig
, which holds theCustomLLM
model specifications for models added by extensions. This field is not serialized toconfig.json
. Config loading routines are adadpted to constructCustomLLMClass
instances from all models declared inextensionModels
and add them tomodels
.Also reworked
vscode/src/loadConfig.ts:ConfigHandler
to keep track of extension models on the VSCode extension side and improve configuration update event handling generally.There seems to have been a bug/leak in earlier code where models removed by the user where removed in the webview / continue server configuration but not in the configuration object held by the VSCode extension:
debugPanels
handler fordeleteModel
would not remove the model from the config object and not trigger a config reload. This should be resolved by the changes.Not sure if this would be the best way to handle this - it feels a bit hacky and there might be a better way to keep track of the extension models. The whole interaction of extension code with continue server(?)/webview code appears quite complex and I have missed a better way. Please consider this a proof of concept draft - any feedback welcome.