diff --git a/README.md b/README.md index 77aa6ef..d8080f9 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,17 @@ Refer following sections for more details of how to configure various openai ser "chatgpt.gpt3.apiBaseUrl": "", ``` +### Configuring Custom Model Names + +To use a custom model name for local or self-hosted LLMs compatible with OpenAI, set the `chatgpt.gpt3.model` configuration to `"custom"` and specify your custom model name in the `chatgpt.gpt3.customModel` configuration. + +Example configuration for a custom model name: + +```json + "chatgpt.gpt3.model": "custom", + "chatgpt.gpt3.customModel": "my-custom-model-name", +``` + ## How to install locally - Install `vsce` if you don't have it on your machine (The Visual Studio Code Extension Manager) diff --git a/package.json b/package.json index dfcd2b5..eb0f8dd 100644 --- a/package.json +++ b/package.json @@ -413,12 +413,13 @@ "text-ada-001", "code-davinci-002", "code-cushman-001", + "custom", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307" ], "default": "gpt-3.5-turbo", - "markdownDescription": "OpenAI models to use for your prompts. [Documentation](https://beta.openai.com/docs/models/models). \n\n**If you face 400 Bad Request please make sure you are using the right model for your integration method.**", + "markdownDescription": "OpenAI models to use for your prompts. [Documentation](https://beta.openai.com/docs/models/models). \n\n**If you face 400 Bad Request please make sure you are using the right model for your integration method.** \n\nFor local or self-hosted LLMs compatible with OpenAI, you can select `custom` and specify your custom model name in `chatgpt.gpt3.customModel`.", "order": 33, "enumItemLabels": [ "OpenAI API Key - gpt-3.5-turbo", @@ -445,6 +446,7 @@ "OpenAI API Key - text-ada-001", "OpenAI API Key - code-davinci-002", "OpenAI API Key - code-cushman-001", + "Custom Model", "Claude 3 - claude-3-opus-20240229", "Claude 3 - claude-3-sonnet-20240229", "Claude 3 - claude-3-haiku-20240307" @@ -474,66 +476,73 @@ "text-ada-001", "code-davinci-002", "code-cushman-001", + "Select this option to specify a custom model name for local or self-hosted LLMs compatible with OpenAI.", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307" ] }, + "chatgpt.gpt3.customModel": { + "type": "string", + "default": "", + "markdownDescription": "Specify your custom model name here if you selected `custom` in `chatgpt.gpt3.model`. This allows you to use a custom model name for local or self-hosted LLMs compatible with OpenAI.", + "order": 34 + }, "chatgpt.gpt3.maxTokens": { "type": "number", "default": 1024, "markdownDescription": "The maximum number of tokens to generate in the completion. \n\nThe token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-max_tokens) \n\n**Please enable OpenAI API Key method to use this setting.**", - "order": 34 + "order": 35 }, "chatgpt.gpt3.temperature": { "type": "number", "default": 1, "markdownDescription": "What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.\n\nIt is recommended altering this or top_p but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-temperature) \n\n**Please enable OpenAI API Key method to use this setting.**", - "order": 35 + "order": 36 }, "chatgpt.gpt3.top_p": { "type": "number", "default": 1, "markdownDescription": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. \n\nIt is recommended altering this or temperature but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-top_p) \n\n**Please enable OpenAI API Key method to use this setting.**", - "order": 36 + "order": 37 }, "chatgpt.response.showNotification": { "type": "boolean", "default": false, "description": "Choose whether you'd like to receive a notification when ChatGPT bot responds to your query.", - "order": 37 + "order": 38 }, "chatgpt.response.autoScroll": { "type": "boolean", "default": true, "description": "Whenever there is a new question or response added to the conversation window, extension will automatically scroll to the bottom. You can change that behavior by disabling this setting.", - "order": 38 + "order": 39 }, "chatgpt.telemetry.disable": { "type": "boolean", "default": false, "markdownDescription": "Specify if you want to disable the telemetry. This extension also respects your default vs-code telemetry setting `telemetry.telemetryLevel`. We check both settings for telemetry. **Important**: No user data is tracked, we only use telemetry to see what is used, and what isn't. This allows us to make accurate decisions on what to add or enhance to the extension.", - "order": 39 + "order": 40 }, "chatgpt.gpt3.googleCSEApiKey": { "type": "string", "markdownDescription": "Google search API key.", - "order": 40 + "order": 41 }, "chatgpt.gpt3.googleCSEId": { "type": "string", "markdownDescription": "Google custom search ID.", - "order": 41 + "order": 42 }, "chatgpt.gpt3.serperKey": { "type": "string", "markdownDescription": "API key of Serper search API.", - "order": 42 + "order": 43 }, "chatgpt.gpt3.bingKey": { "type": "string", "markdownDescription": "API key of Bing search API.", - "order": 43 + "order": 44 } } } @@ -561,7 +570,7 @@ "@typescript-eslint/parser": "^7.11.0", "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.24.0", - "esbuild": "^0.21.4", + "esbuild": "^0.20.1", "eslint": "^8.56.0", "glob": "^10.3.10", "mocha": "^10.3.0", @@ -573,7 +582,7 @@ "dependencies": { "@langchain/anthropic": "^0.1.10", "@types/minimatch": "^5.1.2", - "axios": "^1.7.2", + "axios": "^1.6.7", "cheerio": "^1.0.0-rc.12", "delay": "^6.0.0", "eventsource-parser": "^1.1.2", @@ -597,4 +606,4 @@ "resolutions": { "clone-deep": "^4.0.1" } -} \ No newline at end of file +} diff --git a/src/chatgpt-view-provider.ts b/src/chatgpt-view-provider.ts index 2157f59..def2f77 100644 --- a/src/chatgpt-view-provider.ts +++ b/src/chatgpt-view-provider.ts @@ -699,7 +699,7 @@ export default class ChatGptViewProvider implements vscode.WebviewViewProvider { + Stop responding
@@ -712,7 +712,7 @@ export default class ChatGptViewProvider implements vscode.WebviewViewProvider { onInput="this.parentNode.dataset.replicatedValue = this.value">