Skip to content

Commit

Permalink
development > main (#349)
Browse files Browse the repository at this point in the history
* updates and other things

* 3.17.28
  • Loading branch information
rjmacarthy authored Oct 16, 2024
1 parent 693a6de commit 6d609d2
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 155 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 30 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "twinny",
"displayName": "twinny - AI Code Completion and Chat",
"description": "Locally hosted AI code completion plugin for vscode",
"version": "3.17.27",
"version": "3.17.28",
"icon": "assets/icon.png",
"keywords": [
"code-inference",
Expand Down Expand Up @@ -107,30 +107,25 @@
"group": "navigation@4",
"when": "view == twinny.sidebar"
},
{
"command": "twinny.templates",
"when": "view == twinny.sidebar",
"group": "navigation@5"
},
{
"command": "twinny.conversationHistory",
"when": "view == twinny.sidebar",
"group": "navigation@6"
"group": "navigation@5"
},
{
"command": "twinny.openPanelChat",
"when": "view == twinny.sidebar",
"group": "navigation@7"
"group": "navigation@6"
},
{
"command": "twinny.newConversation",
"when": "view == twinny.sidebar",
"group": "navigation@8"
"group": "navigation@7"
},
{
"command": "twinny.settings",
"when": "view == twinny.sidebar",
"group": "navigation@9"
"group": "navigation@8"
}
]
},
Expand Down Expand Up @@ -278,7 +273,7 @@
"order": 0,
"type": "boolean",
"default": true,
"description": "Activates or deactivates the Twinny extension."
"markdownDescription": "Toggles the Twinny extension on or off. When `true`, Twinny is active and ready to provide completions."
},
"twinny.enabledLanguages": {
"order": 1,
Expand All @@ -289,40 +284,40 @@
"default": {
"*": true
},
"markdownDescription": "Languages to enable completions with Twinny for. `*` is used as the default."
"markdownDescription": "Specifies which languages to enable completions with Twinny for. Use `*` as the default for all languages. Example:\n```json\n{\n \"*\": true,\n \"python\": true,\n \"javascript\": false\n}\n```"
},
"twinny.autoSuggestEnabled": {
"order": 2,
"type": "boolean",
"default": true,
"description": "Enable automatic completion suggestions, manual trigger (default shortcut Alt+\\)."
"markdownDescription": "When `true`, Twinny will automatically suggest completions. You can still manually trigger completions using the default shortcut (`Alt+\\`)."
},
"twinny.contextLength": {
"order": 3,
"type": "number",
"default": 100,
"description": "Defines the number of lines before and after the current line to include in FIM prompts.",
"markdownDescription": "Specifies how many lines of context (before and after the current line) to include in Fill-in-Middle (FIM) prompts. A higher number provides more context but may slow down completions.",
"required": true
},
"twinny.debounceWait": {
"order": 4,
"type": "number",
"default": 300,
"description": "Delay in milliseconds before triggering the next completion.",
"markdownDescription": "Sets the delay (in milliseconds) before triggering the next completion. This helps reduce API calls and improve performance.",
"required": true
},
"twinny.temperature": {
"order": 5,
"type": "number",
"default": 0.2,
"description": "Sets the model's creativity level (temperature) for generating completions.",
"markdownDescription": "Controls the randomness of the model's output. Lower values (e.g., 0.2) produce more focused and deterministic outputs, while higher values (e.g., 0.8) lead to more diverse and creative completions.",
"required": true
},
"twinny.multilineCompletionsEnabled": {
"order": 6,
"type": "boolean",
"default": true,
"description": "Experimental feature: enables the generation of multi-line completions."
"markdownDescription": "When `true`, Twinny will attempt to generate multi-line completions. This is an experimental feature and may not work perfectly in all scenarios."
},
"twinny.maxLines": {
"dependencies": {
Expand All @@ -331,90 +326,83 @@
"order": 7,
"type": "number",
"default": 30,
"description": "Maximum number of lines to use for multi line completions. Applicable only when multilineCompletionsEnabled is enabled."
"markdownDescription": "Sets the maximum number of lines for multi-line completions. Only applies when `twinny.multilineCompletionsEnabled` is `true`."
},
"twinny.fileContextEnabled": {
"order": 9,
"type": "boolean",
"default": false,
"description": "Enables scanning of neighbouring documents to enhance completion prompts. (Experimental)"
"markdownDescription": "When `true`, Twinny will scan neighboring documents to provide more context for completions. This is an experimental feature and may impact performance."
},
"twinny.completionCacheEnabled": {
"order": 10,
"type": "boolean",
"default": false,
"description": "Caches FIM completions for identical prompts to enhance performance."
"markdownDescription": "Enables caching of Fill-in-Middle (FIM) completions for identical prompts. This can significantly improve performance but may use more memory."
},
"twinny.numPredictChat": {
"order": 11,
"type": "number",
"default": 512,
"description": "Maximum token limit for chat completions.",
"markdownDescription": "Sets the maximum number of tokens to generate for chat completions. Higher values allow for longer completions but may increase response time.",
"required": true
},
"twinny.numPredictFim": {
"order": 12,
"type": "number",
"default": 512,
"description": "Maximum token limit for FIM completions. Set to -1 for no limit. Twinny should stop at logical line breaks.",
"markdownDescription": "Defines the maximum number of tokens for Fill-in-Middle (FIM) completions. Use `-1` for no limit. Twinny will attempt to stop at logical line breaks regardless of this setting.",
"required": true
},
"twinny.enableSubsequentCompletions": {
"order": 13,
"type": "boolean",
"default": true,
"description": "Enable this setting to allow twinny to keep making subsequent completion requests to the API after the last completion request was accepted."
"markdownDescription": "When `true`, Twinny will continue to make completion requests to the API after the previous completion was accepted. This can provide a more fluid completion experience."
},
"twinny.ollamaHostname": {
"order": 14,
"type": "string",
"default": "0.0.0.0",
"description": "Hostname for Ollama API.",
"markdownDescription": "Specifies the hostname for the Ollama API. Use `0.0.0.0` for localhost or provide a specific IP address or domain name.",
"required": true
},
"twinny.ollamaApiPort": {
"order": 15,
"type": "number",
"default": 11434,
"description": "The API port usually `11434`",
"required": false
},
"twinny.embeddingModel": {
"order": 16,
"type": "string",
"default": "nomic-embed-text",
"description": "The embedding model to use (Ollama only)",
"markdownDescription": "Sets the port number for the Ollama API. The default is `11434`, but you can change it if your Ollama instance uses a different port.",
"required": false
},
"twinny.keepAlive": {
"order": 17,
"order": 16,
"type": "string",
"default": "5m",
"description": "Keep models in memory by making requests with keep_alive=-1. Applicable only for Ollama API."
"markdownDescription": "Sets the duration to keep models in memory for Ollama API. Use formats like `5m` for 5 minutes or `1h` for 1 hour. Set to `-1` to keep models in memory indefinitely."
},
"twinny.ollamaUseTls": {
"order": 18,
"order": 17,
"type": "boolean",
"default": false,
"description": "Enables TLS encryption Ollama API connections."
"markdownDescription": "When `true`, Twinny will use TLS encryption for connections to the Ollama API. Ensure your Ollama instance is configured for TLS before enabling this option."
},
"twinny.enableLogging": {
"order": 19,
"order": 18,
"type": "boolean",
"default": true,
"description": "Enable twinny debug mode"
"markdownDescription": "Activates debug logging for Twinny. When `true`, Twinny will output detailed logs, which can be helpful for troubleshooting."
},
"twinny.symmetryServerKey": {
"order": 20,
"order": 19,
"type": "string",
"description": "The symmetry master server key.",
"markdownDescription": "Sets the symmetry master server key. Default value is provided for twinny's Symmetry server.",
"default": "4b4a9cc325d134dee6679e9407420023531fd7e96c563f6c5d00fd5549b77435"
},
"twinny.githubToken": {
"order": 28,
"order": 20,
"type": "string",
"default": "",
"description": "Your GitHub token. Used for fetching GitHub data."
"markdownDescription": "Your personal GitHub access token. This is used for fetching data from GitHub repositories. Keep this token secure and do not share it."
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const EVENT_NAME = {
twinnySetSessionContext: "twinny-set-session-context",
twinnySetTab: "twinny-set-tab",
twinnySetWorkspaceContext: "twinny-set-workspace-context",
twinnyEditDefaultTemplates: "twinny-edit-default-templates",
twinnyStartSymmetryProvider: "twinny-start-symmetry-provider",
twinnyStopGeneration: "twinny-stop-generation",
twinnyStopSymmetryProvider: "twinny-stop-symmetry-provider",
Expand Down
10 changes: 10 additions & 0 deletions src/extension/providers/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export class BaseProvider {
[EVENT_NAME.twinnyTextSelection]: this.getSelectedText,
[EVENT_NAME.twinnyFileListRequest]: this.fileListRequest,
[EVENT_NAME.twinnyNewConversation]: this.twinnyNewConversation,
[EVENT_NAME.twinnyEditDefaultTemplates]: this.editDefaultTemplates,
[TWINNY_COMMAND_NAME.settings]: this.openSettings
}
this.webView?.onDidReceiveMessage((message: ClientMessage<Message[]>) => {
Expand All @@ -168,6 +169,15 @@ export class BaseProvider {
)
}

public editDefaultTemplates = async () => {
if (!this._templateDir) return
await vscode.commands.executeCommand(
"vscode.openFolder",
vscode.Uri.file(this._templateDir),
true
)
}

public destroyStream = () => {
this._chatService?.destroyStream()
this.webView?.postMessage({
Expand Down
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ export async function activate(context: ExtensionContext) {
completionProvider.onError()
sidebarProvider.destroyStream()
}),
commands.registerCommand(TWINNY_COMMAND_NAME.templates, async () => {
await vscode.commands.executeCommand(
"vscode.openFolder",
vscode.Uri.file(templateDir),
true
)
}),
commands.registerCommand(TWINNY_COMMAND_NAME.manageProviders, async () => {
commands.executeCommand(
"setContext",
Expand Down
Loading

0 comments on commit 6d609d2

Please sign in to comment.